Skip to content

Commit

Permalink
nf_tables*.h: Remove extern from function prototypes
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Joe Perches authored and David S. Miller committed Oct 21, 2013
1 parent c68c7f5 commit 5eccdfa
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 43 deletions.
55 changes: 26 additions & 29 deletions include/net/netfilter/nf_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,11 @@ struct nft_data_desc {
unsigned int len;
};

extern int nft_data_init(const struct nft_ctx *ctx, struct nft_data *data,
struct nft_data_desc *desc, const struct nlattr *nla);
extern void nft_data_uninit(const struct nft_data *data,
enum nft_data_types type);
extern int nft_data_dump(struct sk_buff *skb, int attr,
const struct nft_data *data,
enum nft_data_types type, unsigned int len);
int nft_data_init(const struct nft_ctx *ctx, struct nft_data *data,
struct nft_data_desc *desc, const struct nlattr *nla);
void nft_data_uninit(const struct nft_data *data, enum nft_data_types type);
int nft_data_dump(struct sk_buff *skb, int attr, const struct nft_data *data,
enum nft_data_types type, unsigned int len);

static inline enum nft_data_types nft_dreg_to_type(enum nft_registers reg)
{
Expand All @@ -109,12 +107,11 @@ static inline enum nft_registers nft_type_to_reg(enum nft_data_types type)
return type == NFT_DATA_VERDICT ? NFT_REG_VERDICT : NFT_REG_1;
}

extern int nft_validate_input_register(enum nft_registers reg);
extern int nft_validate_output_register(enum nft_registers reg);
extern int nft_validate_data_load(const struct nft_ctx *ctx,
enum nft_registers reg,
const struct nft_data *data,
enum nft_data_types type);
int nft_validate_input_register(enum nft_registers reg);
int nft_validate_output_register(enum nft_registers reg);
int nft_validate_data_load(const struct nft_ctx *ctx, enum nft_registers reg,
const struct nft_data *data,
enum nft_data_types type);

/**
* struct nft_set_elem - generic representation of set elements
Expand Down Expand Up @@ -183,8 +180,8 @@ struct nft_set_ops {
u32 features;
};

extern int nft_register_set(struct nft_set_ops *ops);
extern void nft_unregister_set(struct nft_set_ops *ops);
int nft_register_set(struct nft_set_ops *ops);
void nft_unregister_set(struct nft_set_ops *ops);

/**
* struct nft_set - nf_tables set instance
Expand Down Expand Up @@ -220,8 +217,8 @@ static inline void *nft_set_priv(const struct nft_set *set)
return (void *)set->data;
}

extern struct nft_set *nf_tables_set_lookup(const struct nft_table *table,
const struct nlattr *nla);
struct nft_set *nf_tables_set_lookup(const struct nft_table *table,
const struct nlattr *nla);

/**
* struct nft_set_binding - nf_tables set binding
Expand All @@ -237,10 +234,10 @@ struct nft_set_binding {
const struct nft_chain *chain;
};

extern int nf_tables_bind_set(const struct nft_ctx *ctx, struct nft_set *set,
struct nft_set_binding *binding);
extern void nf_tables_unbind_set(const struct nft_ctx *ctx, struct nft_set *set,
struct nft_set_binding *binding);
int nf_tables_bind_set(const struct nft_ctx *ctx, struct nft_set *set,
struct nft_set_binding *binding);
void nf_tables_unbind_set(const struct nft_ctx *ctx, struct nft_set *set,
struct nft_set_binding *binding);


/**
Expand Down Expand Up @@ -446,8 +443,8 @@ static inline struct nft_base_chain *nft_base_chain(const struct nft_chain *chai
return container_of(chain, struct nft_base_chain, chain);
}

extern unsigned int nft_do_chain_pktinfo(struct nft_pktinfo *pkt,
const struct nf_hook_ops *ops);
unsigned int nft_do_chain_pktinfo(struct nft_pktinfo *pkt,
const struct nf_hook_ops *ops);

/**
* struct nft_table - nf_tables table
Expand Down Expand Up @@ -489,8 +486,8 @@ struct nft_af_info {
nf_hookfn *hooks[NF_MAX_HOOKS];
};

extern int nft_register_afinfo(struct net *, struct nft_af_info *);
extern void nft_unregister_afinfo(struct nft_af_info *);
int nft_register_afinfo(struct net *, struct nft_af_info *);
void nft_unregister_afinfo(struct nft_af_info *);

struct nf_chain_type {
unsigned int hook_mask;
Expand All @@ -501,11 +498,11 @@ struct nf_chain_type {
int family;
};

extern int nft_register_chain_type(struct nf_chain_type *);
extern void nft_unregister_chain_type(struct nf_chain_type *);
int nft_register_chain_type(struct nf_chain_type *);
void nft_unregister_chain_type(struct nf_chain_type *);

extern int nft_register_expr(struct nft_expr_type *);
extern void nft_unregister_expr(struct nft_expr_type *);
int nft_register_expr(struct nft_expr_type *);
void nft_unregister_expr(struct nft_expr_type *);

#define MODULE_ALIAS_NFT_FAMILY(family) \
MODULE_ALIAS("nft-afinfo-" __stringify(family))
Expand Down
28 changes: 14 additions & 14 deletions include/net/netfilter/nf_tables_core.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef _NET_NF_TABLES_CORE_H
#define _NET_NF_TABLES_CORE_H

extern int nf_tables_core_module_init(void);
extern void nf_tables_core_module_exit(void);
int nf_tables_core_module_init(void);
void nf_tables_core_module_exit(void);

extern int nft_immediate_module_init(void);
extern void nft_immediate_module_exit(void);
int nft_immediate_module_init(void);
void nft_immediate_module_exit(void);

struct nft_cmp_fast_expr {
u32 data;
Expand All @@ -15,17 +15,17 @@ struct nft_cmp_fast_expr {

extern const struct nft_expr_ops nft_cmp_fast_ops;

extern int nft_cmp_module_init(void);
extern void nft_cmp_module_exit(void);
int nft_cmp_module_init(void);
void nft_cmp_module_exit(void);

extern int nft_lookup_module_init(void);
extern void nft_lookup_module_exit(void);
int nft_lookup_module_init(void);
void nft_lookup_module_exit(void);

extern int nft_bitwise_module_init(void);
extern void nft_bitwise_module_exit(void);
int nft_bitwise_module_init(void);
void nft_bitwise_module_exit(void);

extern int nft_byteorder_module_init(void);
extern void nft_byteorder_module_exit(void);
int nft_byteorder_module_init(void);
void nft_byteorder_module_exit(void);

struct nft_payload {
enum nft_payload_bases base:8;
Expand All @@ -36,7 +36,7 @@ struct nft_payload {

extern const struct nft_expr_ops nft_payload_fast_ops;

extern int nft_payload_module_init(void);
extern void nft_payload_module_exit(void);
int nft_payload_module_init(void);
void nft_payload_module_exit(void);

#endif /* _NET_NF_TABLES_CORE_H */

0 comments on commit 5eccdfa

Please sign in to comment.