mirror of
https://github.com/opnsense/src.git
synced 2026-02-20 00:11:07 -05:00
This fixes a number of clang 19 warnings:
sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c:709:25: error: comparison of different enumeration types ('HAL_BOOL' and 'HAL_FREQ_BAND') [-Werror,-Wenum-compare]
709 | freq_array[i] = FBIN2FREQ(p_freq_bin[i], is_2ghz);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h:148:11: note: expanded from macro 'FBIN2FREQ'
148 | (((y) == HAL_FREQ_BAND_2GHZ) ? (2300 + x) : (4800 + 5 * x))
| ~~~ ^ ~~~~~~~~~~~~~~~~~~
sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c:745:25: error: comparison of different enumeration types ('HAL_BOOL' and 'HAL_FREQ_BAND') [-Werror,-Wenum-compare]
745 | freq_array[i] = FBIN2FREQ(p_freq_bin[i], is_2ghz);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h:148:11: note: expanded from macro 'FBIN2FREQ'
148 | (((y) == HAL_FREQ_BAND_2GHZ) ? (2300 + x) : (4800 + 5 * x))
| ~~~ ^ ~~~~~~~~~~~~~~~~~~
sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c:781:25: error: comparison of different enumeration types ('HAL_BOOL' and 'HAL_FREQ_BAND') [-Werror,-Wenum-compare]
781 | freq_array[i] = FBIN2FREQ(p_freq_bin[i], is_2ghz);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h:148:11: note: expanded from macro 'FBIN2FREQ'
148 | (((y) == HAL_FREQ_BAND_2GHZ) ? (2300 + x) : (4800 + 5 * x))
| ~~~ ^ ~~~~~~~~~~~~~~~~~~
The `FBIN2FREQ()` and `FREQ2FBIN()` macros in `ar9300eep.h` are invoked
in most places around the `ath_hal` code with a (effectively) boolean
second argument, corresponding to "is this 2GHz?". But in the code that
is warned about, the value `HAL_FREQ_BAND_2GHZ` is of a different
non-boolean type, `HAL_FREQ_BAND`.
Update the `FBIN2FREQ()` and `FREQ2FBIN()` macros to interpret the
second argument as boolean value, and rename the macro parameter names
to better describe their meaning.
Reviewed by: adrian, bz
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D46201
(cherry picked from commit 82246ac5d890e031c9978052e5a431e0960182d5)
|
||
|---|---|---|
| .. | ||
| acpica | ||
| ath/ath_hal/ar9300 | ||
| athk | ||
| ice | ||
| imx | ||
| ipw | ||
| iwi | ||
| iwlwifi | ||
| iwlwififw | ||
| iwm | ||
| iwn | ||
| liquidio | ||
| mediatek/mt76 | ||
| mwl | ||
| nvidia | ||
| otus | ||
| qat | ||
| qat_c2xxx | ||
| ral | ||
| rsu | ||
| rtw88 | ||
| rtw88fw | ||
| rtw89 | ||
| rtw89fw | ||
| rtwn | ||
| run | ||
| uath | ||
| wpi | ||