From: Harvey Harrison <harvey.harrison@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: crquan@gmail.com, herbert@gondor.apana.org.au,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net/ipv4/arp.c: Use the exported hex_asc from lib/hexdump.c instead
Date: Tue, 20 May 2008 15:41:59 -0700 [thread overview]
Message-ID: <1211323319.5915.223.camel@brick> (raw)
In-Reply-To: <20080520.153611.204837174.davem@davemloft.net>
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
prev parent reply other threads:[~2008-05-20 22:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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-20 22:41 ` Harvey Harrison [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1211323319.5915.223.camel@brick \
--to=harvey.harrison@gmail.com \
--cc=crquan@gmail.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.