[PATCH] lib stringc cleanup restore useful memmove const

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>

---

 lib/string.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

--- 2.6.14-rc4-mm1-cpuset-patches.orig/lib/string.c	2005-10-17 23:01:05.974858400 -0700
+++ 2.6.14-rc4-mm1-cpuset-patches/lib/string.c	2005-10-25 06:49:42.921723168 -0700
@@ -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;

-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <[email protected]> 1.650.933.1373
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux