linux_dsm_epyc7002/drivers/media/usb
Gustavo A. R. Silva 7cd08d6eed media: usb: pwc: pwc.h: 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>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-07-04 11:55:52 +02:00
..
airspy media: media/usb: don't set description in ENUM_FMT 2019-07-22 14:01:05 -04:00
as102 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 118 2019-05-24 17:39:02 +02:00
au0828 Revert "media: Kconfig: better support hybrid TV devices" 2020-04-14 11:00:30 +02:00
b2c2 media: flexcop-usb: fix endpoint sanity check 2020-02-24 16:23:28 +01:00
cpia2 media: media/usb: rename VFL_TYPE_GRABBER to _VIDEO 2020-02-24 16:53:16 +01:00
cx231xx media: cx231xx: Remove unneeded semicolon 2020-05-05 17:09:04 +02:00
dvb-usb media: cxusb-analog: fix V4L2 dependency 2020-06-23 15:08:58 +02:00
dvb-usb-v2 media: dvbsky: MyGica T230* receivers also do DVB-C and DVB-T 2020-06-23 15:09:26 +02:00
em28xx media: em28xx: Enable Hauppauge 461e rev2 2020-03-12 09:26:18 +01:00
go7007 media: go7007: Fix URB type for interrupt handling 2020-03-02 15:21:00 +01:00
gspca media: gspca: remove redundant assignment to variable retval 2020-06-23 13:21:19 +02:00
hackrf Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
hdpvr media: usb: hdpvr: convert to use i2c_new_client_device() 2020-04-14 11:31:48 +02:00
msi2500 media: media/usb: don't set description in ENUM_FMT 2019-07-22 14:01:05 -04:00
pvrusb2 media: usb: pvrusb2: convert to use i2c_new_client_device() 2020-04-14 11:32:04 +02:00
pwc media: usb: pwc: pwc.h: Replace zero-length array with flexible-array member 2020-07-04 11:55:52 +02:00
s2255 media: media/usb: rename VFL_TYPE_GRABBER to _VIDEO 2020-02-24 16:53:16 +01:00
siano USB fixes for 5.2-rc3 2019-05-31 08:16:31 -07:00
stk1160 media: media/usb: rename VFL_TYPE_GRABBER to _VIDEO 2020-02-24 16:53:16 +01:00
stkwebcam media: media/usb: rename VFL_TYPE_GRABBER to _VIDEO 2020-02-24 16:53:16 +01:00
tm6000 Revert "media: Kconfig: better support hybrid TV devices" 2020-04-14 11:00:30 +02:00
ttusb-budget treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ttusb-dec media: usb: ttusb-dec: reduce the number of memory reads in ttusb_dec_handle_irq() 2020-05-12 17:32:35 +02:00
usbtv media: media/usb: rename VFL_TYPE_GRABBER to _VIDEO 2020-02-24 16:53:16 +01:00
uvc media: media/usb: rename VFL_TYPE_GRABBER to _VIDEO 2020-02-24 16:53:16 +01:00
zr364xx media: docs: move user-facing docs to the admin guide 2020-04-14 10:34:58 +02:00
Kconfig media: move CEC USB drivers to a separate directory 2020-04-15 12:06:40 +02:00
Makefile media: move CEC USB drivers to a separate directory 2020-04-15 12:06:40 +02:00