Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp247662ybe; Wed, 18 Sep 2019 16:30:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRBJ3fPYh3k8CHoEuc7e27GNo5kP7VmoD/X6AP/8nSGnYRAxRbbozbaYdZo2zPaLw/Op3c X-Received: by 2002:a17:906:f204:: with SMTP id gt4mr9460322ejb.299.1568849457706; Wed, 18 Sep 2019 16:30:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568849457; cv=none; d=google.com; s=arc-20160816; b=mXJF6pW4r5Y4+qaJcCQNEhsScd7jLIbeBKQTg2iDM8OkqEyEr7kbtmbmASxksrgAtj pp2PqvnaICNZqwPRCxyaTR78WEdS803atN1nWUZfyO4DOkC81Ff9CGA9NkK5suMJUaDs WQDJDwe0X3QKqKOaSBNK/wc+kfHHBJUnuw+VVWMq62ZzgDx171OPV6KbnKOGWVmoSR5/ sXXxkEtphsh6f/GFeRSZZhV/+n2CS5+aK7zx24xfjrz4YCYXGHijFBAk0zk2a0TDCkJT 9I56zFXW38oMZIT7EYo5efCN/HHEanqfWmFaFnOqQ/fLHugr/zav6q3+fhNQa+tzmnRj lsDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=akQuM5sr03RZQ0F7kJY3+66jKxLZnsTpJuQ3RVbF6+c=; b=DSxoxi0j8J5cgSK9126E3XtlxDH7DD5wnNKHSiH02G1NHJwxfL19JxZXq+zzJgZqvH vjwl0WSXxJ65s64YeTfjlP6WB4ru+HbQ2KefB0fFMgyNsJDqOnmmWECVdaAjS7d/RN64 wNNl1yQSyskswvMpMFtN6gzkDL0f09z+mxZakTxBo9SLFQp+fh5D35Xj9B0zETZB1Tub eBwTd9GB4LWDZNpuy/+GCqqTAFxAuRHugpSbzbXwZWmRbeH2p4twWbL+CCE6+9SkFoJm lm2uj/5p1P9Yyh0/EFIuYVQYunrCYVb0gZSjj0HmbnW0GVVEKGx8tKfMXW3he3nfh/ZH xv8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1si4591343edj.354.2019.09.18.16.30.34; Wed, 18 Sep 2019 16:30:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388101AbfIRVpJ (ORCPT + 99 others); Wed, 18 Sep 2019 17:45:09 -0400 Received: from mga09.intel.com ([134.134.136.24]:49924 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388087AbfIRVpI (ORCPT ); Wed, 18 Sep 2019 17:45:08 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Sep 2019 14:45:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,522,1559545200"; d="scan'208";a="338457730" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by orsmga004.jf.intel.com with ESMTP; 18 Sep 2019 14:45:07 -0700 Date: Wed, 18 Sep 2019 14:45:07 -0700 From: Ira Weiny To: Nathan Chancellor Cc: Dan Williams , Vishal Verma , Dave Jiang , Keith Busch , Jason Gunthorpe , linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] libnvdimm/nfit_test: Fix acpi_handle redefinition Message-ID: <20190918214506.GA20171@iweiny-DESK2.sc.intel.com> References: <20190918042148.77553-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190918042148.77553-1-natechancellor@gmail.com> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 17, 2019 at 09:21:49PM -0700, Nathan Chancellor wrote: > After commit 62974fc389b3 ("libnvdimm: Enable unit test infrastructure > compile checks"), clang warns: > > In file included from > ../drivers/nvdimm/../../tools/testing/nvdimm/test/iomap.c:15: > ../drivers/nvdimm/../../tools/testing/nvdimm/test/nfit_test.h:206:15: > warning: redefinition of typedef 'acpi_handle' is a C11 feature > [-Wtypedef-redefinition] > typedef void *acpi_handle; > ^ > ../include/acpi/actypes.h:424:15: note: previous definition is here > typedef void *acpi_handle; /* Actually a ptr to a NS Node */ > ^ > 1 warning generated. > > The include chain: > > iomap.c -> > linux/acpi.h -> > acpi/acpi.h -> > acpi/actypes.h > nfit_test.h > > Avoid this by including linux/acpi.h in nfit_test.h, which allows us to > remove both the typedef and the forward declaration of acpi_object. > > Link: https://github.com/ClangBuiltLinux/linux/issues/660 > Signed-off-by: Nathan Chancellor Reviewed-by: Ira Weiny > --- > > I know that every maintainer has their own thing with the number of > includes in each header file; this issue can be solved in a various > number of ways, I went with the smallest diff stat. Please solve it in a > different way if you see fit :) > > tools/testing/nvdimm/test/nfit_test.h | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/tools/testing/nvdimm/test/nfit_test.h b/tools/testing/nvdimm/test/nfit_test.h > index 448d686da8b1..0bf5640f1f07 100644 > --- a/tools/testing/nvdimm/test/nfit_test.h > +++ b/tools/testing/nvdimm/test/nfit_test.h > @@ -4,6 +4,7 @@ > */ > #ifndef __NFIT_TEST_H__ > #define __NFIT_TEST_H__ > +#include > #include > #include > #include > @@ -202,9 +203,6 @@ struct nd_intel_lss { > __u32 status; > } __packed; > > -union acpi_object; > -typedef void *acpi_handle; > - > typedef struct nfit_test_resource *(*nfit_test_lookup_fn)(resource_size_t); > typedef union acpi_object *(*nfit_test_evaluate_dsm_fn)(acpi_handle handle, > const guid_t *guid, u64 rev, u64 func, > -- > 2.23.0 >