linux_dsm_epyc7002/drivers/net
Gustavo A. R. Silva 0562ebcf05 ray_cs: 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/20200319230525.GA14835@embeddedor.com
2020-03-23 19:18:27 +02:00
..
appletalk
arcnet
bonding net/bond: Delete driver and module versions 2020-02-24 11:23:36 -08:00
caif
can net: slcan, slip -- no need for goto when if () will do 2020-03-11 23:15:26 -07:00
dsa net: dsa: mt7530: fix macro MIRROR_PORT 2020-03-10 16:12:54 -07:00
ethernet net: ibm: remove set but not used variables 'err' 2020-03-11 23:32:55 -07:00
fddi net: skfp: use new constant PCI_STATUS_ERROR_BITS 2020-03-04 14:21:00 -08:00
fjes
hamradio
hippi
hyperv net/ethtool: Introduce link_ksettings API for virtual network devices 2020-02-29 21:48:55 -08:00
ieee802154
ipa soc: qcom: ipa: fix spelling mistake "cahces" -> "caches" 2020-03-11 23:34:32 -07:00
ipvlan
netdevsim netdevsim: add ACL trap reporting cookie as a metadata 2020-02-25 11:05:55 -08:00
phy net: phy: Add Synopsys DesignWare XPCS MDIO module 2020-03-09 20:13:16 -07:00
plip
ppp
slip net: slcan, slip -- no need for goto when if () will do 2020-03-11 23:15:26 -07:00
team
usb cdc_ncm: Implement the 32-bit version of NCM Transfer Block 2020-03-11 22:59:31 -07:00
vmxnet3 vmxnet3: let core reject the unsupported coalescing parameters 2020-03-06 22:45:55 -08:00
wan WAN: Replace zero-length array with flexible-array member 2020-02-27 12:06:55 -08:00
wimax
wireguard wireguard: socket: remove extra call to synchronize_net 2020-02-16 19:21:56 -08:00
wireless ray_cs: Replace zero-length array with flexible-array member 2020-03-23 19:18:27 +02:00
xen-netback
bareudp.c bareudp: Fixed bareudp receive handling 2020-03-11 22:54:27 -07:00
dummy.c net/dummy: Ditch driver and module versions 2020-02-24 11:23:36 -08:00
eql.c
geneve.c
gtp.c gtp: use icmp_ndo_send helper 2020-02-13 14:19:00 -08:00
ifb.c
Kconfig soc: qcom: ipa: support build of IPA code 2020-03-08 22:07:10 -07:00
LICENSE.SRC
loopback.c
macsec.c
macvlan.c
macvtap.c
Makefile soc: qcom: ipa: support build of IPA code 2020-03-08 22:07:10 -07:00
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c tun: reject unsupported coalescing params 2020-03-06 22:45:55 -08:00
veth.c
virtio_net.c virtio_net: reject unsupported coalescing params 2020-03-05 12:12:35 -08:00
vrf.c
vsockmon.c
vxlan.c
xen-netfront.c