]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: libwx: Replace zero-length array with flexible-array member
authorGustavo A. R. Silva <gustavoars@kernel.org>
Mon, 15 May 2023 19:23:46 +0000 (13:23 -0600)
committerJakub Kicinski <kuba@kernel.org>
Thu, 18 May 2023 04:24:37 +0000 (21:24 -0700)
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>
drivers/net/ethernet/wangxun/libwx/wx_type.h

index 32f952d930097d827fe7a6c9e1a91bec2c2dc808..cbe7f184b50edddbee6836309f48ebff15fc57a2 100644 (file)
@@ -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 {