mirror-linux/drivers/net/wireless
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
..
admtek
ath gcc-15: add '__nonstring' markers to byte arrays 2025-04-20 11:57:54 -07:00
atmel Just a handful of fixes, notably 2025-04-11 16:38:04 -07:00
broadcom Just a handful of fixes, notably 2025-04-11 16:38:04 -07:00
intel gcc-15: work around sequence-point warning 2025-04-20 11:57:54 -07:00
intersil
marvell treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
mediatek treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
microchip treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
purelifi treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
quantenna First 6.15 material: 2025-03-04 08:50:42 -08:00
ralink wifi: rt2x00: Switch to use hrtimer_update_function() 2025-02-18 17:41:35 +01:00
realtek treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
rsi treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
silabs wifi: wfx: allow to enable WoWLAN using NL80211 2025-03-07 09:24:22 +01:00
st treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
ti Just a handful of fixes, notably 2025-04-11 16:38:04 -07:00
virtual Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
zydas wifi: zd1211rw: Add __nonstring annotations for unterminated strings 2025-03-12 09:48:22 +01:00
Kconfig
Makefile