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

net: ping_check_bind_addr() etc. can be static

net/ipv4/ping.c:286:5: sparse: symbol 'ping_check_bind_addr' was not declared. Should it be static?
net/ipv4/ping.c:355:6: sparse: symbol 'ping_set_saddr' was not declared. Should it be static?
net/ipv4/ping.c:370:6: sparse: symbol 'ping_clear_saddr' was not declared. Should it be static?

net/ipv6/ping.c:60:5: sparse: symbol 'dummy_ipv6_recv_error' was not declared. Should it be static?
net/ipv6/ping.c:64:5: sparse: symbol 'dummy_ip6_datagram_recv_ctl' was not declared. Should it be static?
net/ipv6/ping.c:69:5: sparse: symbol 'dummy_icmpv6_err_convert' was not declared. Should it be static?
net/ipv6/ping.c:73:6: sparse: symbol 'dummy_ipv6_icmp_error' was not declared. Should it be static?
net/ipv6/ping.c:75:5: sparse: symbol 'dummy_ipv6_chk_addr' was not declared. Should it be static?
net/ipv6/ping.c:201:5: sparse: symbol 'ping_v6_seq_show' was not declared. Should it be static?

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Wu Fengguang and committed by
David S. Miller
a06a2d37 8c367fcb

+13 -13
+4 -4
net/ipv4/ping.c
··· 283 283 EXPORT_SYMBOL_GPL(ping_close); 284 284 285 285 /* Checks the bind address and possibly modifies sk->sk_bound_dev_if. */ 286 - int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk, 287 - struct sockaddr *uaddr, int addr_len) { 286 + static int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk, 287 + struct sockaddr *uaddr, int addr_len) { 288 288 struct net *net = sock_net(sk); 289 289 if (sk->sk_family == AF_INET) { 290 290 struct sockaddr_in *addr = (struct sockaddr_in *) uaddr; ··· 352 352 return 0; 353 353 } 354 354 355 - void ping_set_saddr(struct sock *sk, struct sockaddr *saddr) 355 + static void ping_set_saddr(struct sock *sk, struct sockaddr *saddr) 356 356 { 357 357 if (saddr->sa_family == AF_INET) { 358 358 struct inet_sock *isk = inet_sk(sk); ··· 367 367 } 368 368 } 369 369 370 - void ping_clear_saddr(struct sock *sk, int dif) 370 + static void ping_clear_saddr(struct sock *sk, int dif) 371 371 { 372 372 sk->sk_bound_dev_if = dif; 373 373 if (sk->sk_family == AF_INET) {
+9 -9
net/ipv6/ping.c
··· 57 57 58 58 59 59 /* Compatibility glue so we can support IPv6 when it's compiled as a module */ 60 - int dummy_ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len) 60 + static int dummy_ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len) 61 61 { 62 62 return -EAFNOSUPPORT; 63 63 } 64 - int dummy_ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg, 65 - struct sk_buff *skb) 64 + static int dummy_ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg, 65 + struct sk_buff *skb) 66 66 { 67 67 return -EAFNOSUPPORT; 68 68 } 69 - int dummy_icmpv6_err_convert(u8 type, u8 code, int *err) 69 + static int dummy_icmpv6_err_convert(u8 type, u8 code, int *err) 70 70 { 71 71 return -EAFNOSUPPORT; 72 72 } 73 - void dummy_ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, 74 - __be16 port, u32 info, u8 *payload) {} 75 - int dummy_ipv6_chk_addr(struct net *net, const struct in6_addr *addr, 76 - const struct net_device *dev, int strict) 73 + static void dummy_ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, 74 + __be16 port, u32 info, u8 *payload) {} 75 + static int dummy_ipv6_chk_addr(struct net *net, const struct in6_addr *addr, 76 + const struct net_device *dev, int strict) 77 77 { 78 78 return 0; 79 79 } ··· 198 198 return ping_seq_start(seq, pos, AF_INET6); 199 199 } 200 200 201 - int ping_v6_seq_show(struct seq_file *seq, void *v) 201 + static int ping_v6_seq_show(struct seq_file *seq, void *v) 202 202 { 203 203 if (v == SEQ_START_TOKEN) { 204 204 seq_puts(seq, IPV6_SEQ_DGRAM_HEADER);