Skip to contentSkip to conversation

Staging: wilc1000: wilc_wfi_cfgoperations: Remove unused code

PATCH In review Shivani Bhardwaj 2 participants 2 messages Oct 13, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: wilc1000: wilc_wfi_cfgoperations: Remove unused code

Remove the declaration, initialization and statement having a variable that is not used anywhere in the code. Semantic patch used:

@@
type T;
identifier i;
constant C;
position p != e.p;
@@

- T i@p;
<+... when != i
- i = C;
...+>

---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +0 -2
index 6472777..d2e6f55 100644
@@ -1764,7 +1764,6 @@ static int del_pmksa(struct wiphy *wiphy, struct net_device *netdev,
 {
 
 	u32 i;
-	u8 flag = 0;
 	s32 s32Error = 0;
 
 	struct wilc_priv *priv = wiphy_priv(wiphy);
@@ -1777,7 +1776,6 @@ static int del_pmksa(struct wiphy *wiphy, struct net_device *netdev,
 			/*If bssid is found, reset the values*/
 			PRINT_D(CFG80211_DBG, "Reseting PMKID values\n");
 			memset(&priv->pmkid_list.pmkidlist[i], 0, sizeof(struct host_if_pmkid));
-			flag = PMKID_FOUND;
 			break;
 		}
 	}
Signature · 1 line
2.1.0
#1 lore raw
Quoted 34 lines · Shivani Bhardwaj

Remove the declaration, initialization and statement having a variable that is not used anywhere in the code. Semantic patch used:

@@
type T;
identifier i;
constant C;
position p != e.p;
@@

- T i@p;
<+... when != i
- i = C;
...+>

---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +0 -1
index 6472777..d2e6f55 100644
@@ -1764,7 +1764,6 @@ static int del_pmksa(struct wiphy *wiphy, struct net_device *netdev,
 {
 
 	u32 i;
-	u8 flag = 0;
 	s32 s32Error = 0;
 
 	struct wilc_priv *priv = wiphy_priv(wiphy);

drivers/staging/wilc1000/wilc_wfi_cfgoperations.c static int del_pmksa(struct wiphy *wiphy, struct net_device *netdev, · line 1780

Quoted 4 lines
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +0 -1
@@ -1777,7 +1776,6 @@ static int del_pmksa(struct wiphy *wiphy, struct net_device *netdev,
 			/*If bssid is found, reset the values*/
 			PRINT_D(CFG80211_DBG, "Reseting PMKID values\n");
 			memset(&priv->pmkid_list.pmkidlist[i], 0, sizeof(struct host_if_pmkid));
-			flag = PMKID_FOUND;

This constant is used at only one other place. Maybe there you could change the flag variable to pmkid_found, of type bool, and get rid of the constant completely.

julia

Quoted 13 lines
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +0 -1
 			break;
 		}
 	}
--

2.1.0

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151013094837.GA4291%40ubuntu.
For more options, visit https://groups.google.com/d/optout.