Commit 6a0ed91e authored by Artem Bityutskiy's avatar Artem Bityutskiy Committed by Linus Torvalds

hexdump: use const notation

Trivial fix: mark the buffer to hexdump as const so callers could avoid
casting their const buffers when calling print_hex_dump().

The patch is really trivial and I suggest to consider it as a fix
(it fixes GCC warnings) and push it to current tree.
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 660ca531
...@@ -224,7 +224,7 @@ extern void hex_dump_to_buffer(const void *buf, size_t len, ...@@ -224,7 +224,7 @@ extern void hex_dump_to_buffer(const void *buf, size_t len,
char *linebuf, size_t linebuflen, bool ascii); char *linebuf, size_t linebuflen, bool ascii);
extern void print_hex_dump(const char *level, const char *prefix_str, extern void print_hex_dump(const char *level, const char *prefix_str,
int prefix_type, int rowsize, int groupsize, int prefix_type, int rowsize, int groupsize,
void *buf, size_t len, bool ascii); const void *buf, size_t len, bool ascii);
extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
void *buf, size_t len); void *buf, size_t len);
#define hex_asc(x) "0123456789abcdef"[x] #define hex_asc(x) "0123456789abcdef"[x]
......
...@@ -145,9 +145,9 @@ EXPORT_SYMBOL(hex_dump_to_buffer); ...@@ -145,9 +145,9 @@ EXPORT_SYMBOL(hex_dump_to_buffer);
*/ */
void print_hex_dump(const char *level, const char *prefix_str, int prefix_type, void print_hex_dump(const char *level, const char *prefix_str, int prefix_type,
int rowsize, int groupsize, int rowsize, int groupsize,
void *buf, size_t len, bool ascii) const void *buf, size_t len, bool ascii)
{ {
u8 *ptr = buf; const u8 *ptr = buf;
int i, linelen, remaining = len; int i, linelen, remaining = len;
unsigned char linebuf[200]; unsigned char linebuf[200];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment