Commit b380d205 authored by Guo Zhengkui's avatar Guo Zhengkui Committed by Kalle Valo
Browse files

ath5k: replace ternary operator with min()



Fix the following coccicheck warning:

drivers/net/wireless/ath/ath5k/phy.c:3139:62-63: WARNING
opportunity for min()

Signed-off-by: default avatarGuo Zhengkui <guozhengkui@vivo.com>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220517023923.76989-1-guozhengkui@vivo.com
parent 77bbbd5e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3136,7 +3136,7 @@ ath5k_combine_pwr_to_pdadc_curves(struct ath5k_hw *ah,
		pdadc_n = gain_boundaries[pdg] + pd_gain_overlap - pwr_min[pdg];
		/* Limit it to be inside pwr range */
		table_size = pwr_max[pdg] - pwr_min[pdg];
		max_idx = (pdadc_n < table_size) ? pdadc_n : table_size;
		max_idx = min(pdadc_n, table_size);

		/* Fill pdadc_out table */
		while (pdadc_0 < max_idx && pdadc_i < 128)