Skip to contentSkip to conversation

Staging: rtl8912: Make functions static

PATCH In review Vatika Harlalka 2 participants 4 messages Mar 26, 2015 Staging

lore
Share & tools
lore
#0 lore raw

cover Staging: rtl8912: Make functions static

These patches are to remove extern declarations from .c files and make appropriate functions static.

Vatika Harlalka (2):
Staging: rtl8192u: Remove extern and add static
Staging: rtl8192u: Make function static

 drivers/staging/rtl8192u/r8192U.h      |  1 -
 drivers/staging/rtl8192u/r8192U_core.c | 10 +++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 Staging: rtl8192u: Remove extern and add static

These functions are accessed only in this file and so are declared as static.

---
 drivers/staging/rtl8192u/r8192U_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/r8192U_core.c +3 -3
index f609656..cbcdcf2 100644
@@ -1731,7 +1731,7 @@ static void rtl8192_usb_deleteendpoints(struct net_device *dev)
 	}
 }
 #else
-void rtl8192_usb_deleteendpoints(struct net_device *dev)
+static void rtl8192_usb_deleteendpoints(struct net_device *dev)
 {
 	int i;
 	struct r8192_priv *priv = ieee80211_priv(dev);
@@ -1763,7 +1763,7 @@ void rtl8192_usb_deleteendpoints(struct net_device *dev)
 }
 #endif
 
-extern void rtl8192_update_ratr_table(struct net_device *dev);
+static void rtl8192_update_ratr_table(struct net_device *dev);
 static void rtl8192_link_change(struct net_device *dev)
 {
 	struct r8192_priv *priv = ieee80211_priv(dev);
@@ -1968,7 +1968,7 @@ static int rtl8192_handle_assoc_response(struct net_device *dev,
 }
 
 
-void rtl8192_update_ratr_table(struct net_device *dev)
+static void rtl8192_update_ratr_table(struct net_device *dev)
 {
 	struct r8192_priv *priv = ieee80211_priv(dev);
 	struct ieee80211_device *ieee = priv->ieee80211;
Signature · 1 line
1.9.1
maintainer
#2 lore raw

Re: [Outreachy kernel] [PATCH 1/2] Staging: rtl8192u: Remove extern and add static

Quoted 7 lines · Vatika Harlalka

These functions are accessed only in this file and so are declared as static.

---
 drivers/staging/rtl8192u/r8192U_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

This doesn't apply to my tree at all :(

#3 lore raw

PATCH 2/2 Staging: rtl8192u: Make function static

In reply to Vatika Harlalka

This function is used in only one c file and so
its definition is removed from the header file
and it is declared as static.

---
 drivers/staging/rtl8192u/r8192U.h      | 1 -
 drivers/staging/rtl8192u/r8192U_core.c | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/r8192U.h +0 -1
index 6c2e438..221dbd7 100644
@@ -1153,7 +1153,6 @@ typedef enum {
 
 bool init_firmware(struct net_device *dev);
 short rtl819xU_tx_cmd(struct net_device *dev, struct sk_buff *skb);
-short rtl8192_tx(struct net_device *dev, struct sk_buff *skb);
 
 u32 read_cam(struct net_device *dev, u8 addr);
 void write_cam(struct net_device *dev, u8 addr, u32 data);
drivers/staging/rtl8192u/r8192U_core.c +2 -2
index cbcdcf2..7e3671c 100644
@@ -942,7 +942,7 @@ static void rtl8192_data_hard_resume(struct net_device *dev)
 {
 	// FIXME !!
 }
-
+static short rtl8192_tx(struct net_device *dev, struct sk_buff *skb);
 /* this function TX data frames when the ieee80211 stack requires this.
  * It checks also if we need to stop the ieee tx queue, eventually do it
  */
@@ -1487,7 +1487,7 @@ static void tx_zero_isr(struct urb *tx_urb)
  * skb->cb will contain all the following information,
  * priority, morefrag, rate, &dev.
  * */
-short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
+static short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
 {
 	struct r8192_priv *priv = ieee80211_priv(dev);
 	cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
Signature · 1 line
1.9.1