Skip to content

Commit

Permalink
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/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.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Aug 12, 2023
2 parents 7191c14 + 4bb28b2 commit 3e6860e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/intel/i40e/i40e_ddp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/ethernet/intel/i40e/i40e_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 3e6860e

Please sign in to comment.