Skip to contentSkip to conversation

Add static qualifier to local functions

PATCH New Cristina Opriceana 1 participant 3 messages Mar 22, 2015 Staging

lore
Share & tools
lore
#0 lore raw

cover Add static qualifier to local functions

This patchset makes some functions static as they are not needed externally.

Cristina Opriceana (2):
Staging: rtl8192u: Make function prototypes static
Staging: rtl8192u: Remove function prototype from .c file

 drivers/staging/rtl8192u/r8192U_core.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 Staging: rtl8192u: Make function prototypes static

Make functions static since they are used locally and no other files refer them.

---
 drivers/staging/rtl8192u/r8192U_core.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/rtl8192u/r8192U_core.c +8 -8
index f609656..9b31cd0 100644
@@ -409,8 +409,8 @@ inline void force_pci_posting(struct net_device *dev)
 
 static struct net_device_stats *rtl8192_stats(struct net_device *dev);
 void rtl8192_commit(struct net_device *dev);
-void rtl8192_restart(struct work_struct *work);
-void watch_dog_timer_callback(unsigned long data);
+static void rtl8192_restart(struct work_struct *work);
+static void watch_dog_timer_callback(unsigned long data);
 
 /****************************************************************************
  *   -----------------------------PROCFS STUFF-------------------------
@@ -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);
@@ -2243,9 +2243,9 @@ static void rtl8192_init_priv_lock(struct r8192_priv *priv)
 	mutex_init(&priv->mutex);
 }
 
-extern  void    rtl819x_watchdog_wqcallback(struct work_struct *work);
+static void rtl819x_watchdog_wqcallback(struct work_struct *work);
 
-void rtl8192_irq_rx_tasklet(struct r8192_priv *priv);
+static void rtl8192_irq_rx_tasklet(struct r8192_priv *priv);
 //init tasklet and wait_queue here. only 2.6 above kernel is considered
 #define DRV_NAME "wlan0"
 static void rtl8192_init_priv_task(struct net_device *dev)
@@ -3017,9 +3017,9 @@ static RESET_TYPE rtl819x_ifcheck_resetornot(struct net_device *dev)
 
 }
 
-void rtl8192_cancel_deferred_work(struct r8192_priv *priv);
-int _rtl8192_up(struct net_device *dev);
-int rtl8192_close(struct net_device *dev);
+static void rtl8192_cancel_deferred_work(struct r8192_priv *priv);
+static int _rtl8192_up(struct net_device *dev);
+static int rtl8192_close(struct net_device *dev);
 
 
 
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/2 Staging: rtl8192u: Remove function prototype from .c file

In reply to Cristina Opriceana

Remove function prototype from r8192U_core.c since it is declared in the r8192U.h header and this is included in r8192U_core.c

---
 drivers/staging/rtl8192u/r8192U_core.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/rtl8192u/r8192U_core.c +0 -1
index 9b31cd0..8834c23 100644
@@ -408,7 +408,6 @@ inline void force_pci_posting(struct net_device *dev)
 }
 
 static struct net_device_stats *rtl8192_stats(struct net_device *dev);
-void rtl8192_commit(struct net_device *dev);
 static void rtl8192_restart(struct work_struct *work);
 static void watch_dog_timer_callback(unsigned long data);
 
Signature · 1 line
1.9.1