Skip to content

Commit

Permalink
[PATCH] lib/string.c cleanup: restore useful memmove const
Browse files Browse the repository at this point in the history
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]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Paul Jackson authored and Linus Torvalds committed Oct 31, 2005
1 parent 5d57bd3 commit 82da2c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 82da2c3

Please sign in to comment.