Commit a0f4ecf3494c9869d20f606e7e2b2f50f0e67a7f

Authored by Joe Perches
1 parent aae8c287e6

netfilter: 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.

Signed-off-by: Joe Perches <joe@perches.com>

Showing 11 changed files with 133 additions and 136 deletions Side-by-side Diff

include/linux/netfilter.h
... ... @@ -35,7 +35,7 @@
35 35 result->all[3] = a1->all[3] & mask->all[3];
36 36 }
37 37  
38   -extern int netfilter_init(void);
  38 +int netfilter_init(void);
39 39  
40 40 /* Largest hook number + 1 */
41 41 #define NF_MAX_HOOKS 8
... ... @@ -208,7 +208,7 @@
208 208 /* Call this before modifying an existing packet: ensures it is
209 209 modifiable and linear to the point you care about (writable_len).
210 210 Returns true or false. */
211   -extern int skb_make_writable(struct sk_buff *skb, unsigned int writable_len);
  211 +int skb_make_writable(struct sk_buff *skb, unsigned int writable_len);
212 212  
213 213 struct flowi;
214 214 struct nf_queue_entry;
... ... @@ -269,8 +269,8 @@
269 269 return csum;
270 270 }
271 271  
272   -extern int nf_register_afinfo(const struct nf_afinfo *afinfo);
273   -extern void nf_unregister_afinfo(const struct nf_afinfo *afinfo);
  272 +int nf_register_afinfo(const struct nf_afinfo *afinfo);
  273 +void nf_unregister_afinfo(const struct nf_afinfo *afinfo);
274 274  
275 275 #include <net/flow.h>
276 276 extern void (*nf_nat_decode_session_hook)(struct sk_buff *, struct flowi *);
... ... @@ -315,7 +315,7 @@
315 315  
316 316 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
317 317 extern void (*ip_ct_attach)(struct sk_buff *, const struct sk_buff *) __rcu;
318   -extern void nf_ct_attach(struct sk_buff *, const struct sk_buff *);
  318 +void nf_ct_attach(struct sk_buff *, const struct sk_buff *);
319 319 extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu;
320 320  
321 321 struct nf_conn;
include/linux/netfilter/nf_conntrack_common.h
... ... @@ -23,7 +23,7 @@
23 23 };
24 24  
25 25 /* call to create an explicit dependency on nf_conntrack. */
26   -extern void need_conntrack(void);
  26 +void need_conntrack(void);
27 27  
28 28 #endif /* _NF_CONNTRACK_COMMON_H */
include/linux/netfilter/nf_conntrack_h323.h
... ... @@ -29,13 +29,13 @@
29 29  
30 30 struct nf_conn;
31 31  
32   -extern int get_h225_addr(struct nf_conn *ct, unsigned char *data,
33   - TransportAddress *taddr,
34   - union nf_inet_addr *addr, __be16 *port);
35   -extern void nf_conntrack_h245_expect(struct nf_conn *new,
36   - struct nf_conntrack_expect *this);
37   -extern void nf_conntrack_q931_expect(struct nf_conn *new,
38   - struct nf_conntrack_expect *this);
  32 +int get_h225_addr(struct nf_conn *ct, unsigned char *data,
  33 + TransportAddress *taddr, union nf_inet_addr *addr,
  34 + __be16 *port);
  35 +void nf_conntrack_h245_expect(struct nf_conn *new,
  36 + struct nf_conntrack_expect *this);
  37 +void nf_conntrack_q931_expect(struct nf_conn *new,
  38 + struct nf_conntrack_expect *this);
39 39 extern int (*set_h245_addr_hook) (struct sk_buff *skb, unsigned int protoff,
40 40 unsigned char **data, int dataoff,
41 41 H245_TransportAddress *taddr,
include/linux/netfilter/nf_conntrack_proto_gre.h
... ... @@ -87,8 +87,8 @@
87 87 /* delete keymap entries */
88 88 void nf_ct_gre_keymap_destroy(struct nf_conn *ct);
89 89  
90   -extern void nf_ct_gre_keymap_flush(struct net *net);
91   -extern void nf_nat_need_gre(void);
  90 +void nf_ct_gre_keymap_flush(struct net *net);
  91 +void nf_nat_need_gre(void);
92 92  
93 93 #endif /* __KERNEL__ */
94 94 #endif /* _CONNTRACK_PROTO_GRE_H */
include/linux/netfilter/nf_conntrack_sip.h
... ... @@ -157,35 +157,34 @@
157 157 unsigned int medialen,
158 158 union nf_inet_addr *rtp_addr);
159 159  
160   -extern int ct_sip_parse_request(const struct nf_conn *ct,
161   - const char *dptr, unsigned int datalen,
162   - unsigned int *matchoff, unsigned int *matchlen,
163   - union nf_inet_addr *addr, __be16 *port);
164   -extern int ct_sip_get_header(const struct nf_conn *ct, const char *dptr,
165   - unsigned int dataoff, unsigned int datalen,
166   - enum sip_header_types type,
167   - unsigned int *matchoff, unsigned int *matchlen);
168   -extern int ct_sip_parse_header_uri(const struct nf_conn *ct, const char *dptr,
169   - unsigned int *dataoff, unsigned int datalen,
170   - enum sip_header_types type, int *in_header,
171   - unsigned int *matchoff, unsigned int *matchlen,
172   - union nf_inet_addr *addr, __be16 *port);
173   -extern int ct_sip_parse_address_param(const struct nf_conn *ct, const char *dptr,
174   - unsigned int dataoff, unsigned int datalen,
175   - const char *name,
176   - unsigned int *matchoff, unsigned int *matchlen,
177   - union nf_inet_addr *addr, bool delim);
178   -extern int ct_sip_parse_numerical_param(const struct nf_conn *ct, const char *dptr,
179   - unsigned int off, unsigned int datalen,
180   - const char *name,
181   - unsigned int *matchoff, unsigned int *matchen,
182   - unsigned int *val);
  160 +int ct_sip_parse_request(const struct nf_conn *ct, const char *dptr,
  161 + unsigned int datalen, unsigned int *matchoff,
  162 + unsigned int *matchlen, union nf_inet_addr *addr,
  163 + __be16 *port);
  164 +int ct_sip_get_header(const struct nf_conn *ct, const char *dptr,
  165 + unsigned int dataoff, unsigned int datalen,
  166 + enum sip_header_types type, unsigned int *matchoff,
  167 + unsigned int *matchlen);
  168 +int ct_sip_parse_header_uri(const struct nf_conn *ct, const char *dptr,
  169 + unsigned int *dataoff, unsigned int datalen,
  170 + enum sip_header_types type, int *in_header,
  171 + unsigned int *matchoff, unsigned int *matchlen,
  172 + union nf_inet_addr *addr, __be16 *port);
  173 +int ct_sip_parse_address_param(const struct nf_conn *ct, const char *dptr,
  174 + unsigned int dataoff, unsigned int datalen,
  175 + const char *name, unsigned int *matchoff,
  176 + unsigned int *matchlen, union nf_inet_addr *addr,
  177 + bool delim);
  178 +int ct_sip_parse_numerical_param(const struct nf_conn *ct, const char *dptr,
  179 + unsigned int off, unsigned int datalen,
  180 + const char *name, unsigned int *matchoff,
  181 + unsigned int *matchen, unsigned int *val);
183 182  
184   -extern int ct_sip_get_sdp_header(const struct nf_conn *ct, const char *dptr,
185   - unsigned int dataoff, unsigned int datalen,
186   - enum sdp_header_types type,
187   - enum sdp_header_types term,
188   - unsigned int *matchoff, unsigned int *matchlen);
  183 +int ct_sip_get_sdp_header(const struct nf_conn *ct, const char *dptr,
  184 + unsigned int dataoff, unsigned int datalen,
  185 + enum sdp_header_types type,
  186 + enum sdp_header_types term,
  187 + unsigned int *matchoff, unsigned int *matchlen);
189 188  
190 189 #endif /* __KERNEL__ */
191 190 #endif /* __NF_CONNTRACK_SIP_H__ */
include/linux/netfilter/nfnetlink.h
... ... @@ -25,20 +25,20 @@
25 25 const struct nfnl_callback *cb; /* callback for individual types */
26 26 };
27 27  
28   -extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n);
29   -extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n);
  28 +int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n);
  29 +int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n);
30 30  
31   -extern int nfnetlink_has_listeners(struct net *net, unsigned int group);
32   -extern struct sk_buff *nfnetlink_alloc_skb(struct net *net, unsigned int size,
33   - u32 dst_portid, gfp_t gfp_mask);
34   -extern int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 portid,
35   - unsigned int group, int echo, gfp_t flags);
36   -extern int nfnetlink_set_err(struct net *net, u32 portid, u32 group, int error);
37   -extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net,
38   - u32 portid, int flags);
  31 +int nfnetlink_has_listeners(struct net *net, unsigned int group);
  32 +struct sk_buff *nfnetlink_alloc_skb(struct net *net, unsigned int size,
  33 + u32 dst_portid, gfp_t gfp_mask);
  34 +int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 portid,
  35 + unsigned int group, int echo, gfp_t flags);
  36 +int nfnetlink_set_err(struct net *net, u32 portid, u32 group, int error);
  37 +int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u32 portid,
  38 + int flags);
39 39  
40   -extern void nfnl_lock(__u8 subsys_id);
41   -extern void nfnl_unlock(__u8 subsys_id);
  40 +void nfnl_lock(__u8 subsys_id);
  41 +void nfnl_unlock(__u8 subsys_id);
42 42  
43 43 #define MODULE_ALIAS_NFNL_SUBSYS(subsys) \
44 44 MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys))
include/linux/netfilter/nfnetlink_acct.h
... ... @@ -6,9 +6,9 @@
6 6  
7 7 struct nf_acct;
8 8  
9   -extern struct nf_acct *nfnl_acct_find_get(const char *filter_name);
10   -extern void nfnl_acct_put(struct nf_acct *acct);
11   -extern void nfnl_acct_update(const struct sk_buff *skb, struct nf_acct *nfacct);
  9 +struct nf_acct *nfnl_acct_find_get(const char *filter_name);
  10 +void nfnl_acct_put(struct nf_acct *acct);
  11 +void nfnl_acct_update(const struct sk_buff *skb, struct nf_acct *nfacct);
12 12  
13 13 #endif /* _NFNL_ACCT_H */
include/linux/netfilter/x_tables.h
... ... @@ -229,50 +229,48 @@
229 229  
230 230 #define XT_TABLE_INFO_SZ (offsetof(struct xt_table_info, entries) \
231 231 + nr_cpu_ids * sizeof(char *))
232   -extern int xt_register_target(struct xt_target *target);
233   -extern void xt_unregister_target(struct xt_target *target);
234   -extern int xt_register_targets(struct xt_target *target, unsigned int n);
235   -extern void xt_unregister_targets(struct xt_target *target, unsigned int n);
  232 +int xt_register_target(struct xt_target *target);
  233 +void xt_unregister_target(struct xt_target *target);
  234 +int xt_register_targets(struct xt_target *target, unsigned int n);
  235 +void xt_unregister_targets(struct xt_target *target, unsigned int n);
236 236  
237   -extern int xt_register_match(struct xt_match *target);
238   -extern void xt_unregister_match(struct xt_match *target);
239   -extern int xt_register_matches(struct xt_match *match, unsigned int n);
240   -extern void xt_unregister_matches(struct xt_match *match, unsigned int n);
  237 +int xt_register_match(struct xt_match *target);
  238 +void xt_unregister_match(struct xt_match *target);
  239 +int xt_register_matches(struct xt_match *match, unsigned int n);
  240 +void xt_unregister_matches(struct xt_match *match, unsigned int n);
241 241  
242   -extern int xt_check_match(struct xt_mtchk_param *,
243   - unsigned int size, u_int8_t proto, bool inv_proto);
244   -extern int xt_check_target(struct xt_tgchk_param *,
245   - unsigned int size, u_int8_t proto, bool inv_proto);
  242 +int xt_check_match(struct xt_mtchk_param *, unsigned int size, u_int8_t proto,
  243 + bool inv_proto);
  244 +int xt_check_target(struct xt_tgchk_param *, unsigned int size, u_int8_t proto,
  245 + bool inv_proto);
246 246  
247   -extern struct xt_table *xt_register_table(struct net *net,
248   - const struct xt_table *table,
249   - struct xt_table_info *bootstrap,
250   - struct xt_table_info *newinfo);
251   -extern void *xt_unregister_table(struct xt_table *table);
  247 +struct xt_table *xt_register_table(struct net *net,
  248 + const struct xt_table *table,
  249 + struct xt_table_info *bootstrap,
  250 + struct xt_table_info *newinfo);
  251 +void *xt_unregister_table(struct xt_table *table);
252 252  
253   -extern struct xt_table_info *xt_replace_table(struct xt_table *table,
254   - unsigned int num_counters,
255   - struct xt_table_info *newinfo,
256   - int *error);
  253 +struct xt_table_info *xt_replace_table(struct xt_table *table,
  254 + unsigned int num_counters,
  255 + struct xt_table_info *newinfo,
  256 + int *error);
257 257  
258   -extern struct xt_match *xt_find_match(u8 af, const char *name, u8 revision);
259   -extern struct xt_target *xt_find_target(u8 af, const char *name, u8 revision);
260   -extern struct xt_match *xt_request_find_match(u8 af, const char *name,
261   - u8 revision);
262   -extern struct xt_target *xt_request_find_target(u8 af, const char *name,
263   - u8 revision);
264   -extern int xt_find_revision(u8 af, const char *name, u8 revision,
265   - int target, int *err);
  258 +struct xt_match *xt_find_match(u8 af, const char *name, u8 revision);
  259 +struct xt_target *xt_find_target(u8 af, const char *name, u8 revision);
  260 +struct xt_match *xt_request_find_match(u8 af, const char *name, u8 revision);
  261 +struct xt_target *xt_request_find_target(u8 af, const char *name, u8 revision);
  262 +int xt_find_revision(u8 af, const char *name, u8 revision, int target,
  263 + int *err);
266 264  
267   -extern struct xt_table *xt_find_table_lock(struct net *net, u_int8_t af,
268   - const char *name);
269   -extern void xt_table_unlock(struct xt_table *t);
  265 +struct xt_table *xt_find_table_lock(struct net *net, u_int8_t af,
  266 + const char *name);
  267 +void xt_table_unlock(struct xt_table *t);
270 268  
271   -extern int xt_proto_init(struct net *net, u_int8_t af);
272   -extern void xt_proto_fini(struct net *net, u_int8_t af);
  269 +int xt_proto_init(struct net *net, u_int8_t af);
  270 +void xt_proto_fini(struct net *net, u_int8_t af);
273 271  
274   -extern struct xt_table_info *xt_alloc_table_info(unsigned int size);
275   -extern void xt_free_table_info(struct xt_table_info *info);
  272 +struct xt_table_info *xt_alloc_table_info(unsigned int size);
  273 +void xt_free_table_info(struct xt_table_info *info);
276 274  
277 275 /**
278 276 * xt_recseq - recursive seqcount for netfilter use
... ... @@ -353,8 +351,8 @@
353 351 return ret;
354 352 }
355 353  
356   -extern struct nf_hook_ops *xt_hook_link(const struct xt_table *, nf_hookfn *);
357   -extern void xt_hook_unlink(const struct xt_table *, struct nf_hook_ops *);
  354 +struct nf_hook_ops *xt_hook_link(const struct xt_table *, nf_hookfn *);
  355 +void xt_hook_unlink(const struct xt_table *, struct nf_hook_ops *);
358 356  
359 357 #ifdef CONFIG_COMPAT
360 358 #include <net/compat.h>
361 359  
362 360  
363 361  
... ... @@ -414,25 +412,25 @@
414 412  
415 413 #define COMPAT_XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _compat_xt_align))
416 414  
417   -extern void xt_compat_lock(u_int8_t af);
418   -extern void xt_compat_unlock(u_int8_t af);
  415 +void xt_compat_lock(u_int8_t af);
  416 +void xt_compat_unlock(u_int8_t af);
419 417  
420   -extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, int delta);
421   -extern void xt_compat_flush_offsets(u_int8_t af);
422   -extern void xt_compat_init_offsets(u_int8_t af, unsigned int number);
423   -extern int xt_compat_calc_jump(u_int8_t af, unsigned int offset);
  418 +int xt_compat_add_offset(u_int8_t af, unsigned int offset, int delta);
  419 +void xt_compat_flush_offsets(u_int8_t af);
  420 +void xt_compat_init_offsets(u_int8_t af, unsigned int number);
  421 +int xt_compat_calc_jump(u_int8_t af, unsigned int offset);
424 422  
425   -extern int xt_compat_match_offset(const struct xt_match *match);
426   -extern int xt_compat_match_from_user(struct xt_entry_match *m,
427   - void **dstptr, unsigned int *size);
428   -extern int xt_compat_match_to_user(const struct xt_entry_match *m,
429   - void __user **dstptr, unsigned int *size);
  423 +int xt_compat_match_offset(const struct xt_match *match);
  424 +int xt_compat_match_from_user(struct xt_entry_match *m, void **dstptr,
  425 + unsigned int *size);
  426 +int xt_compat_match_to_user(const struct xt_entry_match *m,
  427 + void __user **dstptr, unsigned int *size);
430 428  
431   -extern int xt_compat_target_offset(const struct xt_target *target);
432   -extern void xt_compat_target_from_user(struct xt_entry_target *t,
433   - void **dstptr, unsigned int *size);
434   -extern int xt_compat_target_to_user(const struct xt_entry_target *t,
435   - void __user **dstptr, unsigned int *size);
  429 +int xt_compat_target_offset(const struct xt_target *target);
  430 +void xt_compat_target_from_user(struct xt_entry_target *t, void **dstptr,
  431 + unsigned int *size);
  432 +int xt_compat_target_to_user(const struct xt_entry_target *t,
  433 + void __user **dstptr, unsigned int *size);
436 434  
437 435 #endif /* CONFIG_COMPAT */
438 436 #endif /* _X_TABLES_H */
include/linux/netfilter_bridge.h
... ... @@ -25,7 +25,7 @@
25 25 #define BRNF_PPPoE 0x20
26 26  
27 27 /* Only used in br_forward.c */
28   -extern int nf_bridge_copy_header(struct sk_buff *skb);
  28 +int nf_bridge_copy_header(struct sk_buff *skb);
29 29 static inline int nf_bridge_maybe_copy_header(struct sk_buff *skb)
30 30 {
31 31 if (skb->nf_bridge &&
... ... @@ -53,7 +53,7 @@
53 53 return 0;
54 54 }
55 55  
56   -extern int br_handle_frame_finish(struct sk_buff *skb);
  56 +int br_handle_frame_finish(struct sk_buff *skb);
57 57 /* Only used in br_device.c */
58 58 static inline int br_nf_pre_routing_finish_bridge_slow(struct sk_buff *skb)
59 59 {
include/linux/netfilter_ipv4.h
... ... @@ -6,8 +6,8 @@
6 6  
7 7 #include <uapi/linux/netfilter_ipv4.h>
8 8  
9   -extern int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type);
10   -extern __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook,
11   - unsigned int dataoff, u_int8_t protocol);
  9 +int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type);
  10 +__sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook,
  11 + unsigned int dataoff, u_int8_t protocol);
12 12 #endif /*__LINUX_IP_NETFILTER_H*/
include/linux/netfilter_ipv6.h
... ... @@ -11,12 +11,12 @@
11 11  
12 12  
13 13 #ifdef CONFIG_NETFILTER
14   -extern int ip6_route_me_harder(struct sk_buff *skb);
15   -extern __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
16   - unsigned int dataoff, u_int8_t protocol);
  14 +int ip6_route_me_harder(struct sk_buff *skb);
  15 +__sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
  16 + unsigned int dataoff, u_int8_t protocol);
17 17  
18   -extern int ipv6_netfilter_init(void);
19   -extern void ipv6_netfilter_fini(void);
  18 +int ipv6_netfilter_init(void);
  19 +void ipv6_netfilter_fini(void);
20 20  
21 21 /*
22 22 * Hook functions for ipv6 to allow xt_* modules to be built-in even