2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-26 06:04:14 +08:00
linux-next/drivers/staging/greybus
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
..
Documentation staging: greybus: add SPDX identifiers to all greybus driver files 2017-11-11 14:46:20 +01:00
tools staging: greybus: fix spelling mistake "entires" -> "entries" 2018-09-18 13:29:11 +02:00
arche_platform.h staging: greybus: correct SPDX License Identifier 2018-11-09 09:49:02 -08:00
arche-apb-ctrl.c staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor interface 2019-01-15 16:18:14 +01:00
arche-platform.c staging: greybus: arche-platform: Switch to the gpio descriptor interface 2019-01-15 16:18:14 +01:00
arpc.h staging: greybus: correct SPDX License Identifier 2018-11-09 09:49:02 -08:00
audio_apbridgea.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
audio_apbridgea.h staging: greybus: correct SPDX License Identifier 2018-11-09 09:49:02 -08:00
audio_codec.c staging: remove unneeded static set .owner field in platform_driver 2018-09-14 10:45:51 +02:00
audio_codec.h staging: greybus: remove extern prototypes 2019-03-18 07:49:45 +01:00
audio_gb.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
audio_manager_module.c staging: greybus: Parenthesis alignment 2018-11-26 20:59:05 +01:00
audio_manager_private.h staging: greybus: correct SPDX License Identifier 2018-11-09 09:49:02 -08:00
audio_manager_sysfs.c staging: greybus: Parenthesis alignment 2018-11-26 20:59:05 +01:00
audio_manager.c staging: greybus: audio_manager: fix a missing check of ida_simple_get 2019-03-29 17:28:48 +01:00
audio_manager.h staging: greybus: correct SPDX License Identifier 2018-11-09 09:49:02 -08:00
audio_module.c staging: greybus: Parenthesis alignment 2018-11-26 20:59:05 +01:00
audio_topology.c Staging: greybus: Blank lines not required before '}' 2019-02-26 11:46:51 +01:00
authentication.c staging: greybus: authentication.c: Fix alignment should match open parenthesis 2018-01-22 11:48:06 +01:00
bootrom.c staging: greybus: Parenthesis alignment 2018-11-26 20:59:05 +01:00
bundle.c staging: greybus: Remove parentheses around variable 2019-03-20 07:50:34 +01:00
bundle.h staging: greybus: correct SPDX License Identifier 2018-11-09 09:49:02 -08:00
camera.c staging: greybus: Parenthesis alignment 2018-11-26 20:59:05 +01:00
connection.c staging: greybus: Parenthesis alignment 2018-11-26 20:59:05 +01:00
connection.h Staging: greybus: Alignment should match open parenthesis 2019-02-26 11:46:51 +01:00
control.c Staging: greybus: Do not use multiple blank lines 2019-02-26 11:46:51 +01:00
control.h staging: greybus: align arguments with parentheses 2018-11-09 09:49:02 -08:00
core.c Staging: greybus: Alignment should match open parenthesis 2019-02-26 11:46:51 +01:00
debugfs.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
es2.c staging: greybus: Parenthesis alignment 2018-11-26 20:59:05 +01:00
firmware.h staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
fw-core.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
fw-download.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
fw-management.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
gb-camera.h staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
gbphy.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
gbphy.h staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
gpio.c staging: greybus: gpio: switch GPIO portions to use GPIOLIB_IRQCHIP 2019-01-15 16:18:14 +01:00
greybus_authentication.h staging: greybus: add SPDX identifiers to all greybus driver files 2017-11-11 14:46:20 +01:00
greybus_firmware.h staging: greybus: add SPDX identifiers to all greybus driver files 2017-11-11 14:46:20 +01:00
greybus_id.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
greybus_manifest.h staging: greybus: add SPDX identifiers to all greybus driver files 2017-11-11 14:46:20 +01:00
greybus_protocols.h Revert "staging: greybus: remove extra space before tab" 2018-11-20 10:37:04 +01:00
greybus_trace.h staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
greybus.h staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
hd.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
hd.h staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
hid.c staging: greybus: hid: Remove print following unsuccessful kmalloc 2019-04-01 19:19:48 +02:00
i2c.c staging: greybus: Parenthesis alignment 2018-11-26 20:59:05 +01:00
interface.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
interface.h staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
Kconfig staging: add missing SPDX lines to Kconfig files 2019-04-03 11:10:15 +02:00
light.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
log.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
loopback.c staging: greybus: convert to DEFINE_SHOW_ATTRIBUTE 2018-12-17 14:24:42 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
manifest.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
manifest.h staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
module.c staging: greybus: Parenthesis alignment 2018-11-26 20:59:05 +01:00
module.h staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
operation.c staging: greybus: Parenthesis alignment 2018-11-26 20:59:05 +01:00
operation.h staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
power_supply.c staging: greybus: power_supply: use struct_size() helper 2019-04-19 15:03:07 +02:00
pwm.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
raw.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
sdio.c staging: greybus: sdio.c: Remove unncessary paranthesis. 2019-03-21 19:57:26 +01:00
spi.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
spilib.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
spilib.h staging: greybus: add SPDX identifiers to all greybus driver files 2017-11-11 14:46:20 +01:00
svc_watchdog.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
svc.c staging: greybus: Parenthesis alignment 2018-11-26 20:59:05 +01:00
svc.h staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
TODO staging: greybus: gpio: switch GPIO portions to use GPIOLIB_IRQCHIP 2019-01-15 16:18:14 +01:00
uart.c staging: greybus: remove space before tab 2018-11-09 09:49:03 -08:00
usb.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00
vibrator.c staging: greybus: Remove redundant license text 2017-11-11 14:46:21 +01:00