Skip to content

Commit a06a2d3

Browse files
Wu Fengguangdavem330
authored andcommitted
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>
1 parent 8c367fc commit a06a2d3

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

‎net/ipv4/ping.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ void ping_close(struct sock *sk, long timeout)
283283
EXPORT_SYMBOL_GPL(ping_close);
284284

285285
/* 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) {
288288
struct net *net = sock_net(sk);
289289
if (sk->sk_family == AF_INET) {
290290
struct sockaddr_in *addr = (struct sockaddr_in *) uaddr;
@@ -352,7 +352,7 @@ int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
352352
return 0;
353353
}
354354

355-
void ping_set_saddr(struct sock *sk, struct sockaddr *saddr)
355+
static void ping_set_saddr(struct sock *sk, struct sockaddr *saddr)
356356
{
357357
if (saddr->sa_family == AF_INET) {
358358
struct inet_sock *isk = inet_sk(sk);
@@ -367,7 +367,7 @@ void ping_set_saddr(struct sock *sk, struct sockaddr *saddr)
367367
}
368368
}
369369

370-
void ping_clear_saddr(struct sock *sk, int dif)
370+
static void ping_clear_saddr(struct sock *sk, int dif)
371371
{
372372
sk->sk_bound_dev_if = dif;
373373
if (sk->sk_family == AF_INET) {

‎net/ipv6/ping.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,23 @@ static struct inet_protosw pingv6_protosw = {
5757

5858

5959
/* 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)
6161
{
6262
return -EAFNOSUPPORT;
6363
}
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)
6666
{
6767
return -EAFNOSUPPORT;
6868
}
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)
7070
{
7171
return -EAFNOSUPPORT;
7272
}
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)
7777
{
7878
return 0;
7979
}
@@ -198,7 +198,7 @@ static void *ping_v6_seq_start(struct seq_file *seq, loff_t *pos)
198198
return ping_seq_start(seq, pos, AF_INET6);
199199
}
200200

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)
202202
{
203203
if (v == SEQ_START_TOKEN) {
204204
seq_puts(seq, IPV6_SEQ_DGRAM_HEADER);

0 commit comments

Comments
 (0)