linux/drivers/net/ethernet/intel
Gustavo A. R. Silva 89f6a3051e ice: 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);
instance = alloc(size, GFP_KERNEL);

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-06-28 14:54:11 -07:00
..
e1000 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
e1000e e1000e: start network tx queue only when link is up 2019-05-28 16:08:43 -07:00
fm10k Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
i40e i40e/i40e_virtchnl_pf: Use struct_size() in kzalloc() 2019-06-26 09:18:54 -07:00
iavf iavf: allow null RX descriptors 2019-06-17 15:39:26 -07:00
ice ice: Use struct_size() helper 2019-06-28 14:54:11 -07:00
igb igb: mark expected switch fall-through 2019-05-28 15:52:37 -07:00
igbvf drivers: Remove explicit invocations of mmiowb() 2019-04-08 12:01:02 +01:00
igc igc: Cleanup the redundant code 2019-05-28 16:15:55 -07:00
ixgb cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
ixgbe ixgbe: Check DDM existence in transceiver before access 2019-06-26 09:18:54 -07:00
ixgbevf ixgbevf: fix possible divide by zero in ixgbevf_update_itr 2019-06-26 09:18:54 -07:00
e100.c intel: correct return from set features callback 2019-03-19 14:18:49 -07:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile igc: Add skeletal frame for Intel(R) 2.5G Ethernet Controller support 2018-10-17 12:14:54 -07:00