Skip to content

Commit

Permalink
net: libwx: Replace zero-length array with flexible-array member
Browse files Browse the repository at this point in the history
Zero-length arrays as fake flexible arrays are deprecated, and we are
moving towards adopting C99 flexible-array members instead.

Transform zero-length array into flexible-array member in struct
wx_q_vector.

Link: https://github.com/KSPP/linux/issues/21
Link: https://github.com/KSPP/linux/issues/286
Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/ZGKGwtsobVZecWa4@work
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Gustavo A. R. Silva authored and Jakub Kicinski committed May 18, 2023
1 parent af2eab1 commit fe6559f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/wangxun/libwx/wx_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ struct wx_q_vector {
char name[IFNAMSIZ + 17];

/* for dynamic allocation of rings associated with this q_vector */
struct wx_ring ring[0] ____cacheline_internodealigned_in_smp;
struct wx_ring ring[] ____cacheline_internodealigned_in_smp;
};

enum wx_isb_idx {
Expand Down

0 comments on commit fe6559f

Please sign in to comment.