linux_dsm_epyc7002/drivers/net/ethernet
Gustavo A. R. Silva af6f12f22b nfp: flower: cmsg: 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;
    void *entry[];
};

size = sizeof(struct foo) + count * sizeof(void *);
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:

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

Notice that, in this case, variable size is not necessary, hence
it is removed.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-02-08 22:57:28 -08:00
..
3com net: 3c509: mark expected switch fall-throughs 2019-01-23 09:06:36 -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 net: alteon: replace dev_kfree_skb_irq by dev_consume_skb_irq 2019-01-28 23:09:19 -08:00
altera net: altera_tse: fix msgdma_tx_completion on non-zero fill_level case 2019-01-27 10:39:07 -08:00
amazon cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
amd Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-01-29 21:18:54 -08:00
apm cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
apple net: apple: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles 2019-01-28 23:09:19 -08:00
aquantia
arc
atheros atheros: atl2: fix an indentaion issue on a return statement 2019-02-02 20:14:39 -08:00
aurora
broadcom bnx2x: Use struct_size() in kzalloc() 2019-02-08 22:57:28 -08:00
brocade bna: fix indentation issue on call to bfa_ioc_pf_failed 2019-02-02 20:14:38 -08:00
cadence net: macb: add sam9x60-macb compatibility string 2019-02-08 15:19:50 -08:00
calxeda
cavium Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-02-08 15:00:17 -08:00
chelsio cxgb4: Update 1.22.9.0 as the latest firmware supported. 2019-02-06 13:42:09 -08:00
cirrus
cisco enic: fix checksum validation for IPv6 2019-02-01 14:41:42 -08:00
cortina
davicom davicom: Annotate implicit fall through in dm9000_set_io 2019-01-17 15:08:17 -08:00
dec Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-02-08 15:00:17 -08:00
dlink
emulex benet: remove broken and unused macro 2019-01-28 10:56:01 -08:00
ezchip
faraday cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
freescale Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-02-08 15:00:17 -08:00
fujitsu
hisilicon net: hns3: MAC table entry count function increases operation 0 value protection measures 2019-02-02 08:24:09 -08:00
hp
huawei hinic: Add pci device ids 2019-01-22 14:54:08 -08:00
i825xx net: i825xx: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles 2019-01-28 10:53:28 -08:00
ibm net: emac: remove IBM_EMAC_RX_SKB_HEADROOM 2019-02-06 19:50:41 -08:00
intel flow_offload: add flow_rule and flow_match structures and use them 2019-02-06 10:38:25 -08:00
marvell Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-02-08 15:00:17 -08:00
mediatek net: ethernet: mediatek: support MT7621 SoC ethernet hardware 2019-01-30 14:26:07 -08:00
mellanox mlxsw: spectrum_router: Use struct_size() in kzalloc() 2019-02-08 22:57:28 -08:00
micrel
microchip lan743x: Provide Read/Write Access to on chip OTP 2019-01-26 09:35:21 -08:00
moxa
mscc mscc: ocelot: Implement ndo_get_port_parent_id() 2019-02-06 14:16:12 -08:00
myricom cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
natsemi
neterion net: vxge: fix indentation issue 2019-01-18 14:02:32 -08:00
netronome nfp: flower: cmsg: use struct_size() helper 2019-02-08 22:57:28 -08:00
ni net: nixge: Add support for fixed-link configurations 2019-02-05 10:34:34 -08:00
nuvoton
nvidia
nxp
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 qede: Add ethtool interface for SmartAN query. 2019-02-08 22:39:01 -08:00
qualcomm cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
rdc
realtek r8169: Avoid pointer aliasing 2019-02-06 13:40:08 -08:00
renesas sh_eth: offload RX checksum on SH7763 2019-02-04 13:31:00 -08:00
rocker rocker: Implement ndo_get_port_parent_id() 2019-02-06 14:16:50 -08:00
samsung cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
seeq
sfc sfc: add bundle partition definitions to mtd 2019-02-08 11:41:21 -08:00
sgi cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
silan
sis
smsc net: smsc: epic100: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles 2019-02-06 17:38:15 -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-02-08 15:00:17 -08:00
sun Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-02-08 15:00:17 -08:00
synopsys
tehuti net: tehuti: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles 2019-02-06 17:38:15 -08:00
ti Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-01-29 21:18:54 -08:00
toshiba
tundra cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
via net: via-velocity: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles 2019-02-06 17:38:15 -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 net: jme: fix indentation issues 2019-01-18 14:02:55 -08:00
jme.h
Kconfig
korina.c
lantiq_etop.c
lantiq_xrx200.c
Makefile
netx-eth.c