Skip to content

Commit f8131f4

Browse files
arndbkuba-moo
authored andcommitted
net: qed: make 'qed_ll2_ops_pass' as __maybe_unused
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 Link: https://patch.msgid.link/20250225200926.4057723-1-arnd@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 357660d commit f8131f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/qed/qed_ll2_if.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ struct qed_ll2_ops {
267267
int qed_ll2_alloc_if(struct qed_dev *);
268268
void qed_ll2_dealloc_if(struct qed_dev *);
269269
#else
270-
static const struct qed_ll2_ops qed_ll2_ops_pass = {
270+
static __maybe_unused const struct qed_ll2_ops qed_ll2_ops_pass = {
271271
.start = NULL,
272272
.stop = NULL,
273273
.start_xmit = NULL,

0 commit comments

Comments
 (0)