Skip to contentSkip to conversation

Staging: vt6655: Remove unused function vnt_key_init_table

PATCH In review Bhumika Goyal 2 participants 5 messages Sep 12, 2016 – Sep 13, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: vt6655: Remove unused function vnt_key_init_table

The function vnt_key_init_table is not used anywhere in the kernel. Therefore, remove the function definition and prototype. Grepped to find occurences.

---
 drivers/staging/vt6655/key.c | 10 ----------
 drivers/staging/vt6655/key.h |  2 --
 2 files changed, 12 deletions(-)
drivers/staging/vt6655/key.c +0 -10
index ffcaf25..e161d5d 100644
@@ -31,16 +31,6 @@
 #include "key.h"
 #include "mac.h"
 
-int vnt_key_init_table(struct vnt_private *priv)
-{
-	u32 i;
-
-	for (i = 0; i < MAX_KEY_TABLE; i++)
-		MACvDisableKeyEntry(priv, i);
-
-	return 0;
-}
-
 static int vnt_set_keymode(struct ieee80211_hw *hw, u8 *mac_addr,
 	struct ieee80211_key_conf *key, u32 key_type, u32 mode,
 	bool onfly_latch)
drivers/staging/vt6655/key.h +0 -2
index 261f818..d7271974 100644
@@ -61,8 +61,6 @@
 
 struct vnt_private;
 
-int vnt_key_init_table(struct vnt_private *);
-
 int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
 		 struct ieee80211_vif *vif, struct ieee80211_key_conf *key);
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 15 lines · Bhumika Goyal

The function vnt_key_init_table is not used anywhere in the kernel. Therefore, remove the function definition and prototype. Grepped to find occurences.

---
 drivers/staging/vt6655/key.c | 10 ----------
 drivers/staging/vt6655/key.h |  2 --
 2 files changed, 12 deletions(-)
drivers/staging/vt6655/key.c +0 -0
index ffcaf25..e161d5d 100644

drivers/staging/vt6655/key.c line 39

Quoted 9 lines
drivers/staging/vt6655/key.c +0 -6
@@ -31,16 +31,6 @@
 #include "key.h"
 #include "mac.h"
 
-int vnt_key_init_table(struct vnt_private *priv)
-{
-	u32 i;
-
-	for (i = 0; i < MAX_KEY_TABLE; i++)
-		MACvDisableKeyEntry(priv, i);

Nice to see things go. Did you check whether there are other uses of MAX_KEY_TABLE and MACvDisableKeyEntry?

julia

Quoted 30 lines
drivers/staging/vt6655/key.c +0 -4
-
-	return 0;
-}
-
 static int vnt_set_keymode(struct ieee80211_hw *hw, u8 *mac_addr,
 	struct ieee80211_key_conf *key, u32 key_type, u32 mode,
 	bool onfly_latch)
drivers/staging/vt6655/key.h +0 -3
index 261f818..d7271974 100644
@@ -61,8 +61,6 @@
 
 struct vnt_private;
 
-int vnt_key_init_table(struct vnt_private *);
-
 int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
 		 struct ieee80211_vif *vif, struct ieee80211_key_conf *key);
 
--

1.9.1

--
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/1473707299-29700-1-git-send-email-bhumirks%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
Quoted 22 lines · Julia Lawall
Quoted 18 lines · Bhumika Goyal

The function vnt_key_init_table is not used anywhere in the kernel. Therefore, remove the function definition and prototype. Grepped to find occurences.

---
 drivers/staging/vt6655/key.c | 10 ----------
 drivers/staging/vt6655/key.h |  2 --
 2 files changed, 12 deletions(-)
drivers/staging/vt6655/key.c +0 -0
index ffcaf25..e161d5d 100644
@@ -31,16 +31,6 @@
 #include "key.h"
 #include "mac.h"
 
Quoted 10 lines

drivers/staging/vt6655/key.c line 39

Quoted 6 lines
drivers/staging/vt6655/key.c +0 -6
-int vnt_key_init_table(struct vnt_private *priv)
-{
-     u32 i;
-
-     for (i = 0; i < MAX_KEY_TABLE; i++)
-             MACvDisableKeyEntry(priv, i);

Nice to see things go. Did you check whether there are other uses of MAX_KEY_TABLE and MACvDisableKeyEntry?

Yes, both are getting used a couple of times. I will look for other unused ones.

Thanks,
Bhumika

Quoted 32 lines

julia

Quoted 30 lines
drivers/staging/vt6655/key.c +0 -4
-
-     return 0;
-}
-
 static int vnt_set_keymode(struct ieee80211_hw *hw, u8 *mac_addr,
      struct ieee80211_key_conf *key, u32 key_type, u32 mode,
      bool onfly_latch)
drivers/staging/vt6655/key.h +0 -3
index 261f818..d7271974 100644
@@ -61,8 +61,6 @@
 
 struct vnt_private;
 
-int vnt_key_init_table(struct vnt_private *);
-
 int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
               struct ieee80211_vif *vif, struct ieee80211_key_conf *key);
 
--

1.9.1

--
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/1473707299-29700-1-git-send-email-bhumirks%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#3 lore raw
Quoted 34 lines · Bhumika Goyal
Quoted 22 lines · Julia Lawall
Quoted 18 lines · Bhumika Goyal

The function vnt_key_init_table is not used anywhere in the kernel. Therefore, remove the function definition and prototype. Grepped to find occurences.

---
 drivers/staging/vt6655/key.c | 10 ----------
 drivers/staging/vt6655/key.h |  2 --
 2 files changed, 12 deletions(-)
drivers/staging/vt6655/key.c +0 -0
index ffcaf25..e161d5d 100644
@@ -31,16 +31,6 @@
 #include "key.h"
 #include "mac.h"
 
Quoted 10 lines

drivers/staging/vt6655/key.c line 39

Quoted 6 lines
drivers/staging/vt6655/key.c +0 -6
-int vnt_key_init_table(struct vnt_private *priv)
-{
-     u32 i;
-
-     for (i = 0; i < MAX_KEY_TABLE; i++)
-             MACvDisableKeyEntry(priv, i);

Nice to see things go. Did you check whether there are other uses of MAX_KEY_TABLE and MACvDisableKeyEntry?

Quoted 1 line

Yes, both are getting used a couple of times. I will look for other unused ones.

OK. The case of static functions can be done easily with Coccinelle, because Coccinelle works on one file at a time, and static functions can only be used in the same file. You should still check with grep, and then with a kernel compile, because sometimes static fuctions can be used in unexpected ways, due to strange #includes or macro calls.

julia

#4 lore raw
Quoted 38 lines · Julia Lawall
Quoted 34 lines · Bhumika Goyal
Quoted 32 lines · Julia Lawall
Quoted 15 lines · Bhumika Goyal

The function vnt_key_init_table is not used anywhere in the kernel. Therefore, remove the function definition and prototype. Grepped to find occurences.

---
 drivers/staging/vt6655/key.c | 10 ----------
 drivers/staging/vt6655/key.h |  2 --
 2 files changed, 12 deletions(-)
drivers/staging/vt6655/key.c +0 -0
index ffcaf25..e161d5d 100644

drivers/staging/vt6655/key.c line 39

Quoted 9 lines
drivers/staging/vt6655/key.c +0 -6
@@ -31,16 +31,6 @@
 #include "key.h"
 #include "mac.h"
 
-int vnt_key_init_table(struct vnt_private *priv)
-{
-     u32 i;
-
-     for (i = 0; i < MAX_KEY_TABLE; i++)
-             MACvDisableKeyEntry(priv, i);

Nice to see things go. Did you check whether there are other uses of MAX_KEY_TABLE and MACvDisableKeyEntry?

Quoted 8 lines
Quoted 1 line

Yes, both are getting used a couple of times. I will look for other unused ones.

OK. The case of static functions can be done easily with Coccinelle, because Coccinelle works on one file at a time, and static functions can only be used in the same file. You should still check with grep, and then with a kernel compile, because sometimes static fuctions can be used in unexpected ways, due to strange #includes or macro calls.

Ok, I will work on the static ones first keeping in mind your points. Thanks for the input.

Thanks,
Bhumika

Quoted 1 line

julia