Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198305
b: refs/heads/master
c: 9037888
h: refs/heads/master
i:
  198303: 72850b2
v: v3
  • Loading branch information
Andy Shevchenko authored and Linus Torvalds committed May 25, 2010
1 parent f9f8d44 commit 91fee7a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: db0fd97c270f1e80321f7ae55234643ca0978c54
refs/heads/master: 903788892ea0fc7fcaf7e8e5fac9a77379fc215b
2 changes: 2 additions & 0 deletions trunk/include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,8 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
return buf;
}

extern int hex_to_bin(char ch);

#ifndef pr_fmt
#define pr_fmt(fmt) fmt
#endif
Expand Down
18 changes: 18 additions & 0 deletions trunk/lib/hexdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,24 @@
const char hex_asc[] = "0123456789abcdef";
EXPORT_SYMBOL(hex_asc);

/**
* hex_to_bin - convert a hex digit to its real value
* @ch: ascii character represents hex digit
*
* hex_to_bin() converts one hex digit to its actual value or -1 in case of bad
* input.
*/
int hex_to_bin(char ch)
{
if ((ch >= '0') && (ch <= '9'))
return ch - '0';
ch = tolower(ch);
if ((ch >= 'a') && (ch <= 'f'))
return ch - 'a' + 10;
return -1;
}
EXPORT_SYMBOL(hex_to_bin);

/**
* hex_dump_to_buffer - convert a blob of data to "hex ASCII" in memory
* @buf: data blob to dump
Expand Down

0 comments on commit 91fee7a

Please sign in to comment.