Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

inet*.h: 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>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Joe Perches and committed by
David S. Miller
1fd51155 e60ab84d

+155 -163
+15 -17
include/net/inet6_connection_sock.h
··· 22 22 struct sock; 23 23 struct sockaddr; 24 24 25 - extern int inet6_csk_bind_conflict(const struct sock *sk, 26 - const struct inet_bind_bucket *tb, bool relax); 25 + int inet6_csk_bind_conflict(const struct sock *sk, 26 + const struct inet_bind_bucket *tb, bool relax); 27 27 28 - extern struct dst_entry* inet6_csk_route_req(struct sock *sk, 29 - struct flowi6 *fl6, 30 - const struct request_sock *req); 28 + struct dst_entry *inet6_csk_route_req(struct sock *sk, struct flowi6 *fl6, 29 + const struct request_sock *req); 31 30 32 - extern struct request_sock *inet6_csk_search_req(const struct sock *sk, 33 - struct request_sock ***prevp, 34 - const __be16 rport, 35 - const struct in6_addr *raddr, 36 - const struct in6_addr *laddr, 37 - const int iif); 31 + struct request_sock *inet6_csk_search_req(const struct sock *sk, 32 + struct request_sock ***prevp, 33 + const __be16 rport, 34 + const struct in6_addr *raddr, 35 + const struct in6_addr *laddr, 36 + const int iif); 38 37 39 - extern void inet6_csk_reqsk_queue_hash_add(struct sock *sk, 40 - struct request_sock *req, 41 - const unsigned long timeout); 38 + void inet6_csk_reqsk_queue_hash_add(struct sock *sk, struct request_sock *req, 39 + const unsigned long timeout); 42 40 43 - extern void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); 41 + void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); 44 42 45 - extern int inet6_csk_xmit(struct sk_buff *skb, struct flowi *fl); 43 + int inet6_csk_xmit(struct sk_buff *skb, struct flowi *fl); 46 44 47 - extern struct dst_entry *inet6_csk_update_pmtu(struct sock *sk, u32 mtu); 45 + struct dst_entry *inet6_csk_update_pmtu(struct sock *sk, u32 mtu); 48 46 #endif /* _INET6_CONNECTION_SOCK_H */
+17 -19
include/net/inet6_hashtables.h
··· 53 53 return inet6_ehashfn(net, laddr, lport, faddr, fport); 54 54 } 55 55 56 - extern int __inet6_hash(struct sock *sk, struct inet_timewait_sock *twp); 56 + int __inet6_hash(struct sock *sk, struct inet_timewait_sock *twp); 57 57 58 58 /* 59 59 * Sockets in TCP_CLOSE state are _always_ taken out of the hash, so ··· 61 61 * 62 62 * The sockhash lock must be held as a reader here. 63 63 */ 64 - extern struct sock *__inet6_lookup_established(struct net *net, 65 - struct inet_hashinfo *hashinfo, 66 - const struct in6_addr *saddr, 67 - const __be16 sport, 68 - const struct in6_addr *daddr, 69 - const u16 hnum, 70 - const int dif); 64 + struct sock *__inet6_lookup_established(struct net *net, 65 + struct inet_hashinfo *hashinfo, 66 + const struct in6_addr *saddr, 67 + const __be16 sport, 68 + const struct in6_addr *daddr, 69 + const u16 hnum, const int dif); 71 70 72 - extern struct sock *inet6_lookup_listener(struct net *net, 73 - struct inet_hashinfo *hashinfo, 74 - const struct in6_addr *saddr, 75 - const __be16 sport, 76 - const struct in6_addr *daddr, 77 - const unsigned short hnum, 78 - const int dif); 71 + struct sock *inet6_lookup_listener(struct net *net, 72 + struct inet_hashinfo *hashinfo, 73 + const struct in6_addr *saddr, 74 + const __be16 sport, 75 + const struct in6_addr *daddr, 76 + const unsigned short hnum, const int dif); 79 77 80 78 static inline struct sock *__inet6_lookup(struct net *net, 81 79 struct inet_hashinfo *hashinfo, ··· 108 110 inet6_iif(skb)); 109 111 } 110 112 111 - extern struct sock *inet6_lookup(struct net *net, struct inet_hashinfo *hashinfo, 112 - const struct in6_addr *saddr, const __be16 sport, 113 - const struct in6_addr *daddr, const __be16 dport, 114 - const int dif); 113 + struct sock *inet6_lookup(struct net *net, struct inet_hashinfo *hashinfo, 114 + const struct in6_addr *saddr, const __be16 sport, 115 + const struct in6_addr *daddr, const __be16 dport, 116 + const int dif); 115 117 #endif /* IS_ENABLED(CONFIG_IPV6) */ 116 118 #endif /* _INET6_HASHTABLES_H */
+24 -24
include/net/inet_common.h
··· 13 13 struct sockaddr; 14 14 struct socket; 15 15 16 - extern int inet_release(struct socket *sock); 17 - extern int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, 18 - int addr_len, int flags); 19 - extern int __inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, 20 - int addr_len, int flags); 21 - extern int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr, 22 - int addr_len, int flags); 23 - extern int inet_accept(struct socket *sock, struct socket *newsock, int flags); 24 - extern int inet_sendmsg(struct kiocb *iocb, struct socket *sock, 25 - struct msghdr *msg, size_t size); 26 - extern ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset, 27 - size_t size, int flags); 28 - extern int inet_recvmsg(struct kiocb *iocb, struct socket *sock, 29 - struct msghdr *msg, size_t size, int flags); 30 - extern int inet_shutdown(struct socket *sock, int how); 31 - extern int inet_listen(struct socket *sock, int backlog); 32 - extern void inet_sock_destruct(struct sock *sk); 33 - extern int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len); 34 - extern int inet_getname(struct socket *sock, struct sockaddr *uaddr, 35 - int *uaddr_len, int peer); 36 - extern int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); 37 - extern int inet_ctl_sock_create(struct sock **sk, unsigned short family, 38 - unsigned short type, unsigned char protocol, 39 - struct net *net); 16 + int inet_release(struct socket *sock); 17 + int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, 18 + int addr_len, int flags); 19 + int __inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, 20 + int addr_len, int flags); 21 + int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr, 22 + int addr_len, int flags); 23 + int inet_accept(struct socket *sock, struct socket *newsock, int flags); 24 + int inet_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, 25 + size_t size); 26 + ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset, 27 + size_t size, int flags); 28 + int inet_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, 29 + size_t size, int flags); 30 + int inet_shutdown(struct socket *sock, int how); 31 + int inet_listen(struct socket *sock, int backlog); 32 + void inet_sock_destruct(struct sock *sk); 33 + int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len); 34 + int inet_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, 35 + int peer); 36 + int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); 37 + int inet_ctl_sock_create(struct sock **sk, unsigned short family, 38 + unsigned short type, unsigned char protocol, 39 + struct net *net); 40 40 41 41 static inline void inet_ctl_sock_destroy(struct sock *sk) 42 42 {
+38 -41
include/net/inet_connection_sock.h
··· 146 146 return (void *)inet_csk(sk)->icsk_ca_priv; 147 147 } 148 148 149 - extern struct sock *inet_csk_clone_lock(const struct sock *sk, 150 - const struct request_sock *req, 151 - const gfp_t priority); 149 + struct sock *inet_csk_clone_lock(const struct sock *sk, 150 + const struct request_sock *req, 151 + const gfp_t priority); 152 152 153 153 enum inet_csk_ack_state_t { 154 154 ICSK_ACK_SCHED = 1, ··· 157 157 ICSK_ACK_PUSHED2 = 8 158 158 }; 159 159 160 - extern void inet_csk_init_xmit_timers(struct sock *sk, 161 - void (*retransmit_handler)(unsigned long), 162 - void (*delack_handler)(unsigned long), 163 - void (*keepalive_handler)(unsigned long)); 164 - extern void inet_csk_clear_xmit_timers(struct sock *sk); 160 + void inet_csk_init_xmit_timers(struct sock *sk, 161 + void (*retransmit_handler)(unsigned long), 162 + void (*delack_handler)(unsigned long), 163 + void (*keepalive_handler)(unsigned long)); 164 + void inet_csk_clear_xmit_timers(struct sock *sk); 165 165 166 166 static inline void inet_csk_schedule_ack(struct sock *sk) 167 167 { ··· 178 178 memset(&inet_csk(sk)->icsk_ack, 0, sizeof(inet_csk(sk)->icsk_ack)); 179 179 } 180 180 181 - extern void inet_csk_delete_keepalive_timer(struct sock *sk); 182 - extern void inet_csk_reset_keepalive_timer(struct sock *sk, unsigned long timeout); 181 + void inet_csk_delete_keepalive_timer(struct sock *sk); 182 + void inet_csk_reset_keepalive_timer(struct sock *sk, unsigned long timeout); 183 183 184 184 #ifdef INET_CSK_DEBUG 185 185 extern const char inet_csk_timer_bug_msg[]; ··· 241 241 #endif 242 242 } 243 243 244 - extern struct sock *inet_csk_accept(struct sock *sk, int flags, int *err); 244 + struct sock *inet_csk_accept(struct sock *sk, int flags, int *err); 245 245 246 - extern struct request_sock *inet_csk_search_req(const struct sock *sk, 247 - struct request_sock ***prevp, 248 - const __be16 rport, 249 - const __be32 raddr, 250 - const __be32 laddr); 251 - extern int inet_csk_bind_conflict(const struct sock *sk, 252 - const struct inet_bind_bucket *tb, bool relax); 253 - extern int inet_csk_get_port(struct sock *sk, unsigned short snum); 246 + struct request_sock *inet_csk_search_req(const struct sock *sk, 247 + struct request_sock ***prevp, 248 + const __be16 rport, 249 + const __be32 raddr, 250 + const __be32 laddr); 251 + int inet_csk_bind_conflict(const struct sock *sk, 252 + const struct inet_bind_bucket *tb, bool relax); 253 + int inet_csk_get_port(struct sock *sk, unsigned short snum); 254 254 255 - extern struct dst_entry* inet_csk_route_req(struct sock *sk, 256 - struct flowi4 *fl4, 255 + struct dst_entry *inet_csk_route_req(struct sock *sk, struct flowi4 *fl4, 256 + const struct request_sock *req); 257 + struct dst_entry *inet_csk_route_child_sock(struct sock *sk, struct sock *newsk, 257 258 const struct request_sock *req); 258 - extern struct dst_entry* inet_csk_route_child_sock(struct sock *sk, 259 - struct sock *newsk, 260 - const struct request_sock *req); 261 259 262 260 static inline void inet_csk_reqsk_queue_add(struct sock *sk, 263 261 struct request_sock *req, ··· 264 266 reqsk_queue_add(&inet_csk(sk)->icsk_accept_queue, req, sk, child); 265 267 } 266 268 267 - extern void inet_csk_reqsk_queue_hash_add(struct sock *sk, 268 - struct request_sock *req, 269 - unsigned long timeout); 269 + void inet_csk_reqsk_queue_hash_add(struct sock *sk, struct request_sock *req, 270 + unsigned long timeout); 270 271 271 272 static inline void inet_csk_reqsk_queue_removed(struct sock *sk, 272 273 struct request_sock *req) ··· 312 315 reqsk_free(req); 313 316 } 314 317 315 - extern void inet_csk_reqsk_queue_prune(struct sock *parent, 316 - const unsigned long interval, 317 - const unsigned long timeout, 318 - const unsigned long max_rto); 318 + void inet_csk_reqsk_queue_prune(struct sock *parent, 319 + const unsigned long interval, 320 + const unsigned long timeout, 321 + const unsigned long max_rto); 319 322 320 - extern void inet_csk_destroy_sock(struct sock *sk); 321 - extern void inet_csk_prepare_forced_close(struct sock *sk); 323 + void inet_csk_destroy_sock(struct sock *sk); 324 + void inet_csk_prepare_forced_close(struct sock *sk); 322 325 323 326 /* 324 327 * LISTEN is a special case for poll.. ··· 329 332 (POLLIN | POLLRDNORM) : 0; 330 333 } 331 334 332 - extern int inet_csk_listen_start(struct sock *sk, const int nr_table_entries); 333 - extern void inet_csk_listen_stop(struct sock *sk); 335 + int inet_csk_listen_start(struct sock *sk, const int nr_table_entries); 336 + void inet_csk_listen_stop(struct sock *sk); 334 337 335 - extern void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); 338 + void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); 336 339 337 - extern int inet_csk_compat_getsockopt(struct sock *sk, int level, int optname, 338 - char __user *optval, int __user *optlen); 339 - extern int inet_csk_compat_setsockopt(struct sock *sk, int level, int optname, 340 - char __user *optval, unsigned int optlen); 340 + int inet_csk_compat_getsockopt(struct sock *sk, int level, int optname, 341 + char __user *optval, int __user *optlen); 342 + int inet_csk_compat_setsockopt(struct sock *sk, int level, int optname, 343 + char __user *optval, unsigned int optlen); 341 344 342 - extern struct dst_entry *inet_csk_update_pmtu(struct sock *sk, u32 mtu); 345 + struct dst_entry *inet_csk_update_pmtu(struct sock *sk, u32 mtu); 343 346 #endif /* _INET_CONNECTION_SOCK_H */
+35 -35
include/net/inet_hashtables.h
··· 218 218 } 219 219 } 220 220 221 - extern struct inet_bind_bucket * 222 - inet_bind_bucket_create(struct kmem_cache *cachep, 223 - struct net *net, 224 - struct inet_bind_hashbucket *head, 225 - const unsigned short snum); 226 - extern void inet_bind_bucket_destroy(struct kmem_cache *cachep, 227 - struct inet_bind_bucket *tb); 221 + struct inet_bind_bucket * 222 + inet_bind_bucket_create(struct kmem_cache *cachep, struct net *net, 223 + struct inet_bind_hashbucket *head, 224 + const unsigned short snum); 225 + void inet_bind_bucket_destroy(struct kmem_cache *cachep, 226 + struct inet_bind_bucket *tb); 228 227 229 - static inline int inet_bhashfn(struct net *net, 230 - const __u16 lport, const int bhash_size) 228 + static inline int inet_bhashfn(struct net *net, const __u16 lport, 229 + const int bhash_size) 231 230 { 232 231 return (lport + net_hash_mix(net)) & (bhash_size - 1); 233 232 } 234 233 235 - extern void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb, 236 - const unsigned short snum); 234 + void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb, 235 + const unsigned short snum); 237 236 238 237 /* These can have wildcards, don't try too hard. */ 239 238 static inline int inet_lhashfn(struct net *net, const unsigned short num) ··· 246 247 } 247 248 248 249 /* Caller must disable local BH processing. */ 249 - extern int __inet_inherit_port(struct sock *sk, struct sock *child); 250 + int __inet_inherit_port(struct sock *sk, struct sock *child); 250 251 251 - extern void inet_put_port(struct sock *sk); 252 + void inet_put_port(struct sock *sk); 252 253 253 254 void inet_hashinfo_init(struct inet_hashinfo *h); 254 255 255 - extern int __inet_hash_nolisten(struct sock *sk, struct inet_timewait_sock *tw); 256 - extern void inet_hash(struct sock *sk); 257 - extern void inet_unhash(struct sock *sk); 256 + int __inet_hash_nolisten(struct sock *sk, struct inet_timewait_sock *tw); 257 + void inet_hash(struct sock *sk); 258 + void inet_unhash(struct sock *sk); 258 259 259 - extern struct sock *__inet_lookup_listener(struct net *net, 260 - struct inet_hashinfo *hashinfo, 261 - const __be32 saddr, 262 - const __be16 sport, 263 - const __be32 daddr, 264 - const unsigned short hnum, 265 - const int dif); 260 + struct sock *__inet_lookup_listener(struct net *net, 261 + struct inet_hashinfo *hashinfo, 262 + const __be32 saddr, const __be16 sport, 263 + const __be32 daddr, 264 + const unsigned short hnum, 265 + const int dif); 266 266 267 267 static inline struct sock *inet_lookup_listener(struct net *net, 268 268 struct inet_hashinfo *hashinfo, ··· 337 339 * 338 340 * Local BH must be disabled here. 339 341 */ 340 - extern struct sock * __inet_lookup_established(struct net *net, 341 - struct inet_hashinfo *hashinfo, 342 - const __be32 saddr, const __be16 sport, 343 - const __be32 daddr, const u16 hnum, const int dif); 342 + struct sock *__inet_lookup_established(struct net *net, 343 + struct inet_hashinfo *hashinfo, 344 + const __be32 saddr, const __be16 sport, 345 + const __be32 daddr, const u16 hnum, 346 + const int dif); 344 347 345 348 static inline struct sock * 346 349 inet_lookup_established(struct net *net, struct inet_hashinfo *hashinfo, ··· 398 399 iph->daddr, dport, inet_iif(skb)); 399 400 } 400 401 401 - extern int __inet_hash_connect(struct inet_timewait_death_row *death_row, 402 - struct sock *sk, 403 - u32 port_offset, 404 - int (*check_established)(struct inet_timewait_death_row *, 405 - struct sock *, __u16, struct inet_timewait_sock **), 406 - int (*hash)(struct sock *sk, struct inet_timewait_sock *twp)); 402 + int __inet_hash_connect(struct inet_timewait_death_row *death_row, 403 + struct sock *sk, u32 port_offset, 404 + int (*check_established)(struct inet_timewait_death_row *, 405 + struct sock *, __u16, 406 + struct inet_timewait_sock **), 407 + int (*hash)(struct sock *sk, 408 + struct inet_timewait_sock *twp)); 407 409 408 - extern int inet_hash_connect(struct inet_timewait_death_row *death_row, 409 - struct sock *sk); 410 + int inet_hash_connect(struct inet_timewait_death_row *death_row, 411 + struct sock *sk); 410 412 #endif /* _INET_HASHTABLES_H */
+2 -2
include/net/inet_sock.h
··· 199 199 } 200 200 #endif 201 201 202 - extern int inet_sk_rebuild_header(struct sock *sk); 202 + int inet_sk_rebuild_header(struct sock *sk); 203 203 204 204 extern u32 inet_ehash_secret; 205 205 extern u32 ipv6_hash_secret; 206 - extern void build_ehash_secret(void); 206 + void build_ehash_secret(void); 207 207 208 208 static inline unsigned int inet_ehashfn(struct net *net, 209 209 const __be32 laddr, const __u16 lport,
+18 -19
include/net/inet_timewait_sock.h
··· 83 83 int sysctl_max_tw_buckets; 84 84 }; 85 85 86 - extern void inet_twdr_hangman(unsigned long data); 87 - extern void inet_twdr_twkill_work(struct work_struct *work); 88 - extern void inet_twdr_twcal_tick(unsigned long data); 86 + void inet_twdr_hangman(unsigned long data); 87 + void inet_twdr_twkill_work(struct work_struct *work); 88 + void inet_twdr_twcal_tick(unsigned long data); 89 89 90 90 struct inet_bind_bucket; 91 91 ··· 195 195 return sk->__sk_common.skc_rcv_saddr; 196 196 } 197 197 198 - extern void inet_twsk_put(struct inet_timewait_sock *tw); 198 + void inet_twsk_put(struct inet_timewait_sock *tw); 199 199 200 - extern int inet_twsk_unhash(struct inet_timewait_sock *tw); 200 + int inet_twsk_unhash(struct inet_timewait_sock *tw); 201 201 202 - extern int inet_twsk_bind_unhash(struct inet_timewait_sock *tw, 203 - struct inet_hashinfo *hashinfo); 202 + int inet_twsk_bind_unhash(struct inet_timewait_sock *tw, 203 + struct inet_hashinfo *hashinfo); 204 204 205 - extern struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, 206 - const int state); 205 + struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, 206 + const int state); 207 207 208 - extern void __inet_twsk_hashdance(struct inet_timewait_sock *tw, 209 - struct sock *sk, 210 - struct inet_hashinfo *hashinfo); 208 + void __inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk, 209 + struct inet_hashinfo *hashinfo); 211 210 212 - extern void inet_twsk_schedule(struct inet_timewait_sock *tw, 213 - struct inet_timewait_death_row *twdr, 214 - const int timeo, const int timewait_len); 215 - extern void inet_twsk_deschedule(struct inet_timewait_sock *tw, 216 - struct inet_timewait_death_row *twdr); 211 + void inet_twsk_schedule(struct inet_timewait_sock *tw, 212 + struct inet_timewait_death_row *twdr, 213 + const int timeo, const int timewait_len); 214 + void inet_twsk_deschedule(struct inet_timewait_sock *tw, 215 + struct inet_timewait_death_row *twdr); 217 216 218 - extern void inet_twsk_purge(struct inet_hashinfo *hashinfo, 219 - struct inet_timewait_death_row *twdr, int family); 217 + void inet_twsk_purge(struct inet_hashinfo *hashinfo, 218 + struct inet_timewait_death_row *twdr, int family); 220 219 221 220 static inline 222 221 struct net *twsk_net(const struct inet_timewait_sock *twsk)
+6 -6
include/net/inetpeer.h
··· 120 120 } 121 121 } 122 122 123 - extern void inet_peer_base_init(struct inet_peer_base *); 123 + void inet_peer_base_init(struct inet_peer_base *); 124 124 125 - void inet_initpeers(void) __init; 125 + void inet_initpeers(void) __init; 126 126 127 127 #define INETPEER_METRICS_NEW (~(u32) 0) 128 128 ··· 159 159 } 160 160 161 161 /* can be called from BH context or outside */ 162 - extern void inet_putpeer(struct inet_peer *p); 163 - extern bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout); 162 + void inet_putpeer(struct inet_peer *p); 163 + bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout); 164 164 165 - extern void inetpeer_invalidate_tree(struct inet_peer_base *); 166 - extern void inetpeer_invalidate_family(int family); 165 + void inetpeer_invalidate_tree(struct inet_peer_base *); 166 + void inetpeer_invalidate_family(int family); 167 167 168 168 /* 169 169 * temporary check to make sure we dont access rid, ip_id_count, tcp_ts,