netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2] skbuff: fix compilation warnings in skb_dump()
@ 2019-07-16 15:43 Qian Cai
  2019-07-16 16:51 ` Nathan Chancellor
  2019-07-16 21:12 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Qian Cai @ 2019-07-16 15:43 UTC (permalink / raw)
  To: davem; +Cc: willemb, joe, clang-built-linux, netdev, linux-kernel, Qian Cai

The commit 6413139dfc64 ("skbuff: increase verbosity when dumping skb
data") introduced a few compilation warnings.

net/core/skbuff.c:766:32: warning: format specifies type 'unsigned
short' but the argument has type 'unsigned int' [-Wformat]
                       level, sk->sk_family, sk->sk_type,
sk->sk_protocol);
                                             ^~~~~~~~~~~
net/core/skbuff.c:766:45: warning: format specifies type 'unsigned
short' but the argument has type 'unsigned int' [-Wformat]
                       level, sk->sk_family, sk->sk_type,
sk->sk_protocol);
^~~~~~~~~~~~~~~

Fix them by using the proper types.

Fixes: 6413139dfc64 ("skbuff: increase verbosity when dumping skb data")
Signed-off-by: Qian Cai <cai@lca.pw>
---

v2: Drop the checkpatch fix as it seems a bit more involved that it does not
    even like passing a variable to it, i.e., printk(level "msg"). Also,
    print_hex_dump() seems need a fix to be complete which can probably be done
    later.

 net/core/skbuff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 6f1e31f674a3..0338820ee0ec 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -762,7 +762,7 @@ void skb_dump(const char *level, const struct sk_buff *skb, bool full_pkt)
 		printk("%sdev name=%s feat=0x%pNF\n",
 		       level, dev->name, &dev->features);
 	if (sk)
-		printk("%ssk family=%hu type=%hu proto=%hu\n",
+		printk("%ssk family=%hu type=%u proto=%u\n",
 		       level, sk->sk_family, sk->sk_type, sk->sk_protocol);
 
 	if (full_pkt && headroom)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net v2] skbuff: fix compilation warnings in skb_dump()
  2019-07-16 15:43 [PATCH net v2] skbuff: fix compilation warnings in skb_dump() Qian Cai
@ 2019-07-16 16:51 ` Nathan Chancellor
  2019-07-16 19:01   ` Willem de Bruijn
  2019-07-16 21:12 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2019-07-16 16:51 UTC (permalink / raw)
  To: Qian Cai; +Cc: davem, willemb, joe, clang-built-linux, netdev, linux-kernel

On Tue, Jul 16, 2019 at 11:43:05AM -0400, Qian Cai wrote:
> The commit 6413139dfc64 ("skbuff: increase verbosity when dumping skb
> data") introduced a few compilation warnings.
> 
> net/core/skbuff.c:766:32: warning: format specifies type 'unsigned
> short' but the argument has type 'unsigned int' [-Wformat]
>                        level, sk->sk_family, sk->sk_type,
> sk->sk_protocol);
>                                              ^~~~~~~~~~~
> net/core/skbuff.c:766:45: warning: format specifies type 'unsigned
> short' but the argument has type 'unsigned int' [-Wformat]
>                        level, sk->sk_family, sk->sk_type,
> sk->sk_protocol);
> ^~~~~~~~~~~~~~~
> 
> Fix them by using the proper types.
> 
> Fixes: 6413139dfc64 ("skbuff: increase verbosity when dumping skb data")
> Signed-off-by: Qian Cai <cai@lca.pw>

Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net v2] skbuff: fix compilation warnings in skb_dump()
  2019-07-16 16:51 ` Nathan Chancellor
@ 2019-07-16 19:01   ` Willem de Bruijn
  0 siblings, 0 replies; 4+ messages in thread
From: Willem de Bruijn @ 2019-07-16 19:01 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Qian Cai, David Miller, Willem de Bruijn, joe, clang-built-linux,
	Network Development, LKML

On Tue, Jul 16, 2019 at 6:53 PM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> On Tue, Jul 16, 2019 at 11:43:05AM -0400, Qian Cai wrote:
> > The commit 6413139dfc64 ("skbuff: increase verbosity when dumping skb
> > data") introduced a few compilation warnings.
> >
> > net/core/skbuff.c:766:32: warning: format specifies type 'unsigned
> > short' but the argument has type 'unsigned int' [-Wformat]
> >                        level, sk->sk_family, sk->sk_type,
> > sk->sk_protocol);
> >                                              ^~~~~~~~~~~
> > net/core/skbuff.c:766:45: warning: format specifies type 'unsigned
> > short' but the argument has type 'unsigned int' [-Wformat]
> >                        level, sk->sk_family, sk->sk_type,
> > sk->sk_protocol);
> > ^~~~~~~~~~~~~~~
> >
> > Fix them by using the proper types.
> >
> > Fixes: 6413139dfc64 ("skbuff: increase verbosity when dumping skb data")
> > Signed-off-by: Qian Cai <cai@lca.pw>
>
> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>

Acked-by: Willem de Bruijn <willemb@google.com>

Thanks Qian.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net v2] skbuff: fix compilation warnings in skb_dump()
  2019-07-16 15:43 [PATCH net v2] skbuff: fix compilation warnings in skb_dump() Qian Cai
  2019-07-16 16:51 ` Nathan Chancellor
@ 2019-07-16 21:12 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2019-07-16 21:12 UTC (permalink / raw)
  To: cai; +Cc: willemb, joe, clang-built-linux, netdev, linux-kernel

From: Qian Cai <cai@lca.pw>
Date: Tue, 16 Jul 2019 11:43:05 -0400

> The commit 6413139dfc64 ("skbuff: increase verbosity when dumping skb
> data") introduced a few compilation warnings.
> 
> net/core/skbuff.c:766:32: warning: format specifies type 'unsigned
> short' but the argument has type 'unsigned int' [-Wformat]
>                        level, sk->sk_family, sk->sk_type,
> sk->sk_protocol);
>                                              ^~~~~~~~~~~
> net/core/skbuff.c:766:45: warning: format specifies type 'unsigned
> short' but the argument has type 'unsigned int' [-Wformat]
>                        level, sk->sk_family, sk->sk_type,
> sk->sk_protocol);
> ^~~~~~~~~~~~~~~
> 
> Fix them by using the proper types.
> 
> Fixes: 6413139dfc64 ("skbuff: increase verbosity when dumping skb data")
> Signed-off-by: Qian Cai <cai@lca.pw>

Applied, thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-16 21:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-16 15:43 [PATCH net v2] skbuff: fix compilation warnings in skb_dump() Qian Cai
2019-07-16 16:51 ` Nathan Chancellor
2019-07-16 19:01   ` Willem de Bruijn
2019-07-16 21:12 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).