Skip to content

Commit

Permalink
net: ping: Use right format specifier to avoid type casting
Browse files Browse the repository at this point in the history
The inet_num is u16, so use %hu instead of casting it to int. And
the sk_bound_dev_if is int actually, so it needn't cast to int.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Gao Feng authored and David S. Miller committed Jan 17, 2017
1 parent 0ee28e3 commit a7ef671
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/ipv4/ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,9 @@ int ping_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
goto out;
}

pr_debug("after bind(): num = %d, dif = %d\n",
(int)isk->inet_num,
(int)sk->sk_bound_dev_if);
pr_debug("after bind(): num = %hu, dif = %d\n",
isk->inet_num,
sk->sk_bound_dev_if);

err = 0;
if (sk->sk_family == AF_INET && isk->inet_rcv_saddr)
Expand Down

0 comments on commit a7ef671

Please sign in to comment.