linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: gpib: Fix PCI header include guard
@ 2024-10-15 19:55 Nathan Chancellor
  2024-10-16  5:06 ` Javier Carrasco
  2024-10-17  9:49 ` Dave Penkler
  0 siblings, 2 replies; 3+ messages in thread
From: Nathan Chancellor @ 2024-10-15 19:55 UTC (permalink / raw)
  To: Dave Penkler, Greg Kroah-Hartman
  Cc: linux-staging, llvm, patches, Nathan Chancellor

Clang warns (or errors with CONFIG_WERROR=y):

  In file included from drivers/staging/gpib/ines/ines_gpib.c:19:
  drivers/staging/gpib/include/gpib_pci_ids.h:3:9: error: '__GPIB_PCI_IDS_H' is used as a header guard here, followed by #define of a different macro [-Werror,-Wheader-guard]
      3 | #ifndef __GPIB_PCI_IDS_H
        |         ^~~~~~~~~~~~~~~~
  drivers/staging/gpib/include/gpib_pci_ids.h:4:9: note: '__GPIB_LINUX_PCI_IDS_H' is defined here; did you mean '__GPIB_PCI_IDS_H'?
      4 | #define __GPIB_LINUX_PCI_IDS_H
        |         ^~~~~~~~~~~~~~~~~~~~~~
        |         __GPIB_PCI_IDS_H

Fix the define to match the guard like the note suggests, as that is
clearly what was intended here.

Fixes: 6c52d5e3cde2 ("staging: gpib: Add common include files for GPIB drivers")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/staging/gpib/include/gpib_pci_ids.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/gpib/include/gpib_pci_ids.h b/drivers/staging/gpib/include/gpib_pci_ids.h
index 162b02deb0ade7ede08ad81ebd41a79727374448..52dcab07a7d188925a4d696d6b658f397f3b0153 100644
--- a/drivers/staging/gpib/include/gpib_pci_ids.h
+++ b/drivers/staging/gpib/include/gpib_pci_ids.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 
 #ifndef __GPIB_PCI_IDS_H
-#define __GPIB_LINUX_PCI_IDS_H
+#define __GPIB_PCI_IDS_H
 
 #ifndef PCI_VENDOR_ID_AMCC
 #define PCI_VENDOR_ID_AMCC	0x10e8

---
base-commit: e0eb7cc4d70d672cf9344916aba58136fd6e495e
change-id: 20241015-staging-gpib-fix-pci-header-guard-997bbc923818

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: gpib: Fix PCI header include guard
  2024-10-15 19:55 [PATCH] staging: gpib: Fix PCI header include guard Nathan Chancellor
@ 2024-10-16  5:06 ` Javier Carrasco
  2024-10-17  9:49 ` Dave Penkler
  1 sibling, 0 replies; 3+ messages in thread
From: Javier Carrasco @ 2024-10-16  5:06 UTC (permalink / raw)
  To: Nathan Chancellor, Dave Penkler, Greg Kroah-Hartman
  Cc: linux-staging, llvm, patches

On 15/10/2024 21:55, Nathan Chancellor wrote:
> Clang warns (or errors with CONFIG_WERROR=y):
> 
>   In file included from drivers/staging/gpib/ines/ines_gpib.c:19:
>   drivers/staging/gpib/include/gpib_pci_ids.h:3:9: error: '__GPIB_PCI_IDS_H' is used as a header guard here, followed by #define of a different macro [-Werror,-Wheader-guard]
>       3 | #ifndef __GPIB_PCI_IDS_H
>         |         ^~~~~~~~~~~~~~~~
>   drivers/staging/gpib/include/gpib_pci_ids.h:4:9: note: '__GPIB_LINUX_PCI_IDS_H' is defined here; did you mean '__GPIB_PCI_IDS_H'?
>       4 | #define __GPIB_LINUX_PCI_IDS_H
>         |         ^~~~~~~~~~~~~~~~~~~~~~
>         |         __GPIB_PCI_IDS_H
> 
> Fix the define to match the guard like the note suggests, as that is
> clearly what was intended here.
> 
> Fixes: 6c52d5e3cde2 ("staging: gpib: Add common include files for GPIB drivers")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>  drivers/staging/gpib/include/gpib_pci_ids.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/gpib/include/gpib_pci_ids.h b/drivers/staging/gpib/include/gpib_pci_ids.h
> index 162b02deb0ade7ede08ad81ebd41a79727374448..52dcab07a7d188925a4d696d6b658f397f3b0153 100644
> --- a/drivers/staging/gpib/include/gpib_pci_ids.h
> +++ b/drivers/staging/gpib/include/gpib_pci_ids.h
> @@ -1,7 +1,7 @@
>  /* SPDX-License-Identifier: GPL-2.0 */
>  
>  #ifndef __GPIB_PCI_IDS_H
> -#define __GPIB_LINUX_PCI_IDS_H
> +#define __GPIB_PCI_IDS_H
>  
>  #ifndef PCI_VENDOR_ID_AMCC
>  #define PCI_VENDOR_ID_AMCC	0x10e8
> 
> ---
> base-commit: e0eb7cc4d70d672cf9344916aba58136fd6e495e
> change-id: 20241015-staging-gpib-fix-pci-header-guard-997bbc923818
> 
> Best regards,


I just faced this issue when compiling linux-next/master with GCC and
allyesconfig. Renaming the guard as Nathan fixed the bug.

Tested-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: gpib: Fix PCI header include guard
  2024-10-15 19:55 [PATCH] staging: gpib: Fix PCI header include guard Nathan Chancellor
  2024-10-16  5:06 ` Javier Carrasco
@ 2024-10-17  9:49 ` Dave Penkler
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Penkler @ 2024-10-17  9:49 UTC (permalink / raw)
  To: Nathan Chancellor; +Cc: Greg Kroah-Hartman, linux-staging, llvm, patches

On Tue, Oct 15, 2024 at 12:55:33PM -0700, Nathan Chancellor wrote:
> Clang warns (or errors with CONFIG_WERROR=y):
> 
>   In file included from drivers/staging/gpib/ines/ines_gpib.c:19:
>   drivers/staging/gpib/include/gpib_pci_ids.h:3:9: error: '__GPIB_PCI_IDS_H' is used as a header guard here, followed by #define of a different macro [-Werror,-Wheader-guard]
>       3 | #ifndef __GPIB_PCI_IDS_H
>         |         ^~~~~~~~~~~~~~~~
>   drivers/staging/gpib/include/gpib_pci_ids.h:4:9: note: '__GPIB_LINUX_PCI_IDS_H' is defined here; did you mean '__GPIB_PCI_IDS_H'?
>       4 | #define __GPIB_LINUX_PCI_IDS_H
>         |         ^~~~~~~~~~~~~~~~~~~~~~
>         |         __GPIB_PCI_IDS_H
> 
> Fix the define to match the guard like the note suggests, as that is
> clearly what was intended here.
> 
> Fixes: 6c52d5e3cde2 ("staging: gpib: Add common include files for GPIB drivers")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>  drivers/staging/gpib/include/gpib_pci_ids.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/gpib/include/gpib_pci_ids.h b/drivers/staging/gpib/include/gpib_pci_ids.h
> index 162b02deb0ade7ede08ad81ebd41a79727374448..52dcab07a7d188925a4d696d6b658f397f3b0153 100644
> --- a/drivers/staging/gpib/include/gpib_pci_ids.h
> +++ b/drivers/staging/gpib/include/gpib_pci_ids.h
> @@ -1,7 +1,7 @@
>  /* SPDX-License-Identifier: GPL-2.0 */
>  
>  #ifndef __GPIB_PCI_IDS_H
> -#define __GPIB_LINUX_PCI_IDS_H
> +#define __GPIB_PCI_IDS_H
>  
>  #ifndef PCI_VENDOR_ID_AMCC
>  #define PCI_VENDOR_ID_AMCC	0x10e8
> 
> ---
> base-commit: e0eb7cc4d70d672cf9344916aba58136fd6e495e
> change-id: 20241015-staging-gpib-fix-pci-header-guard-997bbc923818
> 
> Best regards,
> -- 
> Nathan Chancellor <nathan@kernel.org>
> 
Thanks.
Reviewed-by: Dave Penkler <dpenkler@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-17  9:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-15 19:55 [PATCH] staging: gpib: Fix PCI header include guard Nathan Chancellor
2024-10-16  5:06 ` Javier Carrasco
2024-10-17  9:49 ` Dave Penkler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).