linux/drivers/input/mouse
Gustavo A. R. Silva 3dbae15538 Input: cyapa - replace zero-length array with flexible-array member
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 7649773293 ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Link: https://lore.kernel.org/r/20200214172132.GA28389@embeddedor
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-02-14 17:19:22 -08:00
..
alps.c Input: alps - fix a mismatch between a condition check and its comment 2019-07-19 12:40:35 +03:00
alps.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
amimouse.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
appletouch.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
atarimouse.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
bcm5974.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
byd.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
byd.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
cyapa_gen3.c Input: cyapa - mark expected switch fall-throughs 2018-10-15 11:24:10 -07:00
cyapa_gen5.c Input: cyapa - replace zero-length array with flexible-array member 2020-02-14 17:19:22 -08:00
cyapa_gen6.c Input: mark expected switch fall-throughs 2018-08-08 11:23:27 -07:00
cyapa.c Input: cyapa - switch to using devm_device_add_group() 2019-07-24 12:59:01 +03:00
cyapa.h Input: cyapa - fix for losing events during device power transitions 2016-03-04 11:32:13 -08:00
cypress_ps2.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
cypress_ps2.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
elan_i2c_core.c Input: elan_i2c - switch to using devm_add_action_or_reset() 2019-07-24 12:58:52 +03:00
elan_i2c_i2c.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
elan_i2c_smbus.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
elan_i2c.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
elantech.c Revert "Input: elantech - enable SMBus on new (2018+) systems" 2019-10-15 17:42:47 -07:00
elantech.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
focaltech.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
focaltech.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
gpio_mouse.c Input: gpio_mouse - switch to using input device polling mode 2019-10-04 12:31:46 -07:00
hgpk.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
hgpk.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
inport.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
Kconfig Input: fix Kconfig indentation 2019-11-22 15:19:19 -08:00
lifebook.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
lifebook.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
logibm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
logips2pp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
logips2pp.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -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
maplemouse.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
navpoint.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pc110pad.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
psmouse-base.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
psmouse-smbus.c Input: psmouse - switch to using i2c_new_scanned_device() 2020-02-10 10:00:23 -08:00
psmouse.h Input: psmouse-smbus - allow to control psmouse_deactivate 2018-05-23 16:49:22 -07:00
pxa930_trkball.c Input: remove dev_err() usage after platform_get_irq() 2019-08-14 10:49:01 -07:00
rpcmouse.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sentelic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
sentelic.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
sermouse.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
synaptics_i2c.c Input: synaptics_i2c - remove redundant spinlock 2019-02-16 22:57:31 -08:00
synaptics_usb.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
synaptics.c Input: synaptics - remove the LEN0049 dmi id from topbuttonpad list 2020-02-13 17:09:49 -08:00
synaptics.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
touchkit_ps2.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
touchkit_ps2.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
trackpoint.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
trackpoint.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
vmmouse.c input/vmmouse: Update the backdoor call with support for new instructions 2019-08-28 13:43:01 +02:00
vmmouse.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
vsxxxaa.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00