]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix more gcc 3.4 warnings
authorAndrew Morton <akpm@osdl.org>
Wed, 4 Feb 2004 02:32:27 +0000 (18:32 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Wed, 4 Feb 2004 02:32:27 +0000 (18:32 -0800)
From: Andi Kleen <ak@muc.de>

Just many more warning fixes for a gcc 3.4 snapshot.

It warns for a lot of things now, e.g.  for ?: and ({ ...  }) and casts as
lvalues.  And for functions marked inline in headers, but no body.

Actually there are more warnings, i stopped fixing at some point.  Some of
the warnings seem to be dubious (e.g.  the binfmt_elf.c one, which looks
more like a compiler bug to me)

I also fixed the _exit() prototype to be void because gcc was complaining
about this.

12 files changed:
drivers/ieee1394/highlevel.c
fs/compat_ioctl.c
fs/ext3/namei.c
fs/readdir.c
include/asm-i386/apic.h
include/asm-i386/hw_irq.h
include/asm-i386/unistd.h
include/linux/efi.h
include/linux/reiserfs_fs.h
include/linux/sched.h
kernel/fork.c
lib/crc32.c

index 77c3623c00ce816fe6c7c0a35fd7ba406a9b0a3d..f28c339d6267112c1976aad0c599eecfc10e1e93 100644 (file)
@@ -521,7 +521,7 @@ int highlevel_read(struct hpsb_host *host, int nodeid, void *data,
                                 rcode = RCODE_TYPE_ERROR;
                         }
 
-                       (u8 *)data += partlength;
+                       data += partlength;
                         length -= partlength;
                         addr += partlength;
 
@@ -567,7 +567,7 @@ int highlevel_write(struct hpsb_host *host, int nodeid, int destid,
                                 rcode = RCODE_TYPE_ERROR;
                         }
 
-                       (u8 *)data += partlength;
+                       data += partlength;
                         length -= partlength;
                         addr += partlength;
 
index b2048a804995d793bee23d4787e0cc745e5cb5ac..a6c74193ba609d5125e02d64784a08942958f0f7 100644 (file)
@@ -2112,6 +2112,7 @@ static int fd_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
                case FDDEFPRM32:
                case FDGETPRM32:
                {
+                       compat_uptr_t name;
                        struct floppy_struct32 *uf;
                        struct floppy_struct *f;
 
@@ -2130,7 +2131,8 @@ static int fd_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
                        err |= __get_user(f->rate, &uf->rate);
                        err |= __get_user(f->spec1, &uf->spec1);
                        err |= __get_user(f->fmt_gap, &uf->fmt_gap);
-                       err |= __get_user((u64)f->name, &uf->name);
+                       err |= __get_user(name, &uf->name);
+                       f->name = compat_ptr(name);
                        if (err) {
                                err = -EFAULT;
                                goto out;
index 5e48b9099cdb7a2a21d73841a15cad375b6343b1..6785c378d1be54079573a53585124b9194679b3b 100644 (file)
@@ -1311,7 +1311,7 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
        memcpy (data1, de, len);
        de = (struct ext3_dir_entry_2 *) data1;
        top = data1 + len;
-       while (((char *) de2=(char*)de+le16_to_cpu(de->rec_len)) < top)
+       while ((char *)(de2=(void*)de+le16_to_cpu(de->rec_len)) < top)
                de = de2;
        de->rec_len = cpu_to_le16(data1 + blocksize - (char *) de);
        /* Initialize the root; the dot dirents already exist */
index f9cd0419bf5e89a674f9ef8287c73f35e094def6..3aff6efbf3571274fd62c4674e884a7c80bb002c 100644 (file)
@@ -159,7 +159,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
        if (__put_user(0, dirent->d_name + namlen))
                goto efault;
        buf->previous = dirent;
-       ((char *) dirent) += reclen;
+       dirent = (void *)dirent + reclen;
        buf->current_dir = dirent;
        buf->count -= reclen;
        return 0;
@@ -245,7 +245,7 @@ static int filldir64(void * __buf, const char * name, int namlen, loff_t offset,
        if (__put_user(0, dirent->d_name + namlen))
                goto efault;
        buf->previous = dirent;
-       ((char *) dirent) += reclen;
+       dirent = (void *)dirent + reclen;
        buf->current_dir = dirent;
        buf->count -= reclen;
        return 0;
index 42a1dcaf172bcc951104d26fe9da26c660c2c98d..d3054e6fa4bb01f01386d81c0ce02a2ae00d0d7c 100644 (file)
@@ -85,7 +85,7 @@ extern void disable_lapic_nmi_watchdog(void);
 extern void enable_lapic_nmi_watchdog(void);
 extern void disable_timer_nmi_watchdog(void);
 extern void enable_timer_nmi_watchdog(void);
-extern inline void nmi_watchdog_tick (struct pt_regs * regs);
+extern void nmi_watchdog_tick (struct pt_regs * regs);
 extern int APIC_init_uniprocessor (void);
 extern void disable_APIC_timer(void);
 extern void enable_APIC_timer(void);
index 9b3b8bf9e266adcfc6fa3d086728d9c448d7277d..b8166a30fbe105a4b6eac184cc11121024c4f220 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 extern u8 irq_vector[NR_IRQ_VECTORS];
-#define IO_APIC_VECTOR(irq)    ((int)irq_vector[irq])
+#define IO_APIC_VECTOR(irq)    (irq_vector[irq])
 
 extern void (*interrupt[NR_IRQS])(void);
 
index 3adc789060f03e47a9dbb3ffe324c4b799effba7..df3c08986b2d3a758bd6bf8554e9769bbdc4a5c8 100644 (file)
@@ -394,7 +394,7 @@ static inline _syscall1(int,dup,int,fd)
 static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
 static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
 static inline _syscall1(int,close,int,fd)
-static inline _syscall1(int,_exit,int,exitcode)
+static inline _syscall1(void,_exit,int,exitcode)
 static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
 
 #endif
index a1764b1fb10632c5033d6483e470318ca5ec4b3a..b29c8d42178f1c5ce16e92a7b20f21c226adba5f 100644 (file)
@@ -297,8 +297,8 @@ extern u64 efi_mem_attributes (unsigned long phys_addr);
 extern void efi_initialize_iomem_resources(struct resource *code_resource,
                                        struct resource *data_resource);
 extern efi_status_t phys_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc);
-extern inline unsigned long __init efi_get_time(void);
-extern inline int __init efi_set_rtc_mmss(unsigned long nowtime);
+extern unsigned long __init efi_get_time(void);
+extern int __init efi_set_rtc_mmss(unsigned long nowtime);
 extern struct efi_memory_map memmap;
 
 /*
index 32fe6c84b3b6b37a907ca6955f4a73255728e555..3e6c91301407b9c605e64cf7235c07865523884c 100644 (file)
@@ -1781,25 +1781,25 @@ int reiserfs_convert_objectid_map_v1(struct super_block *) ;
 /* stree.c */
 int B_IS_IN_TREE(const struct buffer_head *);
 extern inline void copy_short_key (void * to, const void * from);
-extern inline void copy_item_head(struct item_head * p_v_to, 
+extern void copy_item_head(struct item_head * p_v_to,
                                                                  const struct item_head * p_v_from);
 
 // first key is in cpu form, second - le
-extern inline int comp_keys (const struct key * le_key, 
+extern int comp_keys (const struct key * le_key,
                             const struct cpu_key * cpu_key);
-extern inline int  comp_short_keys (const struct key * le_key, 
+extern int  comp_short_keys (const struct key * le_key,
                                    const struct cpu_key * cpu_key);
-extern inline void le_key2cpu_key (struct cpu_key * to, const struct key * from);
+extern void le_key2cpu_key (struct cpu_key * to, const struct key * from);
 
 // both are cpu keys
-extern inline int comp_cpu_keys (const struct cpu_key *, const struct cpu_key *);
-extern inline int comp_short_cpu_keys (const struct cpu_key *, 
+extern  int comp_cpu_keys (const struct cpu_key *, const struct cpu_key *);
+extern int comp_short_cpu_keys (const struct cpu_key *,
                                       const struct cpu_key *);
-extern inline void cpu_key2cpu_key (struct cpu_key *, const struct cpu_key *);
+extern void cpu_key2cpu_key (struct cpu_key *, const struct cpu_key *);
 
 // both are in le form
-extern inline int comp_le_keys (const struct key *, const struct key *);
-extern inline int comp_short_le_keys (const struct key *, const struct key *);
+extern int comp_le_keys (const struct key *, const struct key *);
+extern int comp_short_le_keys (const struct key *, const struct key *);
 
 //
 // get key version from on disk key - kludge
index f5f84aedbaec7e79f5c3239fade71bc56a30d6ec..e77f1330d90bd130a285c564723f8ab62e0148a1 100644 (file)
@@ -670,7 +670,7 @@ static inline int capable(int cap)
 extern struct mm_struct * mm_alloc(void);
 
 /* mmdrop drops the mm and the page tables */
-extern inline void FASTCALL(__mmdrop(struct mm_struct *));
+extern void FASTCALL(__mmdrop(struct mm_struct *));
 static inline void mmdrop(struct mm_struct * mm)
 {
        if (atomic_dec_and_test(&mm->mm_count))
index b703d95dadc778cca8fdd1ea44b813585f64fc8f..8d84f4e85766857be456bf6eb438d6ac308b2ef8 100644 (file)
@@ -416,7 +416,7 @@ struct mm_struct * mm_alloc(void)
  * is dropped: either by a lazy thread or by
  * mmput. Free the page directory and the mm.
  */
-inline void __mmdrop(struct mm_struct *mm)
+void __mmdrop(struct mm_struct *mm)
 {
        BUG_ON(mm == &init_mm);
        mm_free_pgd(mm);
index 86d8670569a75e4e01447be014f16ef7e7ca6b86..2783fa38af65c1d63072126256a3532062c71fe3 100644 (file)
@@ -99,7 +99,9 @@ u32 attribute((pure)) crc32_le(u32 crc, unsigned char const *p, size_t len)
        /* Align it */
        if(unlikely(((long)b)&3 && len)){
                do {
-                       DO_CRC(*((u8 *)b)++);
+                       u8 *p = (u8 *)b;
+                       DO_CRC(*p++);
+                       b = (void *)p;
                } while ((--len) && ((long)b)&3 );
        }
        if(likely(len >= 4)){
@@ -120,7 +122,9 @@ u32 attribute((pure)) crc32_le(u32 crc, unsigned char const *p, size_t len)
        /* And the last few bytes */
        if(len){
                do {
-                       DO_CRC(*((u8 *)b)++);
+                       u8 *p = (u8 *)b;
+                       DO_CRC(*p++);
+                       b = (void *)p;
                } while (--len);
        }
 
@@ -200,7 +204,9 @@ u32 attribute((pure)) crc32_be(u32 crc, unsigned char const *p, size_t len)
        /* Align it */
        if(unlikely(((long)b)&3 && len)){
                do {
-                       DO_CRC(*((u8 *)b)++);
+                       u8 *p = (u8 *)b;
+                       DO_CRC(*p++);
+                       b = (u32 *)p;
                } while ((--len) && ((long)b)&3 );
        }
        if(likely(len >= 4)){
@@ -221,7 +227,9 @@ u32 attribute((pure)) crc32_be(u32 crc, unsigned char const *p, size_t len)
        /* And the last few bytes */
        if(len){
                do {
-                       DO_CRC(*((u8 *)b)++);
+                       u8 *p = (u8 *)b;
+                       DO_CRC(*p++);
+                       b = (void *)p;
                } while (--len);
        }
        return __be32_to_cpu(crc);