linux_dsm_epyc7002/drivers/net/ethernet/intel/iavf
Gustavo A. R. Silva 53462f0f47 iavf: iavf_client: use struct_size() helper
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>
2019-05-31 00:14:11 -07:00
..
i40e_adminq_cmd.h i40e: Changed maximum supported FW API version to 1.8 2019-04-16 15:10:54 -07:00
i40e_adminq.c
i40e_adminq.h
iavf_alloc.h
iavf_client.c iavf: iavf_client: use struct_size() helper 2019-05-31 00:14:11 -07:00
iavf_client.h
iavf_common.c
iavf_devids.h
iavf_ethtool.c
iavf_main.c iavf: use struct_size() in kzalloc() 2019-05-31 00:11:47 -07:00
iavf_osdep.h iavf: Use printf instead of gnu_printf for iavf_debug_d 2019-05-30 23:15:54 -07:00
iavf_prototype.h
iavf_register.h
iavf_status.h
iavf_trace.h
iavf_txrx.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
iavf_txrx.h
iavf_type.h
iavf_virtchnl.c iavf: Limiting RSS queues to CPUs 2019-05-31 00:09:11 -07:00
iavf.h
Makefile