Thread (4 messages) 4 messages, 3 authors, 2014-09-05

Re: [PATCH] rose: use %*ph specifier

From: Sergei Shtylyov <hidden>
Date: 2014-09-05 17:23:40
Also in: linux-hams

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(-)
quoted hunk ↗ jump to hunk
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help