Commit 370d7089 authored by Richard Henderson's avatar Richard Henderson

[ALPHA] Fix gcc 3.4 build problems.

parent 47f766a2
...@@ -131,7 +131,7 @@ osf_filldir(void *__buf, const char *name, int namlen, loff_t offset, ...@@ -131,7 +131,7 @@ osf_filldir(void *__buf, const char *name, int namlen, loff_t offset,
if (copy_to_user(dirent->d_name, name, namlen) || if (copy_to_user(dirent->d_name, name, namlen) ||
put_user(0, dirent->d_name + namlen)) put_user(0, dirent->d_name + namlen))
return -EFAULT; return -EFAULT;
((char *) dirent) += reclen; dirent = (void *)dirent + reclen;
buf->dirent = dirent; buf->dirent = dirent;
buf->count -= reclen; buf->count -= reclen;
return 0; return 0;
......
...@@ -500,7 +500,7 @@ sg_classify(struct scatterlist *sg, struct scatterlist *end, int virt_ok) ...@@ -500,7 +500,7 @@ sg_classify(struct scatterlist *sg, struct scatterlist *end, int virt_ok)
/* Given a scatterlist leader, choose an allocation method and fill /* Given a scatterlist leader, choose an allocation method and fill
in the blanks. */ in the blanks. */
static inline int static int
sg_fill(struct scatterlist *leader, struct scatterlist *end, sg_fill(struct scatterlist *leader, struct scatterlist *end,
struct scatterlist *out, struct pci_iommu_arena *arena, struct scatterlist *out, struct pci_iommu_arena *arena,
dma_addr_t max_dma, int dac_allowed) dma_addr_t max_dma, int dac_allowed)
......
...@@ -203,9 +203,9 @@ extern struct mcheck_info ...@@ -203,9 +203,9 @@ extern struct mcheck_info
unsigned char extra; unsigned char extra;
} __mcheck_info; } __mcheck_info;
#define mcheck_expected(cpu) ((void)(cpu), __mcheck_info.expected) #define mcheck_expected(cpu) (*((void)(cpu), &__mcheck_info.expected))
#define mcheck_taken(cpu) ((void)(cpu), __mcheck_info.taken) #define mcheck_taken(cpu) (*((void)(cpu), &__mcheck_info.taken))
#define mcheck_extra(cpu) ((void)(cpu), __mcheck_info.extra) #define mcheck_extra(cpu) (*((void)(cpu), &__mcheck_info.extra))
#endif #endif
extern void process_mcheck_info(unsigned long vector, unsigned long la_ptr, extern void process_mcheck_info(unsigned long vector, unsigned long la_ptr,
......
...@@ -143,7 +143,7 @@ void insb (unsigned long port, void *dst, unsigned long count) ...@@ -143,7 +143,7 @@ void insb (unsigned long port, void *dst, unsigned long count)
return; return;
count--; count--;
*(unsigned char *) dst = inb(port); *(unsigned char *) dst = inb(port);
((unsigned char *) dst)++; dst += 1;
} }
while (count >= 4) { while (count >= 4) {
...@@ -154,13 +154,13 @@ void insb (unsigned long port, void *dst, unsigned long count) ...@@ -154,13 +154,13 @@ void insb (unsigned long port, void *dst, unsigned long count)
w |= inb(port) << 16; w |= inb(port) << 16;
w |= inb(port) << 24; w |= inb(port) << 24;
*(unsigned int *) dst = w; *(unsigned int *) dst = w;
((unsigned int *) dst)++; dst += 4;
} }
while (count) { while (count) {
--count; --count;
*(unsigned char *) dst = inb(port); *(unsigned char *) dst = inb(port);
((unsigned char *) dst)++; dst += 1;
} }
} }
...@@ -181,8 +181,8 @@ void insw (unsigned long port, void *dst, unsigned long count) ...@@ -181,8 +181,8 @@ void insw (unsigned long port, void *dst, unsigned long count)
if (!count) if (!count)
return; return;
count--; count--;
*(unsigned short* ) dst = inw(port); *(unsigned short *) dst = inw(port);
((unsigned short *) dst)++; dst += 2;
} }
while (count >= 2) { while (count >= 2) {
...@@ -191,7 +191,7 @@ void insw (unsigned long port, void *dst, unsigned long count) ...@@ -191,7 +191,7 @@ void insw (unsigned long port, void *dst, unsigned long count)
w = inw(port); w = inw(port);
w |= inw(port) << 16; w |= inw(port) << 16;
*(unsigned int *) dst = w; *(unsigned int *) dst = w;
((unsigned int *) dst)++; dst += 4;
} }
if (count) { if (count) {
...@@ -219,7 +219,7 @@ void insl (unsigned long port, void *dst, unsigned long count) ...@@ -219,7 +219,7 @@ void insl (unsigned long port, void *dst, unsigned long count)
while (count--) while (count--)
{ {
*(unsigned int *) dst = inl(port); *(unsigned int *) dst = inl(port);
((unsigned int *) dst)++; dst += 4;
} }
break; break;
...@@ -230,49 +230,51 @@ void insl (unsigned long port, void *dst, unsigned long count) ...@@ -230,49 +230,51 @@ void insl (unsigned long port, void *dst, unsigned long count)
l = inl(port); l = inl(port);
*(unsigned short *) dst = l; *(unsigned short *) dst = l;
((unsigned short *) dst)++; dst += 2;
while (count--) while (count--)
{ {
l2 = inl(port); l2 = inl(port);
*(unsigned int *) dst = l >> 16 | l2 << 16; *(unsigned int *) dst = l >> 16 | l2 << 16;
((unsigned int *) dst)++; dst += 4;
l = l2; l = l2;
} }
*(unsigned short *) dst = l >> 16; *(unsigned short *) dst = l >> 16;
break; break;
case 0x01: /* Buffer 8-bit aligned */ case 0x01: /* Buffer 8-bit aligned */
--count; --count;
l = inl(port); l = inl(port);
*(unsigned char *) dst = l; *(unsigned char *) dst = l;
((unsigned char *) dst)++; dst += 1;
*(unsigned short *) dst = l >> 8; *(unsigned short *) dst = l >> 8;
((unsigned short *) dst)++; dst += 2;
while (count--) while (count--)
{ {
l2 = inl(port); l2 = inl(port);
*(unsigned int *) dst = l >> 24 | l2 << 8; *(unsigned int *) dst = l >> 24 | l2 << 8;
((unsigned int *) dst)++; dst += 4;
l = l2; l = l2;
} }
*(unsigned char *) dst = l >> 24; *(unsigned char *) dst = l >> 24;
break; break;
case 0x03: /* Buffer 8-bit aligned */ case 0x03: /* Buffer 8-bit aligned */
--count; --count;
l = inl(port); l = inl(port);
*(unsigned char *) dst = l; *(unsigned char *) dst = l;
((unsigned char *) dst)++; dst += 1;
while (count--) while (count--)
{ {
l2 = inl(port); l2 = inl(port);
*(unsigned int *) dst = l << 24 | l2 >> 8; *(unsigned int *) dst = l << 24 | l2 >> 8;
((unsigned int *) dst)++; dst += 4;
l = l2; l = l2;
} }
*(unsigned short *) dst = l >> 8; *(unsigned short *) dst = l >> 8;
((unsigned short *) dst)++; dst += 2;
*(unsigned char *) dst = l >> 24; *(unsigned char *) dst = l >> 24;
break; break;
} }
...@@ -290,7 +292,7 @@ void outsb(unsigned long port, const void * src, unsigned long count) ...@@ -290,7 +292,7 @@ void outsb(unsigned long port, const void * src, unsigned long count)
while (count) { while (count) {
count--; count--;
outb(*(char *)src, port); outb(*(char *)src, port);
((char *) src)++; src += 1;
} }
} }
...@@ -307,7 +309,7 @@ void outsw (unsigned long port, const void *src, unsigned long count) ...@@ -307,7 +309,7 @@ void outsw (unsigned long port, const void *src, unsigned long count)
panic("outsw: memory not short aligned"); panic("outsw: memory not short aligned");
} }
outw(*(unsigned short*)src, port); outw(*(unsigned short*)src, port);
((unsigned short *) src)++; src += 2;
--count; --count;
} }
...@@ -315,7 +317,7 @@ void outsw (unsigned long port, const void *src, unsigned long count) ...@@ -315,7 +317,7 @@ void outsw (unsigned long port, const void *src, unsigned long count)
unsigned int w; unsigned int w;
count -= 2; count -= 2;
w = *(unsigned int *) src; w = *(unsigned int *) src;
((unsigned int *) src)++; src += 4;
outw(w >> 0, port); outw(w >> 0, port);
outw(w >> 16, port); outw(w >> 16, port);
} }
...@@ -345,59 +347,59 @@ void outsl (unsigned long port, const void *src, unsigned long count) ...@@ -345,59 +347,59 @@ void outsl (unsigned long port, const void *src, unsigned long count)
while (count--) while (count--)
{ {
outl(*(unsigned int *) src, port); outl(*(unsigned int *) src, port);
((unsigned int *) src)++; src += 4;
} }
break; break;
/* Assuming little endian Alphas in cases 0x01 -- 0x03 ... */
case 0x02: /* Buffer 16-bit aligned */ case 0x02: /* Buffer 16-bit aligned */
--count; --count;
l = *(unsigned short *) src << 16; l = *(unsigned short *) src << 16;
((unsigned short *) src)++; src += 2;
while (count--) while (count--)
{ {
l2 = *(unsigned int *) src; l2 = *(unsigned int *) src;
((unsigned int *) src)++; src += 4;
outl (l >> 16 | l2 << 16, port); outl (l >> 16 | l2 << 16, port);
l = l2; l = l2;
} }
l2 = *(unsigned short *) src; l2 = *(unsigned short *) src;
outl (l >> 16 | l2 << 16, port); outl (l >> 16 | l2 << 16, port);
break; break;
case 0x01: /* Buffer 8-bit aligned */ case 0x01: /* Buffer 8-bit aligned */
--count; --count;
l = *(unsigned char *) src << 8; l = *(unsigned char *) src << 8;
((unsigned char *) src)++; src += 1;
l |= *(unsigned short *) src << 16; l |= *(unsigned short *) src << 16;
((unsigned short *) src)++; src += 2;
while (count--) while (count--)
{ {
l2 = *(unsigned int *) src; l2 = *(unsigned int *) src;
((unsigned int *) src)++; src += 4;
outl (l >> 8 | l2 << 24, port); outl (l >> 8 | l2 << 24, port);
l = l2; l = l2;
} }
l2 = *(unsigned char *) src; l2 = *(unsigned char *) src;
outl (l >> 8 | l2 << 24, port); outl (l >> 8 | l2 << 24, port);
break; break;
case 0x03: /* Buffer 8-bit aligned */ case 0x03: /* Buffer 8-bit aligned */
--count; --count;
l = *(unsigned char *) src << 24; l = *(unsigned char *) src << 24;
((unsigned char *) src)++; src += 1;
while (count--) while (count--)
{ {
l2 = *(unsigned int *) src; l2 = *(unsigned int *) src;
((unsigned int *) src)++; src += 4;
outl (l >> 24 | l2 << 8, port); outl (l >> 24 | l2 << 8, port);
l = l2; l = l2;
} }
l2 = *(unsigned short *) src; l2 = *(unsigned short *) src;
((unsigned short *) src)++; src += 2;
l2 |= *(unsigned char *) src << 16; l2 |= *(unsigned char *) src << 16;
outl (l >> 24 | l2 << 8, port); outl (l >> 24 | l2 << 8, port);
break; break;
......
...@@ -573,9 +573,9 @@ static inline off_t lseek(int fd, off_t off, int whence) ...@@ -573,9 +573,9 @@ static inline off_t lseek(int fd, off_t off, int whence)
return sys_lseek(fd, off, whence); return sys_lseek(fd, off, whence);
} }
static inline long _exit(int value) static inline void _exit(int value)
{ {
return sys_exit(value); sys_exit(value);
} }
#define exit(x) _exit(x) #define exit(x) _exit(x)
......
...@@ -16,7 +16,7 @@ static void __init error(char *x) ...@@ -16,7 +16,7 @@ static void __init error(char *x)
message = x; message = x;
} }
static void __init *malloc(int size) static void __init *malloc(size_t size)
{ {
return kmalloc(size, GFP_KERNEL); return kmalloc(size, GFP_KERNEL);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment