linux/drivers/i2c/muxes
Gustavo A. R. Silva 90af27317b i2c: mux: pinctrl: use flexible-array member and struct_size() helper
Update the code to use a flexible array member instead of a pointer in
structure i2c_mux_pinctrl and use the struct_size() helper.

Also, 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 the following form:

sizeof(*mux) + num_names * sizeof(*mux->states)

with:

struct_size(mux, states, num_names)

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Peter Rosin <peda@axentia.se>
2019-06-10 09:28:56 +02:00
..
i2c-arb-gpio-challenge.c i2c: mux: arb-gpio: Rewrite to use GPIO descriptors 2019-06-10 09:28:50 +02:00
i2c-demux-pinctrl.c Merge branch 'i2c-mux/for-next' of https://github.com/peda-r/i2c-mux into i2c/for-5.2 2019-05-03 15:20:58 +02:00
i2c-mux-gpio.c gpiolib: Pass array info to get/set array functions 2018-09-13 11:16:54 +02:00
i2c-mux-gpmux.c i2c: Convert to using %pOFn instead of device_node.name 2018-10-05 14:10:40 +02:00
i2c-mux-ltc4306.c i2c: mux: ltc4306: simplify code to reach the adapter 2018-10-08 23:44:27 +02:00
i2c-mux-mlxcpld.c i2c: mux: mlxcpld: simplify code to reach the adapter 2018-10-08 23:44:28 +02:00
i2c-mux-pca954x.c i2c: mux: pca954x: allow management of device idle state via sysfs 2019-04-21 23:44:37 +02:00
i2c-mux-pca9541.c i2c: mux: pca9541: remove support for unused platform data 2019-04-21 23:44:37 +02:00
i2c-mux-pinctrl.c i2c: mux: pinctrl: use flexible-array member and struct_size() helper 2019-06-10 09:28:56 +02:00
i2c-mux-reg.c Merge branch 'i2c/for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2018-06-14 16:21:46 +09:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00