[PATCH][2.4.28-pre3] pcmcia mem_op.h gcc-3.4 fixes

From: Mikael Pettersson
Date: Sun Sep 12 2004 - 06:32:39 EST


This patch fixes gcc-3.4 cast-as-lvalue warnings in the 2.4.28-pre3
kernel caused by include/pcmcia/mem_op.h. The changes are all
backports from the 2.6 kernel.

/Mikael

--- linux-2.4.28-pre3/include/pcmcia/mem_op.h.~1~ 2001-02-22 15:23:49.000000000 +0100
+++ linux-2.4.28-pre3/include/pcmcia/mem_op.h 2004-09-12 01:56:20.000000000 +0200
@@ -81,7 +81,9 @@
n -= odd;
while (n) {
*(u_short *)to = __raw_readw(from);
- (char *)to += 2; (char *)from += 2; n -= 2;
+ to = (void *)((long)to + 2);
+ from = (const void *)((long)from + 2);
+ n -= 2;
}
if (odd)
*(u_char *)to = readb(from);
@@ -93,7 +95,9 @@
n -= odd;
while (n) {
__raw_writew(*(u_short *)from, to);
- (char *)to += 2; (char *)from += 2; n -= 2;
+ to = (void *)((long)to + 2);
+ from = (const void *)((long)from + 2);
+ n -= 2;
}
if (odd)
writeb(*(u_char *)from, to);
@@ -105,7 +109,9 @@
n -= odd;
while (n) {
put_user(__raw_readw(from), (short *)to);
- (char *)to += 2; (char *)from += 2; n -= 2;
+ to = (void *)((long)to + 2);
+ from = (const void *)((long)from + 2);
+ n -= 2;
}
if (odd)
put_user(readb(from), (char *)to);
@@ -120,7 +126,9 @@
while (n) {
get_user(s, (short *)from);
__raw_writew(s, to);
- (char *)to += 2; (char *)from += 2; n -= 2;
+ to = (void *)((long)to + 2);
+ from = (const void *)((long)from + 2);
+ n -= 2;
}
if (odd) {
get_user(c, (char *)from);
-
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/