* [PATCH] rose: use %*ph specifier
@ 2014-09-05 15:01 Andy Shevchenko
2014-09-05 15:17 ` Eric Dumazet
2014-09-05 17:23 ` Sergei Shtylyov
0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2014-09-05 15:01 UTC (permalink / raw)
To: David S. Miller, linux-hams, netdev; +Cc: Andy Shevchenko
Instead of dereference each byte let's use %*ph specifier in the printk()
calls.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
net/rose/rose_link.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/rose/rose_link.c b/net/rose/rose_link.c
index bc55142..ce60771 100644
--- a/net/rose/rose_link.c
+++ b/net/rose/rose_link.c
@@ -160,7 +160,7 @@ void rose_link_rx_restart(struct sk_buff *skb, struct rose_neigh *neigh, unsigne
break;
case ROSE_DIAGNOSTIC:
- printk(KERN_WARNING "ROSE: received diagnostic #%d - %02X %02X %02X\n", skb->data[3], skb->data[4], skb->data[5], skb->data[6]);
+ pr_warn("ROSE: received diagnostic #%d - %4ph\n", skb->data + 3);
break;
default:
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] rose: use %*ph specifier
2014-09-05 15:01 [PATCH] rose: use %*ph specifier Andy Shevchenko
@ 2014-09-05 15:17 ` Eric Dumazet
2014-09-05 15:22 ` Andy Shevchenko
2014-09-05 17:23 ` Sergei Shtylyov
1 sibling, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2014-09-05 15:17 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: David S. Miller, linux-hams, netdev
On Fri, 2014-09-05 at 18:01 +0300, Andy Shevchenko wrote:
> Instead of dereference each byte let's use %*ph specifier in the printk()
> calls.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> net/rose/rose_link.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/rose/rose_link.c b/net/rose/rose_link.c
> index bc55142..ce60771 100644
> --- a/net/rose/rose_link.c
> +++ b/net/rose/rose_link.c
> @@ -160,7 +160,7 @@ void rose_link_rx_restart(struct sk_buff *skb, struct rose_neigh *neigh, unsigne
> break;
>
> case ROSE_DIAGNOSTIC:
> - printk(KERN_WARNING "ROSE: received diagnostic #%d - %02X %02X %02X\n", skb->data[3], skb->data[4], skb->data[5], skb->data[6]);
> + pr_warn("ROSE: received diagnostic #%d - %4ph\n", skb->data + 3);
> break;
>
> default:
That can not be correct.
Have you even compiled this ?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rose: use %*ph specifier
2014-09-05 15:17 ` Eric Dumazet
@ 2014-09-05 15:22 ` Andy Shevchenko
0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2014-09-05 15:22 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David S. Miller, linux-hams, netdev
On Fri, 2014-09-05 at 08:17 -0700, Eric Dumazet wrote:
> On Fri, 2014-09-05 at 18:01 +0300, Andy Shevchenko wrote:
> > Instead of dereference each byte let's use %*ph specifier in the printk()
> > calls.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> > net/rose/rose_link.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/net/rose/rose_link.c b/net/rose/rose_link.c
> > index bc55142..ce60771 100644
> > --- a/net/rose/rose_link.c
> > +++ b/net/rose/rose_link.c
> > @@ -160,7 +160,7 @@ void rose_link_rx_restart(struct sk_buff *skb, struct rose_neigh *neigh, unsigne
> > break;
> >
> > case ROSE_DIAGNOSTIC:
> > - printk(KERN_WARNING "ROSE: received diagnostic #%d - %02X %02X %02X\n", skb->data[3], skb->data[4], skb->data[5], skb->data[6]);
> > + pr_warn("ROSE: received diagnostic #%d - %4ph\n", skb->data + 3);
> > break;
> >
> > default:
>
> That can not be correct.
Yes, you right.
>
> Have you even compiled this ?
Apparently not this time.
--
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rose: use %*ph specifier
2014-09-05 15:01 [PATCH] rose: use %*ph specifier Andy Shevchenko
2014-09-05 15:17 ` Eric Dumazet
@ 2014-09-05 17:23 ` Sergei Shtylyov
1 sibling, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2014-09-05 17:23 UTC (permalink / raw)
To: Andy Shevchenko, David S. Miller, linux-hams, netdev
On 09/05/2014 07:01 PM, Andy Shevchenko wrote:
> Instead of dereference each byte let's use %*ph specifier in the printk()
> calls.
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> net/rose/rose_link.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/net/rose/rose_link.c b/net/rose/rose_link.c
> index bc55142..ce60771 100644
> --- a/net/rose/rose_link.c
> +++ b/net/rose/rose_link.c
> @@ -160,7 +160,7 @@ void rose_link_rx_restart(struct sk_buff *skb, struct rose_neigh *neigh, unsigne
> break;
>
> case ROSE_DIAGNOSTIC:
> - printk(KERN_WARNING "ROSE: received diagnostic #%d - %02X %02X %02X\n", skb->data[3], skb->data[4], skb->data[5], skb->data[6]);
> + pr_warn("ROSE: received diagnostic #%d - %4ph\n", skb->data + 3);
Er, this doesn't seem right. The equivalent code would be:
pr_warn("ROSE: received diagnostic #%d - %3ph\n", skb->data[3], skb->data + 4);
WBR, Sergei
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-09-05 17:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-05 15:01 [PATCH] rose: use %*ph specifier Andy Shevchenko
2014-09-05 15:17 ` Eric Dumazet
2014-09-05 15:22 ` Andy Shevchenko
2014-09-05 17:23 ` Sergei Shtylyov
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).