> @@ -3450,7 +3450,9 @@ static void ath12k_recalculate_mgmt_rate(struct ath12k *ar, > } > > sband = hw->wiphy->bands[def->chan->band]; > - basic_rate_idx = ffs(bss_conf->basic_rates) - 1; > + basic_rate_idx = ffs(bss_conf->basic_rates); > + if (basic_rate_idx) > + basic_rate_idx -= 1; Using __ffs() might be more readable, like u8 basic_rate_idx = 0; ... if (bss_conf->basic_rates) basic_rate_idx = __ffs(bss_conf->basic_rates);