]> err.no Git - linux-2.6/commitdiff
hexdump: use const notation
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 7 Aug 2007 20:43:14 +0000 (23:43 +0300)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 9 Aug 2007 15:34:23 +0000 (08:34 -0700)
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 <Artem.Bityutskiy@nokia.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/kernel.h
lib/hexdump.c

index 4300bb462d29b8bac102ff2f6c898d22ed8b0386..b4f5b81b425705e4b348f26c5ee49dba08af4a41 100644 (file)
@@ -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]
index 473f5aed6caeebe88e813429a6e690e3c4ba42c9..16f2e2935e87163331290f132d0db92075660acf 100644 (file)
@@ -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];