From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 481BEC433B4 for ; Mon, 19 Apr 2021 16:07:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 170DE61354 for ; Mon, 19 Apr 2021 16:07:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238369AbhDSQHc (ORCPT ); Mon, 19 Apr 2021 12:07:32 -0400 Received: from mga06.intel.com ([134.134.136.31]:29355 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238377AbhDSQHS (ORCPT ); Mon, 19 Apr 2021 12:07:18 -0400 IronPort-SDR: EeRepVeNmIx4ajAMZfdyWqJRLypUE+vOxaFFCzYj2IIRW+428cAQTNZbqlagAtMBPBSaqWOXF1 sutczh4PLDHg== X-IronPort-AV: E=McAfee;i="6200,9189,9959"; a="256665638" X-IronPort-AV: E=Sophos;i="5.82,234,1613462400"; d="scan'208";a="256665638" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2021 09:04:12 -0700 IronPort-SDR: t5DAkXmlvwniORyDpzVffceigCGlOZ133P9EB9TGAXhCmbq9kozvQc4vsSZzXrCgvH9xXACkPm WTj4fin83e9Q== X-IronPort-AV: E=Sophos;i="5.82,234,1613462400"; d="scan'208";a="420062661" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2021 09:04:11 -0700 Date: Mon, 19 Apr 2021 09:04:11 -0700 From: Ira Weiny To: Wan Jiabing Cc: Dan Williams , Vishal Verma , Dave Jiang , linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, kael_w@yeah.net Subject: Re: [PATCH] libnvdimm.h: Remove duplicate struct declaration Message-ID: <20210419160411.GG1904484@iweiny-DESK2.sc.intel.com> References: <20210419112725.42145-1-wanjiabing@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210419112725.42145-1-wanjiabing@vivo.com> User-Agent: Mutt/1.11.1 (2018-12-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 19, 2021 at 07:27:25PM +0800, Wan Jiabing wrote: > struct device is declared at 133rd line. > The declaration here is unnecessary. Remove it. > > Signed-off-by: Wan Jiabing > --- > include/linux/libnvdimm.h | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h > index 01f251b6e36c..89b69e645ac7 100644 > --- a/include/linux/libnvdimm.h > +++ b/include/linux/libnvdimm.h > @@ -141,7 +141,6 @@ static inline void __iomem *devm_nvdimm_ioremap(struct device *dev, > > struct nvdimm_bus; > struct module; > -struct device; > struct nd_blk_region; What is the coding style preference for pre-declarations like this? Should they be placed at the top of the file? The patch is reasonable but if the intent is to declare right before use for clarity, both devm_nvdimm_memremap() and nd_blk_region_desc() use struct device. So perhaps this duplicate is on purpose? Ira > struct nd_blk_region_desc { > int (*enable)(struct nvdimm_bus *nvdimm_bus, struct device *dev); > -- > 2.25.1 >