linux_dsm_epyc7002/drivers/net/ethernet/chelsio/cxgb4
Gustavo A. R. Silva c49f0ce0b6 cxgb4: smt: use struct_size() in kvzalloc()
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[];
};

instance = kvzalloc(sizeof(struct foo) + count * sizeof(struct boo), GFP_KERNEL);

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

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

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-02-01 15:12:29 -08:00
..
clip_tbl.c cxgb4: clip_tbl: Use struct_size() in kvzalloc() 2019-01-29 10:55:02 -08:00
clip_tbl.h
cudbg_common.c
cudbg_entity.h cxgb4: collect hardware queue descriptors 2018-09-03 22:10:37 -07:00
cudbg_if.h cxgb4: collect hardware queue descriptors 2018-09-03 22:10:37 -07:00
cudbg_lib_common.h
cudbg_lib.c net: chelsio: Add a missing check on cudg_get_buffer 2018-12-27 16:18:41 -08:00
cudbg_lib.h cxgb4: collect hardware queue descriptors 2018-09-03 22:10:37 -07:00
cudbg_zlib.c
cudbg_zlib.h
cxgb4_cudbg.c cxgb4: collect hardware queue descriptors 2018-09-03 22:10:37 -07:00
cxgb4_cudbg.h cxgb4: collect hardware dump in second kernel 2018-05-14 13:46:05 -04:00
cxgb4_dcb.c cxgb4: Use proper enum in cxgb4_dcb_handle_fw_update 2018-10-02 22:30:26 -07:00
cxgb4_dcb.h cxgb4: Use proper enum in IEEE_FAUX_SYNC 2018-10-02 22:30:52 -07:00
cxgb4_debugfs.c cxgb4: remove DEFINE_SIMPLE_DEBUGFS_FILE() 2018-12-15 11:21:22 -08:00
cxgb4_debugfs.h cxgb4: remove DEFINE_SIMPLE_DEBUGFS_FILE() 2018-12-15 11:21:22 -08:00
cxgb4_ethtool.c cxgb4/cxgb4vf: Link management changes 2019-01-22 20:41:48 -08:00
cxgb4_fcoe.c
cxgb4_fcoe.h
cxgb4_filter.c cxgb4: mk_act_open_req() buggers ->{local, peer}_ip on big-endian hosts 2018-08-07 12:33:58 -07:00
cxgb4_filter.h
cxgb4_main.c cxgb4: TLS record offload enable 2019-01-22 11:30:54 -08:00
cxgb4_ptp.c net: cxgb4: fix various indentation issues 2019-01-10 09:30:49 -05:00
cxgb4_ptp.h
cxgb4_tc_flower.c net_sched: remove list_head from tc_action 2018-08-21 12:45:44 -07:00
cxgb4_tc_flower.h
cxgb4_tc_u32_parse.h
cxgb4_tc_u32.c cxgb4: cxgb4_tc_u32: use struct_size() in kvzalloc() 2019-01-29 10:55:25 -08:00
cxgb4_tc_u32.h
cxgb4_thermal.c cxgb4: Add thermal zone support 2018-10-09 11:16:28 -07:00
cxgb4_uld.c net: cxgb4: fix various indentation issues 2019-01-10 09:30:49 -05:00
cxgb4_uld.h cxgb4: fix the error path of cxgb4_uld_register() 2018-10-18 16:26:36 -07:00
cxgb4.h cxgb4: use new fw interface to get the VIN and smt index 2018-11-23 11:11:15 -08:00
l2t.c cxgb4/l2t: Use struct_size() in kvzalloc() 2019-01-16 21:11:09 -08:00
l2t.h
Makefile cxgb4: fix thermal zone build error 2018-11-15 09:49:07 -08:00
sched.c cxgb4: sched: use struct_size() in kvzalloc() 2019-02-01 15:12:29 -08:00
sched.h cxgb4: remove the unneeded locks 2018-10-03 09:34:52 -07:00
sge.c cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
smt.c cxgb4: smt: use struct_size() in kvzalloc() 2019-02-01 15:12:29 -08:00
smt.h
srq.c libcxgb,cxgb4: use __skb_put_zero to simplfy code 2018-04-30 11:53:48 -04:00
srq.h cxgb4: Add support to initialise/read SRQ entries 2018-03-22 11:59:11 -04:00
t4_chip_type.h cxgb4: clean up init_one 2018-05-25 14:59:38 -04:00
t4_hw.c cxgb4/cxgb4vf: Link management changes 2019-01-22 20:41:48 -08:00
t4_hw.h
t4_msg.h crypto/chelsio/chtls: macro correction in tx path 2018-12-14 13:39:39 -08:00
t4_pci_id_tbl.h cxgb4: Add new T6 PCI device ids 0x608a 2018-11-08 17:05:20 -08:00
t4_regs.h cxgb4: collect number of free PSTRUCT page pointers 2018-07-24 10:12:21 -07:00
t4_tcb.h
t4_values.h
t4fw_api.h cxgb4: use new fw interface to get the VIN and smt index 2018-11-23 11:11:15 -08:00
t4fw_version.h cxgb4: update 1.20.8.0 as the latest firmware supported 2018-08-09 14:35:42 -07:00