i40e: Replace one-element arrays with flexible-array members
Subsystems (3)
Tony Nguyen
maintainerGustavo A. R. Silva says:
Replace one-element arrays with flexible-array members in multiple structures.
This results in no differences in binary output.
The following are changes since commit 29afcd69672a4e3d8604d17206d42004540d6d5c:
Merge branch 'improve-the-taprio-qdisc-s-relationship-with-its-children'
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 40GbE
Gustavo A. R. Silva (4):
i40e: Replace one-element array with flex-array member in struct
i40e_package_header
i40e: Replace one-element array with flex-array member in struct
i40e_profile_segment
i40e: Replace one-element array with flex-array member in struct
i40e_section_table
i40e: Replace one-element array with flex-array member in struct
i40e_profile_aq_section
drivers/net/ethernet/intel/i40e/i40e_ddp.c | 4 ++-- drivers/net/ethernet/intel/i40e/i40e_type.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
2.38.1
Tony Nguyen
maintainerPATCH 1/4 i40e: Replace one-element array with flex-array member in struct i40e_package_header
From: "Gustavo A. R. Silva" <[email protected]>
One-element and zero-length arrays are deprecated. So, replace one-element array in struct i40e_package_header with flexible-array member.
The + sizeof(u32) adjustments ensure that there are no differences in binary output.
--- drivers/net/ethernet/intel/i40e/i40e_ddp.c | 4 ++-- drivers/net/ethernet/intel/i40e/i40e_type.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ddp.c +2 -2
@@ -220,7 +220,7 @@ static bool i40e_ddp_is_pkg_hdr_valid(struct net_device *netdev,netdev_err (netdev,"Invalid DDP profile - size is bigger than 4G" );return false; } -if (size < (sizeof (struct i40e_package_header ) + +if (size < (sizeof (struct i40e_package_header ) +sizeof (u32) +sizeof (struct i40e_metadata_segment ) +sizeof (u32) *2 )) {netdev_err (netdev,"Invalid DDP profile - size is too small." );return false;
@@ -281,7 +281,7 @@ int i40e_ddp_load(struct net_device *netdev, const u8 *data, size_t size,if (!i40e_ddp_is_pkg_hdr_valid (netdev, pkg_hdr, size))return -EINVAL ; -if (size < (sizeof (struct i40e_package_header ) + +if (size < (sizeof (struct i40e_package_header ) +sizeof (u32) +sizeof (struct i40e_metadata_segment ) +sizeof (u32) *2 )) {netdev_err (netdev,"Invalid DDP recipe size." );return -EINVAL ;
drivers/net/ethernet/intel/i40e/i40e_type.h +1 -1
@@ -1455,7 +1455,7 @@ struct i40e_ddp_version {struct i40e_package_header {struct i40e_ddp_version version;u32 segment_count; -u32 segment_offset[1 ]; +u32 segment_offset[]; };/* Generic segment header */
Signature · 1 line
2.38.1
Tony Nguyen
maintainerPATCH 2/4 i40e: Replace one-element array with flex-array member in struct i40e_profile_segment
In reply to Tony NguyenFrom: "Gustavo A. R. Silva" <[email protected]>
One-element and zero-length arrays are deprecated. So, replace one-element array in struct i40e_profile_segment with flexible-array member.
This results in no differences in binary output.
--- drivers/net/ethernet/intel/i40e/i40e_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_type.h +1 -1
@@ -1486,7 +1486,7 @@ struct i40e_profile_segment {struct i40e_ddp_version version;char name[I40E_DDP_NAME_SIZE ];u32 device_table_count; -struct i40e_device_id_entry device_table[1 ]; +struct i40e_device_id_entry device_table[]; };struct i40e_section_table {
Signature · 1 line
2.38.1
Tony Nguyen
maintainerPATCH 3/4 i40e: Replace one-element array with flex-array member in struct i40e_section_table
In reply to Tony NguyenFrom: "Gustavo A. R. Silva" <[email protected]>
One-element and zero-length arrays are deprecated. So, replace one-element array in struct i40e_section_table with flexible-array member.
This results in no differences in binary output.
--- drivers/net/ethernet/intel/i40e/i40e_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_type.h +1 -1
@@ -1491,7 +1491,7 @@ struct i40e_profile_segment {struct i40e_section_table {u32 section_count; -u32 section_offset[1 ]; +u32 section_offset[]; };struct i40e_profile_section_header {
Signature · 1 line
2.38.1
Tony Nguyen
maintainerPATCH 4/4 i40e: Replace one-element array with flex-array member in struct i40e_profile_aq_section
In reply to Tony NguyenFrom: "Gustavo A. R. Silva" <[email protected]>
One-element and zero-length arrays are deprecated. So, replace one-element array in struct i40e_profile_aq_section with flexible-array member.
This results in no differences in binary output.
--- drivers/net/ethernet/intel/i40e/i40e_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_type.h +1 -1
@@ -1523,7 +1523,7 @@ struct i40e_profile_aq_section {u16 flags;u8 param[16 ];u16 datalen; -u8 data[1 ]; +u8 data[]; };struct i40e_profile_info {
Signature · 1 line
2.38.1
This series was applied to netdev/net-next.git (main) by Tony Nguyen <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Tony Nguyen <[email protected]>:
Quoted 8 lines · On Thu, 10 Aug 2023 10:52:58 -0700 you wrote:
Gustavo A. R. Silva says:
Replace one-element arrays with flexible-array members in multiple structures.
This results in no differences in binary output.
[...]
Here is the summary with links:
- [net-next,1/4] i40e: Replace one-element array with flex-array member in struct i40e_package_header
https://git.kernel.org/netdev/net-next/c/e55c50eac36a - [net-next,2/4] i40e: Replace one-element array with flex-array member in struct i40e_profile_segment https://git.kernel.org/netdev/net-next/c/fbfa49f92484 - [net-next,3/4] i40e: Replace one-element array with flex-array member in struct i40e_section_table https://git.kernel.org/netdev/net-next/c/ff1a724c4f6a - [net-next,4/4] i40e: Replace one-element array with flex-array member in struct i40e_profile_aq_section https://git.kernel.org/netdev/net-next/c/4bb28b27040b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html