Skip to contentSkip to conversation

bridge: remove extern from function prototypes

PATCH In review Duan Jiong 2 participants 3 messages Dec 26, 2013

Subsystems (3)
lore
Share & tools
lore

Duan Jiong

author
#0 lore raw

PATCH 1/1 bridge: remove extern from function prototypes

There are a mix of function prototypes with and without extern in the kernel sources. Standardize on not using extern for function prototypes.

Function prototypes don't need to be written with extern. extern is assumed by the compiler. Its use is as unnecessary as using auto to declare automatic/local variables in a block.

---
 net/bridge/br_private.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/br_private.h +1 -1
index 2e77d92..458889e 100644
@@ -762,7 +762,7 @@ unsigned long br_timer_value(const struct timer_list *timer);
 
 /* br.c */
 #if IS_ENABLED(CONFIG_ATM_LANE)
-extern int (*br_fdb_test_addr_hook)(struct net_device *dev, unsigned char *addr);
+int (*br_fdb_test_addr_hook)(struct net_device *dev, unsigned char *addr);
 #endif
 
 /* br_netlink.c */
Signature · 1 line
1.8.3.1
author
#1 lore raw

I'm so sorry, there is something wrong with it,
please just ignore this patch!

Quoted 28 lines · Duan Jiong

There are a mix of function prototypes with and without extern in the kernel sources. Standardize on not using extern for function prototypes.

Function prototypes don't need to be written with extern. extern is assumed by the compiler. Its use is as unnecessary as using auto to declare automatic/local variables in a block.

---
 net/bridge/br_private.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/br_private.h +1 -1
index 2e77d92..458889e 100644
@@ -762,7 +762,7 @@ unsigned long br_timer_value(const struct timer_list *timer);
 
 /* br.c */
 #if IS_ENABLED(CONFIG_ATM_LANE)
-extern int (*br_fdb_test_addr_hook)(struct net_device *dev, unsigned char *addr);
+int (*br_fdb_test_addr_hook)(struct net_device *dev, unsigned char *addr);
 #endif
 
 /* br_netlink.c */
#2 lore raw
In reply to Duan Jiong

Hello.

Quoted 18 lines · Duan Jiong

There are a mix of function prototypes with and without extern in the kernel sources. Standardize on not using extern for function prototypes.

Function prototypes don't need to be written with extern. extern is assumed by the compiler. Its use is as unnecessary as using auto to declare automatic/local variables in a block.

---
  net/bridge/br_private.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/br_private.h +0 -0
index 2e77d92..458889e 100644

net/bridge/br_private.h unsigned long br_timer_value(const struct timer_list *timer); · line 765

Quoted 5 lines
net/bridge/br_private.h +1 -1
@@ -762,7 +762,7 @@ unsigned long br_timer_value(const struct timer_list *timer);
 
  /* br.c */
  #if IS_ENABLED(CONFIG_ATM_LANE)
-extern int (*br_fdb_test_addr_hook)(struct net_device *dev, unsigned char *addr);
+int (*br_fdb_test_addr_hook)(struct net_device *dev, unsigned char *addr);

This is not a function prototype, this is a pointer to function, so
removing *extern* is not right.

net/bridge/br_private.h unsigned long br_timer_value(const struct timer_list *timer); · line 766

Quoted 1 line
net/bridge/br_private.h +0 -0
  #endif

WBR, Sergei