mirror-linux/drivers/net
Linus Torvalds ac71fabf15 gcc-15: work around sequence-point warning
The C sequence points are complicated things, and gcc-15 has apparently
added a warning for the case where an object is both used and modified
multiple times within the same sequence point.

That's a great warning.

Or rather, it would be a great warning, except gcc-15 seems to not
really be very exact about it, and doesn't notice that the modification
are to two entirely different members of the same object: the array
counter and the array entries.

So that seems kind of silly.

That said, the code that gcc complains about is unnecessarily
complicated, so moving the array counter update into a separate
statement seems like the most straightforward fix for these warnings:

  drivers/net/wireless/intel/iwlwifi/mld/d3.c: In function ‘iwl_mld_set_netdetect_info’:
  drivers/net/wireless/intel/iwlwifi/mld/d3.c:1102:66: error: operation on ‘netdetect_info->n_matches’ may be undefined [-Werror=sequence-point]
   1102 |                 netdetect_info->matches[netdetect_info->n_matches++] = match;
        |                                         ~~~~~~~~~~~~~~~~~~~~~~~~~^~

  drivers/net/wireless/intel/iwlwifi/mld/d3.c:1120:58: error: operation on ‘match->n_channels’ may be undefined [-Werror=sequence-point]
   1120 |                         match->channels[match->n_channels++] =
        |                                         ~~~~~~~~~~~~~~~~~^~

side note: the code at that second warning is actively buggy, and only
works on little-endian machines that don't do strict alignment checks.

The code casts an array of integers into an array of unsigned long in
order to use our bitmap iterators.  That happens to work fine on any
sane architecture, but it's still wrong.

This does *not* fix that more serious problem.  This only splits the two
assignments into two statements and fixes the compiler warning.  I need
to get rid of the new warnings in order to be able to actually do any
build testing.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-04-20 11:57:54 -07:00
..
arcnet treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
bonding bonding: hold ops lock around get_link 2025-04-11 18:53:20 -07:00
caif TTY/Serial driver updates for 6.15-rc1 2025-04-02 18:17:33 -07:00
can can: rockchip_canfd: fix broken quirks checks 2025-04-15 12:23:10 +02:00
dsa net: dsa: mv88e6xxx: fix -ENOENT when deleting VLANs and MST is unsupported 2025-04-16 18:14:43 -07:00
ethernet Miscellaneous fixes: 2025-04-18 13:28:41 -07:00
fddi treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
fjes
hamradio treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
hippi treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
hyperv
ieee802154 Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
ipa
ipvlan
mctp
mdio
netdevsim treewide: Convert new and leftover hrtimer_init() users 2025-04-05 10:30:17 +02:00
pcs
phy Including fixes from netfilter. 2025-04-10 08:52:18 -07:00
plip
ppp net: ppp: Add bound checking for skb data on ppp_sync_txmung 2025-04-10 11:24:17 +02:00
pse-pd
slip treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
team
thunderbolt
usb treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
vmxnet3
vxlan treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
wan treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
wireguard treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
wireless gcc-15: work around sequence-point warning 2025-04-20 11:57:54 -07:00
wwan Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
xen-netback treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
Kconfig
LICENSE.SRC
Makefile
Space.c
amt.c
bareudp.c
dummy.c net: dummy: request ops lock 2025-04-03 15:32:08 -07:00
eql.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
geneve.c
gtp.c
ifb.c
loopback.c
macsec.c
macvlan.c
macvtap.c
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
netkit.c
nlmon.c
ntb_netdev.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
pfcp.c
rionet.c
sungem_phy.c
tap.c
tun.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
tun_vnet.h
veth.c
virtio_net.c Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
vrf.c
vsockmon.c
xen-netfront.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00