[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1484619679-17728-1-git-send-email-fgao@ikuai8.com>
Date: Tue, 17 Jan 2017 10:21:19 +0800
From: fgao@...ai8.com
To: davem@...emloft.net, kuznet@....inr.ac.ru, jmorris@...ei.org,
netdev@...r.kernel.org, gfree.wind@...il.com
Cc: Gao Feng <fgao@...ai8.com>
Subject: [PATCH net-next 1/1] net: ping: Use right format specifier to avoid type casting
From: Gao Feng <fgao@...ai8.com>
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@...ai8.com>
---
net/ipv4/ping.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 86cca61..592db6a 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)
--
1.9.1
Powered by blists - more mailing lists