Skip to content

Commit 7e3ea6d

Browse files
ying-xuedavem330
authored andcommitted
sctp: avoid to repeatedly declare external variables
Move the declaration for external variables to sctp.h file avoiding to repeatedly declare them with extern keyword. Signed-off-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0144a81 commit 7e3ea6d

3 files changed

Lines changed: 3 additions & 9 deletions

File tree

‎include/net/sctp/sctp.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ void sctp_remaddr_proc_exit(struct net *net);
166166
*/
167167
extern struct kmem_cache *sctp_chunk_cachep __read_mostly;
168168
extern struct kmem_cache *sctp_bucket_cachep __read_mostly;
169+
extern long sysctl_sctp_mem[3];
170+
extern int sysctl_sctp_rmem[3];
171+
extern int sysctl_sctp_wmem[3];
169172

170173
/*
171174
* Section: Macros, externs, and inlines

‎net/sctp/socket.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,6 @@ static int sctp_autobind(struct sock *sk);
102102
static void sctp_sock_migrate(struct sock *, struct sock *,
103103
struct sctp_association *, sctp_socket_type_t);
104104

105-
extern struct kmem_cache *sctp_bucket_cachep;
106-
extern long sysctl_sctp_mem[3];
107-
extern int sysctl_sctp_rmem[3];
108-
extern int sysctl_sctp_wmem[3];
109-
110105
static int sctp_memory_pressure;
111106
static atomic_long_t sctp_memory_allocated;
112107
struct percpu_counter sctp_sockets_allocated;

‎net/sctp/sysctl.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ static unsigned long max_autoclose_max =
5858
(MAX_SCHEDULE_TIMEOUT / HZ > UINT_MAX)
5959
? UINT_MAX : MAX_SCHEDULE_TIMEOUT / HZ;
6060

61-
extern long sysctl_sctp_mem[3];
62-
extern int sysctl_sctp_rmem[3];
63-
extern int sysctl_sctp_wmem[3];
64-
6561
static int proc_sctp_do_hmac_alg(struct ctl_table *ctl, int write,
6662
void __user *buffer, size_t *lenp,
6763
loff_t *ppos);

0 commit comments

Comments
 (0)