[PATCH] v850: Get rid of lvalue-casts in memset.c to make gcc happy

From: Miles Bader
Date: Mon Jul 05 2004 - 04:39:18 EST


Signed-off-by: Miles Bader <miles@xxxxxxx>

arch/v850/lib/memset.c | 25 ++++++++++++++++---------
1 files changed, 16 insertions(+), 9 deletions(-)

diff -ruN -X../cludes linux-2.6.7-uc0/arch/v850/lib/memset.c linux-2.6.7-uc0-v850-20040705/arch/v850/lib/memset.c
--- linux-2.6.7-uc0/arch/v850/lib/memset.c 2002-11-05 11:25:22.000000000 +0900
+++ linux-2.6.7-uc0-v850-20040705/arch/v850/lib/memset.c 2004-07-05 18:20:43.000000000 +0900
@@ -1,8 +1,8 @@
/*
* arch/v850/lib/memset.c -- Memory initialization
*
- * Copyright (C) 2001,02 NEC Corporation
- * Copyright (C) 2001,02 Miles Bader <miles@xxxxxxx>
+ * Copyright (C) 2001,02,04 NEC Corporation
+ * Copyright (C) 2001,02,04 Miles Bader <miles@xxxxxxx>
*
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file COPYING in the main directory of this
@@ -26,11 +26,13 @@

/* copy initial unaligned bytes. */
if ((long)ptr & 1) {
- *((char *)ptr)++ = val;
+ *(char *)ptr = val;
+ ptr = (void *)((char *)ptr + 1);
count--;
}
if (count > 2 && ((long)ptr & 2)) {
- *((short *)ptr)++ = val;
+ *(short *)ptr = val;
+ ptr = (void *)((short *)ptr + 1);
count -= 2;
}

@@ -46,15 +48,20 @@
count %= 32;

/* long copying loop. */
- for (loop = count / 4; loop; loop--)
- *((long *)ptr)++ = val;
+ for (loop = count / 4; loop; loop--) {
+ *(long *)ptr = val;
+ ptr = (void *)((long *)ptr + 1);
+ }
count %= 4;

/* finish up with any trailing bytes. */
- if (count & 2)
- *((short *)ptr)++ = val;
- if (count & 1)
+ if (count & 2) {
+ *(short *)ptr = val;
+ ptr = (void *)((short *)ptr + 1);
+ }
+ if (count & 1) {
*(char *)ptr = val;
+ }
}

return dst;
-
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/