Skip to contentSkip to conversation

ath9k: remove setting of 'is_ext' parameter

PATCH In review Tom Rix 2 participants 2 messages May 21, 2022 – May 23, 2022

Subsystems (3)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 ath9k: remove setting of 'is_ext' parameter

cppcheck reports
[drivers/net/wireless/ath/ath9k/dfs.c:93]: (style) Assignment of function parameter has no effect outside the function.

Both the is_ctl and the is_ext parameters are set in the if-else statement. But only is_ctl is used later, so setting is_ext is not needed and can be removed.

---
 drivers/net/wireless/ath/ath9k/dfs.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/wireless/ath/ath9k/dfs.c +0 -2
index acb9602aa464..47cdfb584eb0 100644
@@ -89,8 +89,6 @@ static int ath9k_get_max_index_ht40(struct ath9k_dfs_fft_40 *fft,
 			int mag_upper = fft_max_magnitude(fft->upper_bins);
 			if (mag_upper > mag_lower)
 				is_ctl = false;
-			else
-				is_ext = false;
 		}
 	}
 	if (is_ctl)
Signature · 1 line
2.27.0
#1 lore raw
Quoted 16 lines · Tom Rix

cppcheck reports
[drivers/net/wireless/ath/ath9k/dfs.c:93]: (style) Assignment of function parameter has no effect outside the function.

Both the is_ctl and the is_ext parameters are set in the if-else statement. But only is_ctl is used later, so setting is_ext is not needed and can be removed.

---
 drivers/net/wireless/ath/ath9k/dfs.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/wireless/ath/ath9k/dfs.c +0 -0
index acb9602aa464..47cdfb584eb0 100644

drivers/net/wireless/ath/ath9k/dfs.c static int ath9k_get_max_index_ht40(struct ath9k_dfs_fft_40 *fft, · line 93

Quoted 5 lines
drivers/net/wireless/ath/ath9k/dfs.c +0 -2
@@ -89,8 +89,6 @@ static int ath9k_get_max_index_ht40(struct ath9k_dfs_fft_40 *fft,
 			int mag_upper = fft_max_magnitude(fft->upper_bins);
 			if (mag_upper > mag_lower)
 				is_ctl = false;
-			else
-				is_ext = false;

Hmm, not so sure about this; while the assignment is technically useless, I think it makes the intent of the code clearer (i.e., disambiguating between is_ctl or is_ext; upon exiting that block is_ctl or is_ext will always be false(...

-Toke