linux/drivers/staging
Gustavo A. R. Silva 827c085bae staging: greybus: power_supply: use struct_size() helper
Make use of the struct_size() helper instead of an open-coded version
in order to avoid any potential type mistakes, in particular in the
context in which this code is being used.

So, replace code of the following form:

sizeof(*resp) + props_count * sizeof(struct gb_power_supply_props_desc)

with:

struct_size(resp, props, props_count)

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-19 15:03:07 +02:00
..
android staging: remove redundant 'default n' from Kconfig 2019-04-16 13:39:01 +02:00
axis-fifo staging: remove redundant 'default n' from Kconfig 2019-04-16 13:39:01 +02:00
board staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
clocking-wizard staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
comedi staging: comedi: use help instead of ---help--- in Kconfig 2019-04-19 15:01:50 +02:00
emxx_udc staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
erofs Merge 5.1-rc3 into staging-next 2019-04-01 07:49:24 +02:00
fbtft staging: add missing SPDX lines to Kconfig files 2019-04-03 11:10:15 +02:00
fieldbus staging: fieldbus: add TODO 2019-04-17 12:07:31 +02:00
fsl-dpaa2 staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
fwserial staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
gasket Staging: gasket: Use DIV_ROUND_UP 2019-04-16 13:22:50 +02:00
gdm724x staging: add missing SPDX lines to Kconfig files 2019-04-03 11:10:15 +02:00
goldfish staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
greybus staging: greybus: power_supply: use struct_size() helper 2019-04-19 15:03:07 +02:00
gs_fpgaboot staging: remove redundant 'default n' from Kconfig 2019-04-16 13:39:01 +02:00
iio First set of new device support, features and fixes for IIO in the 5.2 cycle 2019-04-04 22:25:29 +02:00
ks7010 staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
media staging: remove redundant 'default n' from Kconfig 2019-04-16 13:39:01 +02:00
most staging: most: configfs: Make mdev_link_list static 2019-04-19 14:59:36 +02:00
mt7621-dma staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
mt7621-dts staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
mt7621-pci staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
mt7621-pci-phy staging: mt7621-pci-phy: convert driver to use kernel regmap API's 2019-04-19 15:01:34 +02:00
mt7621-pinctrl staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
mt7621-spi staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
netlogic staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
nvec staging: add missing SPDX lines to Kconfig files 2019-04-03 11:10:15 +02:00
octeon staging: add missing SPDX lines to Kconfig files 2019-04-03 11:10:15 +02:00
octeon-usb staging: add missing SPDX lines to Kconfig files 2019-04-03 11:10:15 +02:00
olpc_dcon staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
pi433 staging: pi433: add dependency to PA0, 1, 2 setting for output power level 2019-04-16 13:44:30 +02:00
ralink-gdma staging: ralink-gdma: Use struct_size() in kzalloc() 2019-04-16 13:44:30 +02:00
rtl8188eu staging: rtl8188eu: make sta2sta_data_frame() static 2019-04-16 13:31:58 +02:00
rtl8192e staging: remove redundant 'default n' from Kconfig 2019-04-16 13:39:01 +02:00
rtl8192u staging: rtl8192u: ieee80211: add space around '==' and before '(' 2019-04-16 13:31:58 +02:00
rtl8712 staging: rtl8712: remove unnecessary NULL check 2019-04-16 13:31:58 +02:00
rtl8723bs Staging: rtl8723bs: Avoid typedefs for structure 2019-04-19 15:01:34 +02:00
rtlwifi staging: rtlwifi: fix spelling mistake "notity" -> "notify" 2019-04-19 14:59:37 +02:00
rts5208 staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
sm750fb staging: sm750fb: add proper SPDX identifier to driver 2019-04-03 11:10:16 +02:00
speakup staging: add missing SPDX lines to Kconfig files 2019-04-03 11:10:15 +02:00
unisys staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
vboxvideo staging: add missing SPDX lines to Kconfig files 2019-04-03 11:10:15 +02:00
vc04_services staging: vc04_services: handle kzalloc failure 2019-04-19 14:59:36 +02:00
vme staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
vt6655 staging: vt6655: upc: remove double blank lines 2019-04-16 13:44:30 +02:00
vt6656 staging: add missing SPDX lines to Kconfig files 2019-04-03 11:10:15 +02:00
wilc1000 staging: wilc1000: Avoid GFP_KERNEL allocation from atomic context 2019-04-17 12:40:51 +02:00
wlan-ng staging: remove redundant 'default n' from Kconfig 2019-04-16 13:39:01 +02:00
Kconfig staging: add Fieldbus Device subsystem. 2019-04-17 12:07:31 +02:00
Makefile staging: add Fieldbus Device subsystem. 2019-04-17 12:07:31 +02:00