Re: [PATCH] trivial warning fix and whitespace cleanup forarch/i386/boot/compressed/misc.c
From: Jesper Juhl
Date: Thu Jun 16 2005 - 13:21:49 EST
On Thu, 16 Jun 2005, Martin Mares wrote:
> > Here's a trivial patch to fix two tiny gcc -W warnings:
>
> Fine with me. You can also remove the surplus (char *) casts.
>
How about this?
Signed-off-by: Jesper Juhl <juhl-lkml@xxxxxx>
---
arch/i386/boot/compressed/misc.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
--- linux-2.6.12-rc6-mm1-orig/arch/i386/boot/compressed/misc.c 2005-06-12 15:58:34.000000000 +0200
+++ linux-2.6.12-rc6-mm1/arch/i386/boot/compressed/misc.c 2005-06-16 20:16:27.000000000 +0200
@@ -205,22 +205,24 @@ static void putstr(const char *s)
outb_p(0xff & (pos >> 1), vidport+1);
}
-static void* memset(void* s, int c, size_t n)
+static void *memset(void *s, int c, size_t n)
{
- int i;
- char *ss = (char*)s;
+ size_t i;
+ char *ss = s;
- for (i=0;i<n;i++) ss[i] = c;
+ for (i = 0; i < n; i++)
+ ss[i] = c;
return s;
}
-static void* memcpy(void* __dest, __const void* __src,
+static void *memcpy(void *__dest, __const void *__src,
size_t __n)
{
- int i;
- char *d = (char *)__dest, *s = (char *)__src;
+ size_t i;
+ char *d = __dest, *s = __src;
- for (i=0;i<__n;i++) d[i] = s[i];
+ for (i = 0; i < __n; i++)
+ d[i] = s[i];
return __dest;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/