diff options
author | Guo Zhengkui <guozhengkui@vivo.com> | 2022-05-17 05:39:23 +0300 |
---|---|---|
committer | Kalle Valo <quic_kvalo@quicinc.com> | 2022-05-22 15:29:42 +0300 |
commit | b380d2056ebb7f5af1195ad07a6ce96022d4c552 (patch) | |
tree | 95810f97f457f8877ada91e0a627c439088bd7f7 | |
parent | 77bbbd5e0ed3b5998a353b0948584faa4f565f0e (diff) | |
download | linux-b380d2056ebb7f5af1195ad07a6ce96022d4c552.tar.xz |
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: Guo Zhengkui <guozhengkui@vivo.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220517023923.76989-1-guozhengkui@vivo.com
-rw-r--r-- | drivers/net/wireless/ath/ath5k/phy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c index 00f9e347d414..5797ef9c73d7 100644 --- a/drivers/net/wireless/ath/ath5k/phy.c +++ b/drivers/net/wireless/ath/ath5k/phy.c @@ -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) |