linux_dsm_epyc7002/drivers/net/ethernet
Gustavo A. R. Silva 30a87f150b net: mlxfw: 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>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-03-03 17:39:19 -08:00
..
3com net/3com: Delete driver and module versions from 3com drivers 2020-02-24 11:23:36 -08:00
8390
adaptec net/adaptec: Clean driver versions 2020-02-24 11:23:36 -08:00
aeroflex net/aeroflex: Don't assign FW if it is not available 2020-02-24 11:23:37 -08:00
agere net/agere: Delete unneeded driver version 2020-02-24 11:23:37 -08:00
alacritech net/alacritech: Delete driver version 2020-02-24 11:23:37 -08:00
allwinner net/allwinner: Remove driver version 2020-02-24 11:23:37 -08:00
alteon net/alteon: Properly report FW version 2020-02-24 11:23:37 -08:00
altera net/althera: Delete hardcoded driver version 2020-02-24 11:23:37 -08:00
amazon net: ena: fix broken interface between ENA driver and FW 2020-02-26 20:47:58 -08:00
amd net/amd: Remove useless driver version 2020-02-24 11:24:47 -08:00
apm net/apm: Properly mark absence of FW 2020-02-24 11:24:47 -08:00
apple
aquantia net: atlantic: Replace zero-length array with flexible-array member 2020-03-02 11:16:28 -08:00
arc net/arc: Delete driver version 2020-02-24 11:24:47 -08:00
atheros net: ag71xx: port to phylink 2020-02-29 21:34:20 -08:00
aurora net: convert additional drivers to use phy_do_ioctl 2020-01-22 21:16:32 +01:00
broadcom Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-02-27 18:31:39 -08:00
brocade bna: bnad: Replace zero-length array with flexible-array member 2020-03-02 11:16:28 -08:00
cadence net: macb: use resolved link config in mac_link_up() 2020-02-27 12:02:14 -08:00
calxeda
cavium liquidio: Replace zero-length array with flexible-array member 2020-03-03 17:38:56 -08:00
chelsio chelsio: Replace zero-length array with flexible-array member 2020-02-24 15:26:17 -08:00
cirrus
cisco net: cisco: Replace zero-length array with flexible-array member 2020-02-26 16:43:09 -08:00
cortina
davicom net: ethernet: dm9000: Handle -EPROBE_DEFER in dm9000_parse_dt() 2020-02-16 20:01:43 -08:00
dec net: ethernet: dec: tulip: Fix length mask in receive length calculation 2020-02-05 14:21:31 +01:00
dlink
emulex
ezchip
faraday
freescale net: dpaa2-mac: use resolved link config in mac_link_up() 2020-02-27 12:02:14 -08:00
fujitsu
google
hisilicon net: hns: Replace zero-length array with flexible-array member 2020-02-26 16:43:09 -08:00
huawei hinic: fix a bug of rss configuration 2020-02-27 11:08:01 -08:00
i825xx Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-01-28 16:02:33 -08:00
ibm net/ethtool: Introduce link_ksettings API for virtual network devices 2020-02-29 21:48:55 -08:00
intel iavf: use tc_cls_can_offload_and_chain0() instead of chain check 2020-02-26 09:01:19 -08:00
marvell octeontx2-af: fix spelling mistake "backpessure" -> "backpressure" 2020-03-03 14:55:10 -08:00
mediatek net: phylink: propagate resolved link config via mac_link_up() 2020-02-27 12:02:14 -08:00
mellanox net: mlxfw: Replace zero-length array with flexible-array member 2020-03-03 17:39:19 -08:00
micrel Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-02-27 18:31:39 -08:00
microchip
moxa
mscc net: mscc: fix in frame extraction 2020-02-17 14:02:29 -08:00
myricom
natsemi net/macsonic: Remove interrupt handler wrapper 2020-02-16 19:48:22 -08:00
neterion
netronome netronome: Replace zero-length array with flexible-array member 2020-02-24 15:26:17 -08:00
ni
nvidia
nxp net: convert suitable drivers to use phy_do_ioctl_running 2020-01-23 10:49:30 +01:00
oki-semi
packetengines
pasemi
pensando Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-02-21 13:39:34 -08:00
qlogic qlogic: Replace zero-length array with flexible-array member 2020-02-26 16:43:09 -08:00
qualcomm Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-02-27 18:31:39 -08:00
rdc
realtek r8169: improve rtl8169_start_xmit 2020-02-23 17:17:57 -08:00
renesas sh_eth: use Gigabit register map for R7S72100 2020-02-16 19:44:41 -08:00
rocker
samsung net: convert additional drivers to use phy_do_ioctl 2020-01-22 21:16:32 +01:00
seeq
sfc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-02-27 18:31:39 -08:00
sgi net: sgi: ioc3-eth: Remove leftover free_irq() 2020-02-05 13:53:54 +01:00
silan
sis
smsc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-01-28 16:02:33 -08:00
socionext net: page_pool: API cleanup and comments 2020-02-20 10:09:25 -08:00
stmicro Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-02-27 18:31:39 -08:00
sun sunvnet: use icmp_ndo_send helper 2020-02-13 14:19:00 -08:00
synopsys
tehuti tehuti: Replace zero-length array with flexible-array member 2020-03-02 11:16:28 -08:00
ti Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-01-28 16:02:33 -08:00
toshiba toshiba: Replace zero-length array with flexible-array member 2020-02-24 15:26:17 -08:00
tundra
via
wiznet
xilinx net: ll_temac: Add ethtool support for coalesce parameters 2020-02-29 21:30:43 -08:00
xircom
xscale
dnet.c net: convert suitable drivers to use phy_do_ioctl_running 2020-01-23 10:49:30 +01:00
dnet.h
ec_bhf.c
ethoc.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-01-28 16:02:33 -08:00
fealnx.c
jme.c jme: use new helper tcp_v6_gso_csum_prep 2020-02-19 11:20:59 -08:00
jme.h
Kconfig
korina.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-01-28 16:02:33 -08:00
lantiq_etop.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-01-28 16:02:33 -08:00
lantiq_xrx200.c
Makefile