mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] wifi: rtw89: 8852bt: Simplify unnecessary if-else conditions
@ 2025-08-18  6:42 Liao Yuanhong
  2025-08-19  1:30 ` Ping-Ke Shih
  2025-08-24  0:39 ` Julian Calaby
  0 siblings, 2 replies; 3+ messages in thread
From: Liao Yuanhong @ 2025-08-18  6:42 UTC (permalink / raw)
  To: Ping-Ke Shih, open list:REALTEK WIRELESS DRIVER (rtw89), open list
  Cc: Liao Yuanhong

Some simple if-else logic can be simplified using the ! operator to improve
code readability.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
---
 drivers/net/wireless/realtek/rtw89/rtw8852bt_rfk.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852bt_rfk.c b/drivers/net/wireless/realtek/rtw89/rtw8852bt_rfk.c
index d0e299803225..164ee0fde03b 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852bt_rfk.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852bt_rfk.c
@@ -1803,10 +1803,7 @@ static void _dpk_onoff(struct rtw89_dev *rtwdev, enum rtw89_rf_path path, bool o
 
 	val = dpk->is_dpk_enable && !off && dpk->bp[path][kidx].path_ok;
 
-	if (off)
-		off_reverse = false;
-	else
-		off_reverse = true;
+	off_reverse = !off;
 
 	val = dpk->is_dpk_enable & off_reverse & dpk->bp[path][kidx].path_ok;
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-24  0:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-18  6:42 [PATCH] wifi: rtw89: 8852bt: Simplify unnecessary if-else conditions Liao Yuanhong
2025-08-19  1:30 ` Ping-Ke Shih
2025-08-24  0:39 ` Julian Calaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®