band: Silence warning

width must be initialized since it depends on best not being NULL.  If
best passes the non-NULL check above, then width must be initialized
since both width and best are set at the same time.
This commit is contained in:
Denis Kenzior 2023-10-06 23:21:48 -05:00
parent 0cb3e4af30
commit 073292315f
1 changed files with 3 additions and 0 deletions

View File

@ -1260,7 +1260,10 @@ int band_freq_to_ht_chandef(uint32_t freq, const struct band_freq_attrs *attr,
* - 40mhz we can base the selection off the channel flags, either
* higher or lower.
*/
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
switch (width) {
_Pragma("GCC diagnostic pop")
case BAND_CHANDEF_WIDTH_20:
return 0;
case BAND_CHANDEF_WIDTH_40: