linux_dsm_epyc7002/drivers
Gustavo A. R. Silva b0c4058816 atmel: at76c50x: 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: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200319225133.GA29672@embeddedor.com
2020-03-23 19:17:11 +02:00
..
accessibility
acpi ACPI: PM: s2idle: Check fixed wakeup events in acpi_s2idle_wake() 2020-02-21 10:01:25 -08:00
amba
android
ata
atm
auxdisplay
base drivers/base/power: add dpm_sysfs_change_owner() 2020-02-26 20:07:25 -08:00
bcma
block floppy: check FDC index for errors before assigning it 2020-02-24 11:25:33 -08:00
bluetooth
bus
cdrom
char
clk
clocksource
connector
counter
cpufreq
cpuidle
crypto cxgb4/chcr: Add ipv6 support and statistics 2020-03-08 21:16:23 -07:00
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware
fpga
fsi
gnss
gpio
gpu Merge tag 'drm-intel-fixes-2020-02-20' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes 2020-02-21 12:46:54 +10:00
greybus
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid 2020-02-27 11:13:27 -08:00
hsi
hv
hwmon hwmon: (w83627ehf) Fix crash seen with W83627DHG-P 2020-02-21 09:16:24 -08:00
hwspinlock
hwtracing
i2c
i3c
ide
idle
iio
infiniband RDMA/ipoib: reject unsupported coalescing params 2020-03-06 22:45:55 -08:00
input
interconnect
iommu
ipack
irqchip
isdn
leds
lightnvm
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc
mmc
mtd
mux
net atmel: at76c50x: Replace zero-length array with flexible-array member 2020-03-23 19:17:11 +02:00
nfc NFC: Replace zero-length array with flexible-array member 2020-02-27 12:06:20 -08:00
ntb
nubus
nvdimm
nvme block-5.6-2020-02-22 2020-02-22 11:09:06 -08:00
nvmem
of
opp
oprofile
parisc
parport
pci PCI: Introduce pci_get_dsn 2020-03-05 17:36:24 -08:00
pcmcia
perf
phy
pinctrl
platform
pnp
power
powercap
pps
ps3
ptp ptp: add VMware virtual PTP clock driver 2020-03-05 17:25:07 -08:00
pwm
rapidio
ras
regulator
remoteproc remoteproc: add IPA notification to q6v5 driver 2020-03-08 22:07:09 -07:00
reset
rpmsg
rtc
s390 s390/qeth: remove VNICC callback parameter struct 2020-03-09 18:16:06 -07:00
sbus
scsi scsi: qedf: Use pci_get_dsn() 2020-03-05 17:36:24 -08:00
sfi
sh
siox
slimbus
soc
soundwire
spi
spmi
ssb ssb: Use scnprintf() for avoiding potential buffer overflow 2020-03-12 15:44:12 +02:00
staging staging: qlge: reject unsupported coalescing params 2020-03-06 22:45:55 -08:00
target
tc
tee Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2020-02-24 11:40:23 -08:00
thermal
thunderbolt
tty
uio
usb
vfio
vhost vhost: Check docket sk_family instead of call getname 2020-02-22 21:41:42 -08:00
video
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen xen: branch for v5.6-rc3 2020-02-21 16:10:10 -08:00
zorro
Kconfig
Makefile