* [PATCH] net/ipv4/arp.c: Use the exported hex_asc from lib/hexdump.c instead
@ 2008-05-18 18:37 Denis Cheng
2008-05-20 22:36 ` David Miller
0 siblings, 1 reply; 9+ messages in thread
From: Denis Cheng @ 2008-05-18 18:37 UTC (permalink / raw)
To: David S. Miller; +Cc: Herbert Xu, netdev, linux-kernel
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.
Signed-off-by: Denis Cheng <crquan@gmail.com>
---
net/ipv4/arp.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 418862f..f460fa0 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -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;
--
1.5.5.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] net/ipv4/arp.c: Use the exported hex_asc from lib/hexdump.c instead
2008-05-18 18:37 [PATCH] net/ipv4/arp.c: Use the exported hex_asc from lib/hexdump.c instead Denis Cheng
@ 2008-05-20 22:36 ` David Miller
2008-05-20 22:40 ` Harvey Harrison
2008-05-20 22:41 ` Harvey Harrison
0 siblings, 2 replies; 9+ messages in thread
From: David Miller @ 2008-05-20 22:36 UTC (permalink / raw)
To: crquan; +Cc: herbert, netdev, linux-kernel
From: Denis Cheng <crquan@gmail.com>
Date: Mon, 19 May 2008 02:37:44 +0800
> 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.
>
> Signed-off-by: Denis Cheng <crquan@gmail.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] net/ipv4/arp.c: Use the exported hex_asc from lib/hexdump.c instead
2008-05-20 22:36 ` David Miller
@ 2008-05-20 22:40 ` Harvey Harrison
2008-05-20 22:45 ` David Miller
2008-05-20 22:41 ` Harvey Harrison
1 sibling, 1 reply; 9+ messages in thread
From: Harvey Harrison @ 2008-05-20 22:40 UTC (permalink / raw)
To: David Miller; +Cc: crquan, herbert, netdev, linux-kernel
On Tue, 2008-05-20 at 15:36 -0700, David Miller wrote:
> From: Denis Cheng <crquan@gmail.com>
> Date: Mon, 19 May 2008 02:37:44 +0800
>
> > 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.
> >
> > Signed-off-by: Denis Cheng <crquan@gmail.com>
>
> Applied, thanks.
You may want to use the hex_asc_hi, hex_asc_lo helpers to do the
mask/shifts for you.
Harvey
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] net/ipv4/arp.c: Use the exported hex_asc from lib/hexdump.c instead
2008-05-20 22:36 ` David Miller
2008-05-20 22:40 ` Harvey Harrison
@ 2008-05-20 22:41 ` Harvey Harrison
1 sibling, 0 replies; 9+ messages in thread
From: Harvey Harrison @ 2008-05-20 22:41 UTC (permalink / raw)
To: David Miller; +Cc: crquan, herbert, netdev, linux-kernel
From: Harvey Harrison <harvey.harrison@gmail.com>
Subject: [PATCH] net: use common hex_asc helpers
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
Something like this.
net/ipv4/arp.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 418862f..9b539fa 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -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;
--
1.5.5.1.570.g26b5e
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] net/ipv4/arp.c: Use the exported hex_asc from lib/hexdump.c instead
2008-05-20 22:40 ` Harvey Harrison
@ 2008-05-20 22:45 ` David Miller
2008-05-21 2:27 ` rae l
0 siblings, 1 reply; 9+ messages in thread
From: David Miller @ 2008-05-20 22:45 UTC (permalink / raw)
To: harvey.harrison; +Cc: crquan, herbert, netdev, linux-kernel
From: Harvey Harrison <harvey.harrison@gmail.com>
Date: Tue, 20 May 2008 15:40:12 -0700
> On Tue, 2008-05-20 at 15:36 -0700, David Miller wrote:
> > From: Denis Cheng <crquan@gmail.com>
> > Date: Mon, 19 May 2008 02:37:44 +0800
> >
> > > 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.
> > >
> > > Signed-off-by: Denis Cheng <crquan@gmail.com>
> >
> > Applied, thanks.
>
> You may want to use the hex_asc_hi, hex_asc_lo helpers to do the
> mask/shifts for you.
Good idea, I'll revert, Denis can you generate a new patch?
Thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] net/ipv4/arp.c: Use the exported hex_asc from lib/hexdump.c instead
2008-05-20 22:45 ` David Miller
@ 2008-05-21 2:27 ` rae l
2008-05-22 0:35 ` David Miller
0 siblings, 1 reply; 9+ messages in thread
From: rae l @ 2008-05-21 2:27 UTC (permalink / raw)
To: David Miller; +Cc: harvey.harrison, herbert, netdev, linux-kernel
>From bc47e710a3ebd8a5989404f711a051b6516d01ed Mon Sep 17 00:00:00 2001
From: Denis Cheng <crquan@gmail.com>
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.
Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
---
net/ipv4/arp.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 418862f..9b539fa 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -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;
--
1.5.4.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] net/ipv4/arp.c: Use the exported hex_asc from lib/hexdump.c instead
2008-05-21 2:27 ` rae l
@ 2008-05-22 0:35 ` David Miller
2008-05-22 0:37 ` Harvey Harrison
0 siblings, 1 reply; 9+ messages in thread
From: David Miller @ 2008-05-22 0:35 UTC (permalink / raw)
To: crquan; +Cc: harvey.harrison, herbert, netdev, linux-kernel
From: "rae l" <crquan@gmail.com>
Date: Wed, 21 May 2008 10:27:41 +0800
> 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.
>
> Signed-off-by: Denis Cheng <crquan@gmail.com>
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] net/ipv4/arp.c: Use the exported hex_asc from lib/hexdump.c instead
2008-05-22 0:35 ` David Miller
@ 2008-05-22 0:37 ` Harvey Harrison
2008-05-22 1:04 ` rae l
0 siblings, 1 reply; 9+ messages in thread
From: Harvey Harrison @ 2008-05-22 0:37 UTC (permalink / raw)
To: David Miller; +Cc: crquan, herbert, netdev, linux-kernel
On Wed, 2008-05-21 at 17:35 -0700, David Miller wrote:
> From: "rae l" <crquan@gmail.com>
> Date: Wed, 21 May 2008 10:27:41 +0800
>
> > 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.
> >
> > Signed-off-by: Denis Cheng <crquan@gmail.com>
> > Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
>
> 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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] net/ipv4/arp.c: Use the exported hex_asc from lib/hexdump.c instead
2008-05-22 0:37 ` Harvey Harrison
@ 2008-05-22 1:04 ` rae l
0 siblings, 0 replies; 9+ messages in thread
From: rae l @ 2008-05-22 1:04 UTC (permalink / raw)
To: Harvey Harrison; +Cc: David Miller, netdev
On Thu, May 22, 2008 at 8:37 AM, Harvey Harrison
<harvey.harrison@gmail.com> wrote:
>> 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. :-)
>
> Harvey
--
Denis
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-05-22 1:04 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-18 18:37 [PATCH] net/ipv4/arp.c: Use the exported hex_asc from lib/hexdump.c instead Denis Cheng
2008-05-20 22:36 ` David Miller
2008-05-20 22:40 ` Harvey Harrison
2008-05-20 22:45 ` David Miller
2008-05-21 2:27 ` rae l
2008-05-22 0:35 ` David Miller
2008-05-22 0:37 ` Harvey Harrison
2008-05-22 1:04 ` rae l
2008-05-20 22:41 ` Harvey Harrison
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).