Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: airoha: Avoid -Wflex-array-member-not-at-end warning

-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
getting ready to enable it, globally.

Move the conflicting declaration to the end of the corresponding
structure. Notice that `struct airoha_foe_entry` is a flexible
structure, this is a structure that contains a flexible-array
member.

Fix the following warning:

drivers/net/ethernet/airoha/airoha_eth.h:474:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/aNFYVYLXQDqm4yxb@kspp
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Gustavo A. R. Silva and committed by
Jakub Kicinski
09630ab9 b650bf09

+3 -1
+3 -1
drivers/net/ethernet/airoha/airoha_eth.h
··· 471 471 }; 472 472 }; 473 473 474 - struct airoha_foe_entry data; 475 474 struct hlist_node l2_subflow_node; /* PPE L2 subflow entry */ 476 475 u32 hash; 477 476 ··· 479 480 480 481 struct rhash_head node; 481 482 unsigned long cookie; 483 + 484 + /* Must be last --ends in a flexible-array member. */ 485 + struct airoha_foe_entry data; 482 486 }; 483 487 484 488 struct airoha_wdma_info {