lkml.org 
[lkml]   [2022]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] ath11k: simplify if-if to if-else
Date
Replace `if (!ab->is_reset)` with `else` for simplification
according to the kernel coding style:

"Do not unnecessarily use braces where a single statement will do."

...

"This does not apply if only one branch of a conditional statement is
a single statement; in the latter case use braces in both branches"

Please refer to:
https://www.kernel.org/doc/html/v5.17-rc8/process/coding-style.html

Suggested-by: Benjamin Poirier <benjamin.poirier@gmail.com>
Signed-off-by: Yihao Han <hanyihao@vivo.com>
---
v2:edit commit message
---
drivers/net/wireless/ath/ath11k/core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
index cbac1919867f..80009482165a 100644
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -1532,8 +1532,7 @@ static void ath11k_core_restart(struct work_struct *work)

if (ab->is_reset)
complete_all(&ab->reconfigure_complete);
-
- if (!ab->is_reset)
+ else
ath11k_core_post_reconfigure_recovery(ab);
}

--
2.17.1
\
 
 \ /
  Last update: 2022-04-15 15:00    [W:0.057 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site