public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtlwifi: remove redundant assignments to ul_enc_algo
@ 2017-11-08 13:30 Colin King
  2018-01-26 13:52 ` [PATCH] staging: rtlwifi: remove redundant initialization of 'cfg_cmd' Colin King
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2017-11-08 13:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Larry Finger, Ping-Ke Shih, Kalle Valo, devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable ul_enc_algo is being initialized with a value that is never
read, it is being set again in the following switch statements in
all of the case and default paths. Hence the unitialization is
redundant and can be removed.  Cleans up two clang warnings:

Value stored to 'ul_enc_algo' during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/staging/rtlwifi/cam.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtlwifi/cam.c b/drivers/staging/rtlwifi/cam.c
index 9c8c907cb48e..ca1c9e36d976 100644
--- a/drivers/staging/rtlwifi/cam.c
+++ b/drivers/staging/rtlwifi/cam.c
@@ -181,7 +181,7 @@ void rtl_cam_mark_invalid(struct ieee80211_hw *hw, u8 uc_index)
 
 	u32 ul_command;
 	u32 ul_content;
-	u32 ul_enc_algo = rtlpriv->cfg->maps[SEC_CAM_AES];
+	u32 ul_enc_algo;
 
 	switch (rtlpriv->sec.pairwise_enc_algorithm) {
 	case WEP40_ENCRYPTION:
@@ -221,7 +221,7 @@ void rtl_cam_empty_entry(struct ieee80211_hw *hw, u8 uc_index)
 
 	u32 ul_command;
 	u32 ul_content;
-	u32 ul_encalgo = rtlpriv->cfg->maps[SEC_CAM_AES];
+	u32 ul_encalgo;
 	u8 entry_i;
 
 	switch (rtlpriv->sec.pairwise_enc_algorithm) {
-- 
2.14.1


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

end of thread, other threads:[~2018-01-29  4:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-08 13:30 [PATCH] staging: rtlwifi: remove redundant assignments to ul_enc_algo Colin King
2018-01-26 13:52 ` [PATCH] staging: rtlwifi: remove redundant initialization of 'cfg_cmd' Colin King
2018-01-29  4:27   ` Pkshih

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