Commit 3e6860ec authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue

Tony Nguyen says:

====================
i40e: Replace one-element arrays with flexible-array members

Replace one-element arrays with flexible-array members in multiple
structures.

This results in no differences in binary output.

* '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue:
  i40e: Replace one-element array with flex-array member in struct i40e_profile_aq_section
  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_segment
  i40e: Replace one-element array with flex-array member in struct i40e_package_header
====================

Link: https://lore.kernel.org/r/20230810175302.1964182-1-anthony.l.nguyen@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 7191c140 4bb28b27
......@@ -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;
......
......@@ -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 */
......@@ -1486,12 +1486,12 @@ 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 {
u32 section_count;
u32 section_offset[1];
u32 section_offset[];
};
struct i40e_profile_section_header {
......@@ -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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment