mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-25 04:19:41 +07:00
53462f0f47
One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct foo { int stuff; struct boo entry[]; }; size = sizeof(struct foo) + count * sizeof(struct boo); Instead of leaving these open-coded and prone to type mistakes, we can now use the new struct_size() helper: size = struct_size(instance, entry, count); This code was detected with the help of Coccinelle. Signed-off-by: "Gustavo A. R. Silva" <gustavo@embeddedor.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> |
||
---|---|---|
.. | ||
i40e_adminq_cmd.h | ||
i40e_adminq.c | ||
i40e_adminq.h | ||
iavf_alloc.h | ||
iavf_client.c | ||
iavf_client.h | ||
iavf_common.c | ||
iavf_devids.h | ||
iavf_ethtool.c | ||
iavf_main.c | ||
iavf_osdep.h | ||
iavf_prototype.h | ||
iavf_register.h | ||
iavf_status.h | ||
iavf_trace.h | ||
iavf_txrx.c | ||
iavf_txrx.h | ||
iavf_type.h | ||
iavf_virtchnl.c | ||
iavf.h | ||
Makefile |