mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roman Kisel <romank@linux.microsoft.com>
To: Thorsten Blum <thorsten.blum@linux.dev>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: linux-hardening@vger.kernel.org, linux-hyperv@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hv_netvsc: Replace one-element array with flexible array member
Date: Thu, 16 Jan 2025 12:45:53 -0800	[thread overview]
Message-ID: <d136130c-6895-4394-88c2-2911123afce5@linux.microsoft.com> (raw)
In-Reply-To: <20250116201635.47870-2-thorsten.blum@linux.dev>



On 1/16/2025 12:16 PM, Thorsten Blum wrote:
> Replace the deprecated one-element array with a modern flexible array
> member in the struct nvsp_1_message_send_receive_buffer_complete.
> 
> Link: https://github.com/KSPP/linux/issues/79
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>   drivers/net/hyperv/hyperv_net.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
> index e690b95b1bbb..234db693cefa 100644
> --- a/drivers/net/hyperv/hyperv_net.h
> +++ b/drivers/net/hyperv/hyperv_net.h
> @@ -464,7 +464,7 @@ struct nvsp_1_message_send_receive_buffer_complete {
>   	 *  LargeOffset                            SmallOffset
>   	 */
>   
> -	struct nvsp_1_receive_buffer_section sections[1];
> +	struct nvsp_1_receive_buffer_section sections[];
>   } __packed;
>   
>   /*

1. How have you tested the change?

2. There is an instance of

`sizeof(struct nvsp_1_message_send_receive_buffer_complete))`

and your change decreases the size of the struct. Why do you think
that is fine?

-- 
Thank you,
Roman


  reply	other threads:[~2025-01-16 20:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-16 20:16 Thorsten Blum
2025-01-16 20:45 ` Roman Kisel [this message]
2025-01-16 21:14   ` Thorsten Blum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d136130c-6895-4394-88c2-2911123afce5@linux.microsoft.com \
    --to=romank@linux.microsoft.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=edumazet@google.com \
    --cc=haiyangz@microsoft.com \
    --cc=kuba@kernel.org \
    --cc=kys@microsoft.com \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=thorsten.blum@linux.dev \
    --cc=wei.liu@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®