linux_dsm_epyc7002/drivers/isdn/hardware/mISDN
Gustavo A. R. Silva 8d008e64a2 mISDN: hfcsusb: 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 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-01-11 18:54:21 -08:00
..
avmfritz.c isdn: mark expected switch fall-throughs 2018-07-04 22:17:32 +09:00
hfc_multi_8xx.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hfc_multi.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hfc_pci.h isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
hfcmulti.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
hfcpci.c isdn: mISDN: hfcpci: Replace GFP_ATOMIC with GFP_KERNEL in hfc_probe() 2018-07-26 21:20:52 -07:00
hfcsusb.c mISDN: hfcsusb: Use struct_size() in kzalloc() 2019-01-11 18:54:21 -08:00
hfcsusb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iohelper.h isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
ipac.h mISDN: Support DR6 indication in mISDNipac driver 2016-03-14 15:51:29 -04:00
isar.h isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
Kconfig isdn: hardware: mISDN: Remove reference to CONFIG_8xx 2017-03-16 11:15:14 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mISDNinfineon.c isdn: mark expected switch fall-throughs 2018-07-04 22:17:32 +09:00
mISDNipac.c mISDN: Convert timers to use timer_setup() 2017-10-18 12:39:39 +01:00
mISDNisar.c isdn: mark expected switch fall-throughs 2018-07-04 22:17:32 +09:00
netjet.c isdn: mISDN: netjet: Replace GFP_ATOMIC with GFP_KERNEL in nj_probe() 2018-07-26 21:21:23 -07:00
netjet.h isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
speedfax.c treewide: Fix function prototypes for module_param_call() 2017-10-31 15:30:37 +01:00
w6692.c PCI: add USR vendor id and use it in r8169 and w6692 driver 2018-11-11 14:00:05 -08:00
w6692.h mISDN: Add driver for Winbond cards 2009-07-25 20:21:28 +02:00