Skip to contentSkip to conversation

isdn: use the common ascii hex helpers

PATCH In review Harvey Harrison 2 participants 2 messages May 2, 2008 – May 7, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 11/12 isdn: use the common ascii hex helpers

---
 drivers/isdn/gigaset/isocdata.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/isdn/gigaset/isocdata.c +2 -3
index e30a777..fbce522 100644
@@ -247,7 +247,6 @@ static inline void dump_bytes(enum debuglevel level, const char *tag,
 #ifdef CONFIG_GIGASET_DEBUG
 	unsigned char c;
 	static char dbgline[3 * 32 + 1];
-	static const char hexdigit[] = "0123456789abcdef";
 	int i = 0;
 	while (count-- > 0) {
 		if (i > sizeof(dbgline) - 4) {
@@ -258,8 +257,8 @@ static inline void dump_bytes(enum debuglevel level, const char *tag,
 		c = *bytes++;
 		dbgline[i] = (i && !(i % 12)) ? '-' : ' ';
 		i++;
-		dbgline[i++] = hexdigit[(c >> 4) & 0x0f];
-		dbgline[i++] = hexdigit[c & 0x0f];
+		dbgline[i++] = hex_asc_hi(c);
+		dbgline[i++] = hex_asc_lo(c);
 	}
 	dbgline[i] = '\0';
 	gig_dbg(level, "%s:%s", tag, dbgline);
Signature · 1 line
1.5.5.1.350.gbbbf
Acked-by on v1 11/12
#1 lore raw
Quoted 1 line · Harvey Harrison

Thanks,
Tilman

Quoted 27 lines
---
 drivers/isdn/gigaset/isocdata.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/isdn/gigaset/isocdata.c +2 -3
index e30a777..fbce522 100644
@@ -247,7 +247,6 @@ static inline void dump_bytes(enum debuglevel level, const char *tag,
 #ifdef CONFIG_GIGASET_DEBUG
 	unsigned char c;
 	static char dbgline[3 * 32 + 1];
-	static const char hexdigit[] = "0123456789abcdef";
 	int i = 0;
 	while (count-- > 0) {
 		if (i > sizeof(dbgline) - 4) {
@@ -258,8 +257,8 @@ static inline void dump_bytes(enum debuglevel level, const char *tag,
 		c = *bytes++;
 		dbgline[i] = (i && !(i % 12)) ? '-' : ' ';
 		i++;
-		dbgline[i++] = hexdigit[(c >> 4) & 0x0f];
-		dbgline[i++] = hexdigit[c & 0x0f];
+		dbgline[i++] = hex_asc_hi(c);
+		dbgline[i++] = hex_asc_lo(c);
 	}
 	dbgline[i] = '\0';
 	gig_dbg(level, "%s:%s", tag, dbgline);