mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] lib stringc cleanup restore useful memmove const
@ 2005-10-25 14:16 Paul Jackson
  2005-10-25 17:47 ` Jesper Juhl
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Jackson @ 2005-10-25 14:16 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Paul Jackson, linux-kernel, Jesper Juhl

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>

---

 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 <pj@sgi.com> 1.650.933.1373

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] lib stringc cleanup restore useful memmove const
  2005-10-25 14:16 [PATCH] lib stringc cleanup restore useful memmove const Paul Jackson
@ 2005-10-25 17:47 ` Jesper Juhl
  0 siblings, 0 replies; 2+ messages in thread
From: Jesper Juhl @ 2005-10-25 17:47 UTC (permalink / raw)
  To: Paul Jackson; +Cc: Andrew Morton, linux-kernel

On 10/25/05, Paul Jackson <pj@sgi.com> wrote:
> 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:
>
Hmm, you are right, I shouldn't have missed that, my bad.


>         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.
>
Looks good to me, thank you for fixing that up.


> Signed-off-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>


--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-10-25 17:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-25 14:16 [PATCH] lib stringc cleanup restore useful memmove const Paul Jackson
2005-10-25 17:47 ` Jesper Juhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome