linux_dsm_epyc7002/drivers
Gustavo A. R. Silva 9f208eca4f mfd: sm501: Use struct_size() in devm_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;
    struct boo entry[];
};

instance = devm_kzalloc(dev, 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 = devm_kzalloc(dev, 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: Lee Jones <lee.jones@linaro.org>
2019-02-07 10:43:09 +00:00
..
accessibility
acpi libnvdimm v5.0-rc3 2019-01-20 10:24:30 +12:00
amba
android
ata ata: pata_acpi: Make PCI dependency explicit 2019-01-15 23:16:34 +01:00
atm atm: he: fix sign-extension overflow on large shift 2019-01-17 11:27:00 -08:00
auxdisplay
base regmap: Fixes for v5.0 2019-01-19 07:17:19 +12:00
bcma
block for-linus-20190118 2019-01-20 09:12:50 +12:00
bluetooth
bus
cdrom
char
clk
clocksource
connector
cpufreq
cpuidle
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2019-01-19 05:48:43 +12:00
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware
fmc
fpga
fsi
gnss
gpio
gpu ACPI fixes for 5.0-rc3 2019-01-19 05:46:00 +12:00
hid
hsi
hv
hwmon hwmon: (tmp421) Correct the misspelling of the tmp442 compatible attribute in OF device ID table 2019-01-17 12:54:52 -08:00
hwspinlock
hwtracing
i2c
i3c i3c: master: dw-i3c-master: fix i3c_attach/reattach 2019-01-15 11:15:11 +01:00
ide
idle
iio Merge branches 'ib-mfd-iio-input-5.1', 'ib-mfd-input-watchdog-5.1' and 'ib-mfd-platform-5.1' into ibs-for-mfd-merged 2019-02-01 08:20:04 +00:00
infiniband First 5.0 rc pull request 2019-01-18 17:17:20 +12:00
input Merge branches 'ib-mfd-iio-input-5.1', 'ib-mfd-input-watchdog-5.1' and 'ib-mfd-platform-5.1' into ibs-for-mfd-merged 2019-02-01 08:20:04 +00:00
iommu
ipack
irqchip
isdn isdn: avm: Fix string plus integer warning from Clang 2019-01-19 10:01:03 -08:00
leds leds: lp5523: fix a missing check of return value of lp55xx_read 2019-01-17 22:27:39 +01:00
lightnvm
macintosh
mailbox
mcb
md md: Make bio_alloc_mddev use bio_alloc_bioset 2019-01-14 06:31:56 -07:00
media media: vim2m: only cancel work if it is for right context 2019-01-16 11:13:25 -05:00
memory
memstick
message
mfd mfd: sm501: Use struct_size() in devm_kzalloc() 2019-02-07 10:43:09 +00:00
misc virtio: don't allocate vqs when names[i] = NULL 2019-01-14 20:15:19 -05:00
mmc GPIO fixes for the v5.0 series: 2019-01-15 06:26:28 +12:00
mtd mtd: rawnand: denali: get ->setup_data_interface() working again 2019-01-18 10:27:01 +01:00
mux
net virtio_net: bulk free tx skbs 2019-01-19 16:06:52 -08:00
nfc
ntb
nubus
nvdimm libnvdimm/security: Fix nvdimm_security_state() state request selection 2019-01-15 13:54:33 -08:00
nvme for-linus-20190118 2019-01-20 09:12:50 +12:00
nvmem
of OF: properties: add missing of_node_put 2019-01-16 12:49:53 -06:00
opp
oprofile
parisc
parport
pci pci-v5.0-fixes-2 2019-01-19 07:26:16 +12:00
pcmcia
perf
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-01-16 05:13:36 +12:00
pinctrl
platform platform/chrome: cros_ec_lightbar: Instantiate only if the EC has a lightbar 2019-02-01 08:09:27 +00:00
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc virtio: don't allocate vqs when names[i] = NULL 2019-01-14 20:15:19 -05:00
reset
rpmsg
rtc
s390 virtio: don't allocate vqs when names[i] = NULL 2019-01-14 20:15:19 -05:00
sbus
scsi SCSI fixes on 20190118 2019-01-20 09:15:04 +12:00
sfi
sh
siox
slimbus
sn
soc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-01-16 05:13:36 +12:00
soundwire
spi
spmi
ssb
staging Staging driver fixes for 5.0-rc2 2019-01-14 05:49:35 +12:00
target scsi: tcmu: avoid cmd/qfull timers updated whenever a new cmd comes 2019-01-11 20:58:52 -05:00
tc
tee
thermal drivers: thermal: int340x_thermal: Make PCI dependency explicit 2019-01-15 23:17:40 +01:00
thunderbolt
tty tty/serial fixes for 5.0-rc2 2019-01-14 05:47:48 +12:00
uio
usb USB fixes for 5.0-rc2 2019-01-14 05:45:28 +12:00
uwb
vfio
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-01-21 12:52:31 +13:00
video fbdev fixes for v5.0-rc3: 2019-01-19 05:43:05 +12:00
virt
virtio virtio-balloon: tweak config_changed implementation 2019-01-14 20:15:20 -05:00
visorbus
vlynq
vme
w1
watchdog Merge branches 'ib-mfd-iio-input-5.1', 'ib-mfd-input-watchdog-5.1' and 'ib-mfd-platform-5.1' into ibs-for-mfd-merged 2019-02-01 08:20:04 +00:00
xen xen: fixes for 5.0-rc3 2019-01-19 05:53:41 +12:00
zorro
Kconfig
Makefile