]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
net: ping: Use right format specifier to avoid type casting
authorGao Feng <fgao@ikuai8.com>
Tue, 17 Jan 2017 02:21:19 +0000 (10:21 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Jan 2017 20:25:55 +0000 (15:25 -0500)
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>
net/ipv4/ping.c

index 86cca610f4c2c368476dee3602d1f74ac2cd5794..592db6a3a0e92e86dac22ebc29f4e0209c074d38 100644 (file)
@@ -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)