OSDN Git Service

[GCC4] fix build error in arch/alpha/lib/io.c
authorWilly Tarreau <w@1wt.eu>
Sun, 5 Nov 2006 17:09:33 +0000 (18:09 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 19 Nov 2006 17:02:10 +0000 (18:02 +0100)
This patch fixes this error with gcc 4 on alpha :

gcc-4.1 -D__KERNEL__ -I/data/git/public/linux-2.4/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fno-builtin-sprintf -fomit-frame-pointer -Wno-pointer-sign -pipe -mno-fp-regs -ffixed-8 -mcpu=ev6 -Wa,-mev6   -nostdinc -iwithprefix include -DKBUILD_BASENAME=io  -c -o io.o io.c
io.c: In function 'insb':
io.c:146: error: invalid lvalue in increment
io.c:157: error: invalid lvalue in increment
io.c:163: error: invalid lvalue in increment
io.c: In function 'insw':
io.c:185: error: invalid lvalue in increment
io.c:194: error: invalid lvalue in increment
io.c: In function 'insl':
io.c:222: error: invalid lvalue in increment
io.c:233: error: invalid lvalue in increment
io.c:239: error: invalid lvalue in increment
io.c:249: error: invalid lvalue in increment
io.c:251: error: invalid lvalue in increment
io.c:256: error: invalid lvalue in increment
io.c:266: error: invalid lvalue in increment
io.c:271: error: invalid lvalue in increment
io.c:275: error: invalid lvalue in increment
io.c: In function 'outsb':
io.c:293: error: invalid lvalue in increment
io.c: In function 'outsw':
io.c:310: error: invalid lvalue in increment
io.c:318: error: invalid lvalue in increment
io.c: In function 'outsl':
io.c:348: error: invalid lvalue in increment
io.c:358: error: invalid lvalue in increment
io.c:363: error: invalid lvalue in increment
io.c:374: error: invalid lvalue in increment
io.c:376: error: invalid lvalue in increment
io.c:380: error: invalid lvalue in increment
io.c:391: error: invalid lvalue in increment
io.c:395: error: invalid lvalue in increment
io.c:400: error: invalid lvalue in increment

arch/alpha/lib/io.c

index 46e7892..e6f2698 100644 (file)
@@ -143,7 +143,7 @@ void insb (unsigned long port, void *dst, unsigned long count)
                        return;
                count--;
                *(unsigned char *) dst = inb(port);
-               ((unsigned char *) dst)++;
+               dst = (unsigned char *)dst + 1;
        }
 
        while (count >= 4) {
@@ -154,13 +154,13 @@ void insb (unsigned long port, void *dst, unsigned long count)
                w |= inb(port) << 16;
                w |= inb(port) << 24;
                *(unsigned int *) dst = w;
-               ((unsigned int *) dst)++;
+               dst = (unsigned int *)dst + 1;
        }
 
        while (count) {
                --count;
                *(unsigned char *) dst = inb(port);
-               ((unsigned char *) dst)++;
+               dst = (unsigned char *)dst + 1;
        }
 }
 
@@ -182,7 +182,7 @@ void insw (unsigned long port, void *dst, unsigned long count)
                        return;
                count--;
                *(unsigned short* ) dst = inw(port);
-               ((unsigned short *) dst)++;
+               dst = (unsigned short *)dst + 1;
        }
 
        while (count >= 2) {
@@ -191,7 +191,7 @@ void insw (unsigned long port, void *dst, unsigned long count)
                w = inw(port);
                w |= inw(port) << 16;
                *(unsigned int *) dst = w;
-               ((unsigned int *) dst)++;
+               dst = (unsigned int *)dst + 1;
        }
 
        if (count) {
@@ -219,7 +219,7 @@ void insl (unsigned long port, void *dst, unsigned long count)
                while (count--)
                {
                        *(unsigned int *) dst = inl(port);
-                       ((unsigned int *) dst)++;
+                       dst = (unsigned int *)dst + 1;
                }
                break;
        
@@ -230,13 +230,13 @@ void insl (unsigned long port, void *dst, unsigned long count)
                
                l = inl(port);
                *(unsigned short *) dst = l;
-               ((unsigned short *) dst)++;
+               dst = (unsigned short *)dst + 1;
                
                while (count--)
                {
                        l2 = inl(port);
                        *(unsigned int *) dst = l >> 16 | l2 << 16;
-                       ((unsigned int *) dst)++;
+                       dst = (unsigned int *)dst + 1;
                        l = l2;
                }
                *(unsigned short *) dst = l >> 16;
@@ -246,14 +246,14 @@ void insl (unsigned long port, void *dst, unsigned long count)
                
                l = inl(port);
                *(unsigned char *) dst = l;
-               ((unsigned char *) dst)++;
+               dst = (unsigned char *)dst + 1;
                *(unsigned short *) dst = l >> 8;
-               ((unsigned short *) dst)++;
+               dst = (unsigned short *)dst + 1;
                while (count--)
                {
                        l2 = inl(port);
                        *(unsigned int *) dst = l >> 24 | l2 << 8;
-                       ((unsigned int *) dst)++;
+                       dst = (unsigned int *)dst + 1;
                        l = l2;
                }
                *(unsigned char *) dst = l >> 24;
@@ -263,16 +263,16 @@ void insl (unsigned long port, void *dst, unsigned long count)
                
                l = inl(port);
                *(unsigned char *) dst = l;
-               ((unsigned char *) dst)++;
+               dst = (unsigned char *)dst + 1;
                while (count--)
                {
                        l2 = inl(port);
                        *(unsigned int *) dst = l << 24 | l2 >> 8;
-                       ((unsigned int *) dst)++;
+                       dst = (unsigned int *)dst + 1;
                        l = l2;
                }
                *(unsigned short *) dst = l >> 8;
-               ((unsigned short *) dst)++;
+               dst = (unsigned short *)dst + 1;
                *(unsigned char *) dst = l >> 24;
                break;
        }
@@ -290,7 +290,7 @@ void outsb(unsigned long port, const void * src, unsigned long count)
        while (count) {
                count--;
                outb(*(char *)src, port);
-               ((char *) src)++;
+               src = (char *)src + 1;
        }
 }
 
@@ -307,7 +307,7 @@ void outsw (unsigned long port, const void *src, unsigned long count)
                        panic("outsw: memory not short aligned");
                }
                outw(*(unsigned short*)src, port);
-               ((unsigned short *) src)++;
+               src = (unsigned short *)src + 1;
                --count;
        }
 
@@ -315,7 +315,7 @@ void outsw (unsigned long port, const void *src, unsigned long count)
                unsigned int w;
                count -= 2;
                w = *(unsigned int *) src;
-               ((unsigned int *) src)++;
+               src = (unsigned int *)src + 1;
                outw(w >>  0, port);
                outw(w >> 16, port);
        }
@@ -345,7 +345,7 @@ void outsl (unsigned long port, const void *src, unsigned long count)
                while (count--)
                {
                        outl(*(unsigned int *) src, port);
-                       ((unsigned int *) src)++;
+                       src = (unsigned int *)src + 1;
                }
                break;
        
@@ -355,12 +355,12 @@ void outsl (unsigned long port, const void *src, unsigned long count)
                --count;
                
                l = *(unsigned short *) src << 16;
-               ((unsigned short *) src)++;
+               src = (unsigned short *)src + 1;
                
                while (count--)
                {
                        l2 = *(unsigned int *) src;
-                       ((unsigned int *) src)++;
+                       src = (unsigned int *)src + 1;
                        outl (l >> 16 | l2 << 16, port);
                        l = l2;
                }
@@ -371,13 +371,13 @@ void outsl (unsigned long port, const void *src, unsigned long count)
                --count;
                
                l  = *(unsigned char *) src << 8;
-               ((unsigned char *) src)++;
+               src = (unsigned char *)src + 1;
                l |= *(unsigned short *) src << 16;
-               ((unsigned short *) src)++;
+               src = (unsigned short *)src + 1;
                while (count--)
                {
                        l2 = *(unsigned int *) src;
-                       ((unsigned int *) src)++;
+                       src = (unsigned int *)src + 1;
                        outl (l >> 8 | l2 << 24, port);
                        l = l2;
                }
@@ -388,16 +388,16 @@ void outsl (unsigned long port, const void *src, unsigned long count)
                --count;
                
                l  = *(unsigned char *) src << 24;
-               ((unsigned char *) src)++;
+               src = (unsigned char *)src + 1;
                while (count--)
                {
                        l2 = *(unsigned int *) src;
-                       ((unsigned int *) src)++;
+                       src = (unsigned int *)src + 1;
                        outl (l >> 24 | l2 << 8, port);
                        l = l2;
                }
                l2  = *(unsigned short *) src;
-               ((unsigned short *) src)++;
+               src = (unsigned short *)src + 1;
                l2 |= *(unsigned char *) src << 16;
                outl (l >> 24 | l2 << 8, port);
                break;