lkml.org 
[lkml]   [2005]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] trivial warning fix and whitespace cleanup for arch/i386/boot/compressed/misc.c
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@dif.dk>
---

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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-06-16 20:24    [W:0.199 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site