netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: qed: make 'qed_ll2_ops_pass' as __maybe_unused
@ 2025-02-25 20:09 Arnd Bergmann
  2025-02-27 18:33 ` Simon Horman
  2025-02-28  1:29 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2025-02-25 20:09 UTC (permalink / raw)
  To: Manish Chopra; +Cc: Arnd Bergmann, netdev, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

gcc warns about unused const variables even in header files when
building with W=1:

    In file included from include/linux/qed/qed_rdma_if.h:14,
                     from drivers/net/ethernet/qlogic/qed/qed_rdma.h:16,
                     from drivers/net/ethernet/qlogic/qed/qed_cxt.c:23:
    include/linux/qed/qed_ll2_if.h:270:33: error: 'qed_ll2_ops_pass' defined but not used [-Werror=unused-const-variable=]
      270 | static const struct qed_ll2_ops qed_ll2_ops_pass = {

This one is intentional, so mark it as __maybe_unused to it can be
included from a file that doesn't use this variable.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/qed/qed_ll2_if.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/qed/qed_ll2_if.h b/include/linux/qed/qed_ll2_if.h
index 5b67cd03276e..aa29ac53b833 100644
--- a/include/linux/qed/qed_ll2_if.h
+++ b/include/linux/qed/qed_ll2_if.h
@@ -267,7 +267,7 @@ struct qed_ll2_ops {
 int qed_ll2_alloc_if(struct qed_dev *);
 void qed_ll2_dealloc_if(struct qed_dev *);
 #else
-static const struct qed_ll2_ops qed_ll2_ops_pass = {
+static __maybe_unused const struct qed_ll2_ops qed_ll2_ops_pass = {
 	.start = NULL,
 	.stop = NULL,
 	.start_xmit = NULL,
-- 
2.39.5


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

* Re: [PATCH] net: qed: make 'qed_ll2_ops_pass' as __maybe_unused
  2025-02-25 20:09 [PATCH] net: qed: make 'qed_ll2_ops_pass' as __maybe_unused Arnd Bergmann
@ 2025-02-27 18:33 ` Simon Horman
  2025-02-28  1:29 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2025-02-27 18:33 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Manish Chopra, Arnd Bergmann, netdev, linux-kernel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni

+ Andrew, Dave, Eric, Jakub, and Paolo

On Tue, Feb 25, 2025 at 09:09:23PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> gcc warns about unused const variables even in header files when
> building with W=1:
> 
>     In file included from include/linux/qed/qed_rdma_if.h:14,
>                      from drivers/net/ethernet/qlogic/qed/qed_rdma.h:16,
>                      from drivers/net/ethernet/qlogic/qed/qed_cxt.c:23:
>     include/linux/qed/qed_ll2_if.h:270:33: error: 'qed_ll2_ops_pass' defined but not used [-Werror=unused-const-variable=]
>       270 | static const struct qed_ll2_ops qed_ll2_ops_pass = {
> 
> This one is intentional, so mark it as __maybe_unused to it can be
> included from a file that doesn't use this variable.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Simon Horman <horms@kernel.org> # build-tested

This is marked as being not a local patch in netdev patchwork.
That doesn't seem right to me and perhaps this will address that.

pw-bot: under-review

Possibly this because is because while qed_rdma_if.h is
included in the QLOGIC QL4xxx ETHERNET DRIVER section
of MAINTAINERS, it is not included in the NETWORKING DRIVERS section.

I will plan to submit a patch to address that.

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

* Re: [PATCH] net: qed: make 'qed_ll2_ops_pass' as __maybe_unused
  2025-02-25 20:09 [PATCH] net: qed: make 'qed_ll2_ops_pass' as __maybe_unused Arnd Bergmann
  2025-02-27 18:33 ` Simon Horman
@ 2025-02-28  1:29 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-02-28  1:29 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: manishc, arnd, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 25 Feb 2025 21:09:23 +0100 you wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> gcc warns about unused const variables even in header files when
> building with W=1:
> 
>     In file included from include/linux/qed/qed_rdma_if.h:14,
>                      from drivers/net/ethernet/qlogic/qed/qed_rdma.h:16,
>                      from drivers/net/ethernet/qlogic/qed/qed_cxt.c:23:
>     include/linux/qed/qed_ll2_if.h:270:33: error: 'qed_ll2_ops_pass' defined but not used [-Werror=unused-const-variable=]
>       270 | static const struct qed_ll2_ops qed_ll2_ops_pass = {
> 
> [...]

Here is the summary with links:
  - net: qed: make 'qed_ll2_ops_pass' as __maybe_unused
    https://git.kernel.org/netdev/net-next/c/f8131f4cc5bd

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-02-28  1:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-25 20:09 [PATCH] net: qed: make 'qed_ll2_ops_pass' as __maybe_unused Arnd Bergmann
2025-02-27 18:33 ` Simon Horman
2025-02-28  1:29 ` patchwork-bot+netdevbpf

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).