net/ipv4/arp.c: Use the exported hex_asc from lib/hexdump.c instead
Subsystems (3)
PATCH 1/1 net/ipv4/arp.c: Use the exported hex_asc from lib/hexdump.c instead
Here the local hexbuf is a duplicate of global const char hex_asc from lib/hexdump.c, except the hex letters' cases:
const char hexbuf[] = "0123456789ABCDEF";
const char hex_asc[] = "0123456789abcdef";
and here to print HW addresses, the hex cases are not significant.
--- net/ipv4/arp.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
net/ipv4/arp.c +2 -3
@@ -1288,7 +1288,6 @@ static void arp_format_neigh_entry(struct seq_file *seq, struct neighbour *n) {char hbuffer[HBUFFERLEN ]; -const char hexbuf[] ="0123456789ABCDEF" ;int k, j;char tbuf[16 ];struct net_device *dev = n->dev;
@@ -1302,8 +1301,8 @@ static void arp_format_neigh_entry(struct seq_file *seq, else {#endif for (k =0 , j =0 ; k <HBUFFERLEN -3 && j < dev->addr_len; j++) { - hbuffer[k++] = hexbuf[(n->ha[j] >>4 ) &15 ]; - hbuffer[k++] = hexbuf[n->ha[j] &15 ]; + hbuffer[k++] = hex_asc[(n->ha[j] >>4 ) &15 ]; + hbuffer[k++] = hex_asc[n->ha[j] &15 ]; hbuffer[k++] =':' ; } hbuffer[--k] =0 ;
Signature · 1 line
1.5.5.1
From: Denis Cheng <[email protected]>
Date: Mon, 19 May 2008 02:37:44 +0800
Quoted 10 lines
Here the local hexbuf is a duplicate of global const char
hex_ascfromlib/hexdump.c, except the hex letters' cases:const char hexbuf[] = "0123456789ABCDEF";
const char hex_asc[] = "
0123456789abcdef";and here to print HW addresses, the hex cases are not significant.
Signed-off-by Denis Cheng <[email protected]>
Applied, thanks.
Quoted 8 lines · David Miller
From: Denis Cheng <[email protected]>
Date: Mon, 19 May 2008 02:37:44 +0800Quoted 5 lines
Here the local hexbuf is a duplicate of global const char
hex_ascfromlib/hexdump.c, except the hex letters' cases:const char hexbuf[] = "0123456789ABCDEF";
Quoted 7 lines
Quoted 5 lines
const char hex_asc[] = "
0123456789abcdef";and here to print HW addresses, the hex cases are not significant.
Signed-off-by Denis Cheng <[email protected]>Applied, thanks.
You may want to use the hex_asc_hi, hex_asc_lo helpers to do the mask/shifts for you.
Harvey
From: Harvey Harrison <[email protected]>
Subject: [PATCH] net: use common hex_asc helpers
---
Something like this.
net/ipv4/arp.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
net/ipv4/arp.c +2 -3
@@ -1288,7 +1288,6 @@ static void arp_format_neigh_entry(struct seq_file *seq, struct neighbour *n) {char hbuffer[HBUFFERLEN ]; -const char hexbuf[] ="0123456789ABCDEF" ;int k, j;char tbuf[16 ];struct net_device *dev = n->dev;
@@ -1302,8 +1301,8 @@ static void arp_format_neigh_entry(struct seq_file *seq, else {#endif for (k =0 , j =0 ; k <HBUFFERLEN -3 && j < dev->addr_len; j++) { - hbuffer[k++] = hexbuf[(n->ha[j] >>4 ) &15 ]; - hbuffer[k++] = hexbuf[n->ha[j] &15 ]; + hbuffer[k++] =hex_asc_hi (n->ha[j]); + hbuffer[k++] =hex_asc_lo (n->ha[j]); hbuffer[k++] =':' ; } hbuffer[--k] =0 ;
Signature · 1 line
1.5.5.1.570.g26b5e
David Miller
maintainerFrom: Harvey Harrison <[email protected]>
Date: Tue, 20 May 2008 15:40:12 -0700
Quoted 11 lines · David Miller
Quoted 10 lines
From: Denis Cheng <[email protected]>
Date: Mon, 19 May 2008 02:37:44 +0800Quoted 7 lines
Here the local hexbuf is a duplicate of global const char
hex_ascfromlib/hexdump.c, except the hex letters' cases:const char hexbuf[] = "0123456789ABCDEF";
const char hex_asc[] = "
0123456789abcdef";
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
and here to print HW addresses, the hex cases are not significant.
Signed-off-by Denis Cheng <[email protected]>Applied, thanks.
You may want to use the
hex_asc_hi,hex_asc_lohelpers to do the mask/shifts for you.
Good idea, I'll revert, Denis can you generate a new patch?
Thanks.
rae l
Acked-by David S. MillerQuoted 1 line
From
bc47e710a3ebd8a5989404f711a051b6516d01edMon Sep 17 00:00:00 2001
From: Denis Cheng <[email protected]>
Date: Wed, 21 May 2008 09:43:32 +0800
Subject: [PATCH] net/ipv4/arp.c: Use common hex_asc helpers
Here the local hexbuf is a duplicate of global const char hex_asc from lib/hexdump.c, except the hex letters' cases:
const char hexbuf[] = "0123456789ABCDEF"; const char hex_asc[] = "0123456789abcdef";
and here to print HW addresses, the hex cases are not significant.
Thanks to Harvey Harrison to introduce the hex_asc_hi/hex_asc_lo helpers.
--- net/ipv4/arp.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
net/ipv4/arp.c +2 -3
@@ -1288,7 +1288,6 @@ static void arp_format_neigh_entry(struct seq_file *seq, struct neighbour *n) {char hbuffer[HBUFFERLEN ]; -const char hexbuf[] ="0123456789ABCDEF" ;int k, j;char tbuf[16 ];struct net_device *dev = n->dev;
@@ -1302,8 +1301,8 @@ static void arp_format_neigh_entry(struct seq_file *seq, else {#endif for (k =0 , j =0 ; k <HBUFFERLEN -3 && j < dev->addr_len; j++) { - hbuffer[k++] = hexbuf[(n->ha[j] >>4 ) &15 ]; - hbuffer[k++] = hexbuf[n->ha[j] &15 ]; + hbuffer[k++] =hex_asc_hi (n->ha[j]); + hbuffer[k++] =hex_asc_lo (n->ha[j]); hbuffer[k++] =':' ; } hbuffer[--k] =0 ;
Signature · 1 line
1.5.4.3
From: "rae l" <[email protected]>
Date: Wed, 21 May 2008 10:27:41 +0800
Quoted 9 lines
net/ipv4/arp.c: Use commonhex_aschelpersHere the local hexbuf is a duplicate of global const char
hex_ascfromlib/hexdump.c, except the hex letters' cases:const char hexbuf[] = "0123456789ABCDEF"; const char hex_asc[] = "0123456789abcdef";
Quoted 6 lines
and here to print HW addresses, the hex cases are not significant.
Thanks to Harvey Harrison to introduce the hex_asc_hi/hex_asc_lo helpers.
Signed-off-by Denis Cheng <[email protected]>Signed-off-by Harvey Harrison <[email protected]>
Applied, thanks.
Harvey I know you posted a nearly identical patch, I had to choose one and he did credit you with the idea for the updated patch, so I hope this is OK.
Thanks.
Quoted 16 lines · David Miller
From: "rae l" <[email protected]>
Date: Wed, 21 May 2008 10:27:41 +0800Quoted 13 lines
net/ipv4/arp.c: Use commonhex_aschelpersHere the local hexbuf is a duplicate of global const char
hex_ascfromlib/hexdump.c, except the hex letters' cases:const char hexbuf[] = "0123456789ABCDEF"; const char hex_asc[] = "0123456789abcdef";and here to print HW addresses, the hex cases are not significant.
Thanks to Harvey Harrison to introduce the hex_asc_hi/hex_asc_lo helpers.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Denis Cheng <[email protected]>Signed-off-by Harvey Harrison <[email protected]>Applied, thanks.
Harvey I know you posted a nearly identical patch, I had to choose one and he did credit you with the idea for the updated patch, so I hope this is OK.
His had the better changelog, I just sent mine to make my point clear what the patch could look like.
No problems here.
Harvey
Quoted 10 lines · Harvey Harrison
Quoted 5 lines
Applied, thanks.
Harvey I know you posted a nearly identical patch, I had to choose one and he did credit you with the idea for the updated patch, so I hope this is OK.
His had the better changelog, I just sent mine to make my point clear what the patch could look like.
No problems here.
Also thanks to all you guy. :-)
Quoted 2 lines
Harvey
Signature · 1 line
Denis