summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ping.c
diff options
context:
space:
mode:
authorGao Feng2017-01-17 03:21:19 +0100
committerDavid S. Miller2017-01-17 21:25:55 +0100
commita7ef6715c4b5905b663dddf3832dbdf77b3bf8ac (patch)
tree2e01ff3ce59aa55523e48a109d2b2bdbc8f896e9 /net/ipv4/ping.c
parentqed: Replace memset with eth_zero_addr (diff)
downloadkernel-qcow2-linux-a7ef6715c4b5905b663dddf3832dbdf77b3bf8ac.tar.gz
kernel-qcow2-linux-a7ef6715c4b5905b663dddf3832dbdf77b3bf8ac.tar.xz
kernel-qcow2-linux-a7ef6715c4b5905b663dddf3832dbdf77b3bf8ac.zip
net: ping: Use right format specifier to avoid type casting
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>
Diffstat (limited to 'net/ipv4/ping.c')
-rw-r--r--net/ipv4/ping.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 86cca610f4c2..592db6a3a0e9 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -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)