netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] net: libwx: Replace zero-length array with flexible-array member
@ 2023-05-15 19:23 Gustavo A. R. Silva
  2023-05-16  8:35 ` Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2023-05-15 19:23 UTC (permalink / raw)
  To: Jiawen Wu, Mengyuan Lou, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni
  Cc: netdev, linux-kernel, Gustavo A. R. Silva, linux-hardening

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>
---
 drivers/net/ethernet/wangxun/libwx/wx_type.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/wangxun/libwx/wx_type.h b/drivers/net/ethernet/wangxun/libwx/wx_type.h
index 32f952d93009..cbe7f184b50e 100644
--- a/drivers/net/ethernet/wangxun/libwx/wx_type.h
+++ b/drivers/net/ethernet/wangxun/libwx/wx_type.h
@@ -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 {
-- 
2.34.1


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

* Re: [PATCH][next] net: libwx: Replace zero-length array with flexible-array member
  2023-05-15 19:23 [PATCH][next] net: libwx: Replace zero-length array with flexible-array member Gustavo A. R. Silva
@ 2023-05-16  8:35 ` Simon Horman
  2023-05-16 18:19 ` Kees Cook
  2023-05-18  4:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2023-05-16  8:35 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Jiawen Wu, Mengyuan Lou, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, linux-kernel,
	linux-hardening

On Mon, May 15, 2023 at 01:23:46PM -0600, Gustavo A. R. Silva wrote:
> 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>


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

* Re: [PATCH][next] net: libwx: Replace zero-length array with flexible-array member
  2023-05-15 19:23 [PATCH][next] net: libwx: Replace zero-length array with flexible-array member Gustavo A. R. Silva
  2023-05-16  8:35 ` Simon Horman
@ 2023-05-16 18:19 ` Kees Cook
  2023-05-18  4:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Kees Cook @ 2023-05-16 18:19 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Jiawen Wu, Mengyuan Lou, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, linux-kernel,
	linux-hardening

On Mon, May 15, 2023 at 01:23:46PM -0600, Gustavo A. R. Silva wrote:
> 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: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

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

* Re: [PATCH][next] net: libwx: Replace zero-length array with flexible-array member
  2023-05-15 19:23 [PATCH][next] net: libwx: Replace zero-length array with flexible-array member Gustavo A. R. Silva
  2023-05-16  8:35 ` Simon Horman
  2023-05-16 18:19 ` Kees Cook
@ 2023-05-18  4:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-05-18  4:40 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: jiawenwu, mengyuanlou, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel, linux-hardening

Hello:

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

On Mon, 15 May 2023 13:23:46 -0600 you wrote:
> 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>
> 
> [...]

Here is the summary with links:
  - [next] net: libwx: Replace zero-length array with flexible-array member
    https://git.kernel.org/netdev/net-next/c/fe6559fab328

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] 4+ messages in thread

end of thread, other threads:[~2023-05-18  4:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-15 19:23 [PATCH][next] net: libwx: Replace zero-length array with flexible-array member Gustavo A. R. Silva
2023-05-16  8:35 ` Simon Horman
2023-05-16 18:19 ` Kees Cook
2023-05-18  4:40 ` 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).