2022-05-16 19:43:57

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH linux-next] net: ath: fix minmax.cocci warnings

Guo Zhengkui <[email protected]> writes:

> Fix the following coccicheck warnings:
>
> drivers/net/wireless/ath/ath5k/phy.c:3139:62-63: WARNING
> opportunity for min()
> drivers/net/wireless/ath/ath9k/dfs.c:249:28-30: WARNING
> opportunity for max()
>
> Signed-off-by: Guo Zhengkui <[email protected]>
> ---
> drivers/net/wireless/ath/ath5k/phy.c | 2 +-
> drivers/net/wireless/ath/ath9k/dfs.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)

Please split this into two patches, one for ath5k and one for ath9k.

--
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


2022-05-17 14:02:50

by Guo Zhengkui

[permalink] [raw]
Subject: [PATCH linux-next v2] net: ath9k: replace ternary operator with max()

Fix the following coccicheck warning:

drivers/net/wireless/ath/ath9k/dfs.c:249:28-30: WARNING
opportunity for max()

Signed-off-by: Guo Zhengkui <[email protected]>
---
drivers/net/wireless/ath/ath9k/dfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/dfs.c b/drivers/net/wireless/ath/ath9k/dfs.c
index acb9602aa464..11349218bc21 100644
--- a/drivers/net/wireless/ath/ath9k/dfs.c
+++ b/drivers/net/wireless/ath/ath9k/dfs.c
@@ -246,7 +246,7 @@ ath9k_postprocess_radar_event(struct ath_softc *sc,
DFS_STAT_INC(sc, dc_phy_errors);

/* when both are present use stronger one */
- rssi = (ard->rssi < ard->ext_rssi) ? ard->ext_rssi : ard->rssi;
+ rssi = max(ard->rssi, ard->ext_rssi);
break;
default:
/*
--
2.20.1


2022-05-23 05:43:45

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH linux-next v2] net: ath9k: replace ternary operator with max()

Guo Zhengkui <[email protected]> wrote:

> Fix the following coccicheck warning:
>
> drivers/net/wireless/ath/ath9k/dfs.c:249:28-30: WARNING
> opportunity for max()
>
> Signed-off-by: Guo Zhengkui <[email protected]>
> Acked-by: Toke Høiland-Jørgensen <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

Patch applied to ath-next branch of ath.git, thanks.

2be8afe05833 ath9k: replace ternary operator with max()

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches