Skip to content

Commit a7ef671

Browse files
gfreewinddavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0ee28e3 commit a7ef671

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/ipv4/ping.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,9 @@ int ping_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
433433
goto out;
434434
}
435435

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

440440
err = 0;
441441
if (sk->sk_family == AF_INET && isk->inet_rcv_saddr)

0 commit comments

Comments
 (0)