hv_netvsc: Replace one-element array with flexible array member
PATCH 1/1 hv_netvsc: Replace one-element array with flexible array member
Replace the deprecated one-element array with a modern flexible array member in the struct nvsp_1_message_send_receive_buffer_complete.
--- drivers/net/hyperv/hyperv_net.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/hyperv/hyperv_net.h +1 -1
@@ -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;/*
Signature · 1 line
2.48.0
Quoted 14 lines · Thorsten Blum
Replace the deprecated one-element array with a modern flexible array member in the struct
nvsp_1_message_send_receive_buffer_complete.Signed-off-by Thorsten Blum <[email protected]>--- drivers/net/hyperv/hyperv_net.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/hyperv/hyperv_net.h +0
-0
drivers/net/hyperv/hyperv_net.h struct nvsp_1_message_send_receive_buffer_complete { · line 470
Quoted 8 lines
drivers/net/hyperv/hyperv_net.h +1
-1@@ -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?
Signature · 2 lines
Thank you, Roman
Quoted 13 lines · Roman Kisel
Quoted 12 lines · Thorsten Blum
Replace the deprecated one-element array with a modern flexible array member in the struct
nvsp_1_message_send_receive_buffer_complete.Signed-off-by Thorsten Blum <[email protected]>--- drivers/net/hyperv/hyperv_net.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/hyperv/hyperv_net.h +0
-0@@ -464,7 +464,7 @@ struct nvsp_1_message_send_receive_buffer_complete {
Quoted 8 lines
drivers/net/hyperv/hyperv_net.h struct nvsp_1_message_send_receive_buffer_complete { · line 470
Quoted 6 lines
drivers/net/hyperv/hyperv_net.h +1
-0* 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?
Compile-tested only.
Quoted 6 lines
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?
Sorry, I actually changed this to struct_size_t(,,1), but forgot to add it to the commit - will submit a v2 shortly.
Thanks,
Thorsten