]> err.no Git - linux-2.6/commitdiff
[PATCH] lib/string.c cleanup: restore useful memmove const
authorPaul Jackson <pj@sgi.com>
Sun, 30 Oct 2005 23:03:19 +0000 (15:03 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 31 Oct 2005 01:37:27 +0000 (17:37 -0800)
A couple of (char *) casts removed in a previous cleanup patch in
lib/string.c:memmove() were actually useful, as they suppressed a couple of
warnings:

assignment discards qualifiers from pointer target type

Fix by declaring the local variable const in the first place, so casts
aren't needed to strip the const qualifier.

Signed-off-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
lib/string.c

index d7a5ff9b81eaa287a605f59602ea9eb3fdfcef95..037a48acedbb21aae00269c87ef9f1821fb1bb67 100644 (file)
@@ -488,7 +488,8 @@ EXPORT_SYMBOL(memcpy);
  */
 void *memmove(void *dest, const void *src, size_t count)
 {
-       char *tmp, *s;
+       char *tmp;
+       const char *s;
 
        if (dest <= src) {
                tmp = dest;