aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/net
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavoars@kernel.org>2021-05-25 18:00:38 -0500
committerTony Nguyen <anthony.l.nguyen@intel.com>2021-05-26 16:16:17 -0700
commit125217e0967fc905be35a3b2c9ba4db9a8616b92 (patch)
tree87b52e4b4dc330e01723b76fb5d2f8fa7c7116b6 /include/linux/net
parentLinux 5.13-rc1 (diff)
downloadwireguard-linux-125217e0967fc905be35a3b2c9ba4db9a8616b92.tar.xz
wireguard-linux-125217e0967fc905be35a3b2c9ba4db9a8616b92.zip
i40e: Replace one-element array with flexible-array member
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Refactor the code according to the use of a flexible-array member in struct i40e_qvlist_info instead of one-element array, and use the struct_size() helper. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/79 Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Acked-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'include/linux/net')
-rw-r--r--include/linux/net/intel/i40e_client.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/net/intel/i40e_client.h b/include/linux/net/intel/i40e_client.h
index f41387a8969f..fd7bc860a241 100644
--- a/include/linux/net/intel/i40e_client.h
+++ b/include/linux/net/intel/i40e_client.h
@@ -48,7 +48,7 @@ struct i40e_qv_info {
struct i40e_qvlist_info {
u32 num_vectors;
- struct i40e_qv_info qv_info[1];
+ struct i40e_qv_info qv_info[];
};