linux_dsm_epyc7002/drivers/net/ethernet
Gustavo A. R. Silva 2285ec872d mlxsw: spectrum_acl_bloom_filter: use struct_size() in kzalloc()
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;
    void *entry[];
};

instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL);

Instead of leaving these open-coded and prone to type mistakes, we can
now use the new struct_size() helper:

instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL);

This issue was detected with the help of Coccinelle.

Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-16 09:12:23 -08:00
..
3com net: documentation: build a directory structure for drivers 2018-12-05 11:30:06 -08:00
8390
adaptec
aeroflex cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
agere
alacritech cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
allwinner
alteon
altera
amazon cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
amd net: ethernet: don't set phylib state CHANGELINK in drivers 2018-12-18 22:07:20 -08:00
apm cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
apple
aquantia Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-12-09 21:43:31 -08:00
arc net: ethernet: Convert phydev advertize and supported from u32 to link mode 2018-11-11 10:10:01 -08:00
atheros cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
aurora
broadcom Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-01-16 05:13:36 +12:00
brocade
cadence net: macb: remove unnecessary code 2019-01-04 12:59:09 -08:00
calxeda
cavium cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
chelsio Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-01-16 05:13:36 +12:00
cirrus net: documentation: build a directory structure for drivers 2018-12-05 11:30:06 -08:00
cisco net: core: dev: Add extack argument to dev_open() 2018-12-06 13:26:06 -08:00
cortina net: gemini: Fix copy/paste error 2018-11-23 22:35:38 -08:00
davicom
dec net: documentation: build a directory structure for drivers 2018-12-05 11:30:06 -08:00
dlink net: documentation: build a directory structure for drivers 2018-12-05 11:30:06 -08:00
emulex cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
ezchip
faraday cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
freescale fsl/fman: Use GFP_ATOMIC in {memac,tgec}_add_hash_mac_address() 2018-12-28 21:54:12 -08:00
fujitsu
hisilicon Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-01-16 05:13:36 +12:00
hp
huawei cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
i825xx
ibm cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
intel Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue 2019-01-15 15:48:00 -08:00
marvell Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-01-16 05:13:36 +12:00
mediatek Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-01-16 05:13:36 +12:00
mellanox mlxsw: spectrum_acl_bloom_filter: use struct_size() in kzalloc() 2019-01-16 09:12:23 -08:00
micrel
microchip lan743x: Remove phy_read from link status change function 2019-01-08 16:26:12 -05:00
moxa
mscc USB/PHY patches for 4.21-rc1 2018-12-28 20:30:00 -08:00
myricom cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
natsemi
neterion Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-12-20 11:53:36 -08:00
netronome cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
ni cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
nuvoton w90p910_ether: remove incorrect __init annotation 2018-12-14 14:42:51 -08:00
nvidia
nxp net: lpc_eth: fix trivial comment typo 2018-11-21 16:17:32 -08:00
oki-semi cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
packetengines
pasemi cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
qlogic Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-01-16 05:13:36 +12:00
qualcomm cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
rdc
realtek r8169: load Realtek PHY driver module before r8169 2019-01-08 16:40:00 -05:00
renesas ravb: Clean up duplex handling 2018-11-23 11:14:47 -08:00
rocker rocker, dsa, ethsw: Don't filter VLAN events on bridge itself 2018-11-23 18:02:24 -08:00
samsung cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
seeq
sfc cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
sgi cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
silan
sis ethernet/sis: Replace synchronize_sched() with synchronize_rcu() 2018-11-27 09:21:36 -08:00
smsc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-12-27 13:04:52 -08:00
socionext cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
stmicro Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-01-16 05:13:36 +12:00
sun niu: fix missing checks of niu_pci_eeprom_read 2018-12-27 16:19:27 -08:00
synopsys
tehuti
ti Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-01-03 12:53:47 -08:00
toshiba net: ethernet: Convert phydev advertize and supported from u32 to link mode 2018-11-11 10:10:01 -08:00
tundra cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
via net: via: via-velocity: fix spelling mistake "alignement" -> "alignment" 2018-11-27 16:22:23 -08:00
wiznet
xilinx cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
xircom
xscale
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c
jme.h
Kconfig
korina.c
lantiq_etop.c
lantiq_xrx200.c net: lantiq: Fix returned value in case of error in 'xrx200_probe()' 2018-11-16 19:46:49 -08:00
Makefile
netx-eth.c