Skip to content

Commit

Permalink
hexdump: use const notation
Browse files Browse the repository at this point in the history
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: Artem Bityutskiy <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Artem Bityutskiy authored and Linus Torvalds committed Aug 9, 2007
1 parent 660ca53 commit 6a0ed91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ extern void hex_dump_to_buffer(const void *buf, size_t len,
char *linebuf, size_t linebuflen, bool ascii);
extern void print_hex_dump(const char *level, const char *prefix_str,
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,
void *buf, size_t len);
#define hex_asc(x) "0123456789abcdef"[x]
Expand Down
4 changes: 2 additions & 2 deletions lib/hexdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ EXPORT_SYMBOL(hex_dump_to_buffer);
*/
void print_hex_dump(const char *level, const char *prefix_str, int prefix_type,
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;
unsigned char linebuf[200];

Expand Down

0 comments on commit 6a0ed91

Please sign in to comment.