]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sparse: misc cleanups
authorAlexander Viro <viro@www.linux.org.uk>
Fri, 30 Jul 2004 15:49:36 +0000 (08:49 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 30 Jul 2004 15:49:36 +0000 (08:49 -0700)
all sorts of minor stuff - basically, all chunks are independent here,
but IMO that one is not worth splitting.  Contains:
* pmac_cpufreq.c: declaration in the middle of a block.
* sys_ia32.c: couple of trivial annotations.
* ipmi_si_intf.c: should be using asm/irq.h instead of linux/irq.h
* synclink_cs.c: assignment-in-conditional with nobody ever looking
at the variable we are assigning to afterwards; variable removed.
* sbni.c: s/__volatile/__volatile__
* matroxfb_base.h: got rid of ((u32 *)p)++
* asm-ppc/checksum.h and asm-sparc64/floppy.h: NULL noise removal
* amd64 compat.h: missing L in long constant.
* mtd-abi.h: annotated ioctl structure
* sysctl.c: corrected annotations in extern

Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
12 files changed:
arch/ppc/platforms/pmac_cpufreq.c
arch/x86_64/ia32/sys_ia32.c
drivers/char/ipmi/ipmi_si_intf.c
drivers/char/pcmcia/synclink_cs.c
drivers/net/wan/sbni.c
drivers/video/matrox/matroxfb_base.h
fs/binfmt_elf.c
include/asm-ppc/checksum.h
include/asm-sparc64/floppy.h
include/asm-x86_64/compat.h
include/mtd/mtd-abi.h
kernel/sysctl.c

index b26c7e158792ded1b3ba674d243f6b1f21e1242b..5b2221a141847cf3665df4a6454525f527d9d7bd 100644 (file)
@@ -469,6 +469,7 @@ static int __pmac pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
 static int __pmac pmac_cpufreq_init_7447A(struct device_node *cpunode)
 {
        struct device_node *volt_gpio_np;
+       u32 *reg;
 
        /* OF only reports the high frequency */
        hi_freq = cur_freq;
@@ -484,7 +485,7 @@ static int __pmac pmac_cpufreq_init_7447A(struct device_node *cpunode)
                return 1;
        }
 
-       u32 *reg = (u32 *)get_property(volt_gpio_np, "reg", NULL);
+       reg = (u32 *)get_property(volt_gpio_np, "reg", NULL);
        voltage_gpio = *reg;
        set_speed_proc = dfs_set_cpu_speed;
 
index 55541e9816f471504d93300ab37f0a840a0c1f9a..ab8003492318a19878f133a9cb91ec379e2ce892 100644 (file)
@@ -885,7 +885,7 @@ sys32_sysctl(struct sysctl_ia32 __user *args32)
        oldvalp = (void *) A(a32.oldval);
        newvalp = (void *) A(a32.newval);
 
-       if ((oldvalp && get_user(oldlen, (int *) A(a32.oldlenp)))
+       if ((oldvalp && get_user(oldlen, (int __user *)compat_ptr(a32.oldlenp)))
            || !access_ok(VERIFY_WRITE, namep, 0)
            || !access_ok(VERIFY_WRITE, oldvalp, 0)
            || !access_ok(VERIFY_WRITE, newvalp, 0))
@@ -897,7 +897,7 @@ sys32_sysctl(struct sysctl_ia32 __user *args32)
        unlock_kernel();
        set_fs(old_fs);
 
-       if (oldvalp && put_user (oldlen, (int *) A(a32.oldlenp)))
+       if (oldvalp && put_user (oldlen, (int __user *)compat_ptr(a32.oldlenp)))
                return -EFAULT;
 
        return ret;
index 2cfcda1db36907db181fb90f1f09469d5d3c0741..ea330f3ff7a960180c0544418bc7d6a29297a41e 100644 (file)
@@ -51,7 +51,7 @@
 #include <linux/list.h>
 #include <linux/pci.h>
 #include <linux/ioport.h>
-#include <linux/irq.h>
+#include <asm/irq.h>
 #ifdef CONFIG_HIGH_RES_TIMERS
 #include <linux/hrtime.h>
 # if defined(schedule_next_int)
index 2df2f2a6a19646582c7fc471eb56ad1e4ed952e7..cb1cfb0afd887900dfc84ab2c86d2b6ff0ef109f 100644 (file)
@@ -854,9 +854,8 @@ static inline int mgslpc_paranoia_check(MGSLPC_INFO *info,
 static BOOLEAN wait_command_complete(MGSLPC_INFO *info, unsigned char channel) 
 {
        int i = 0;
-       unsigned char status;
        /* wait for command completion */ 
-       while ((status = read_reg(info, (unsigned char)(channel+STAR)) & BIT2)) {
+       while (read_reg(info, (unsigned char)(channel+STAR)) & BIT2) {
                udelay(1);
                if (i++ == 1000)
                        return FALSE;
index d0dd897453614100dedb540b8ab25fc65168eec4..8b1ef3e690217d73e773ffaebcb162024faae574 100644 (file)
@@ -1578,7 +1578,7 @@ calc_crc32( u32  crc,  u8  *p,  u32  len )
        register u32  _crc;
        _crc = crc;
        
-       __asm __volatile (
+       __asm__ __volatile__ (
                "xorl   %%ebx, %%ebx\n"
                "movl   %2, %%esi\n" 
                "movl   %3, %%ecx\n" 
index 152dde87c558e04d37052d9077d94f66e98a51bf..18938f11936d95061e41ec3e16cc77050f9acf0a 100644 (file)
@@ -217,21 +217,21 @@ static inline void mga_memcpy_toio(vaddr_t va, unsigned int offs, const void* sr
 #ifdef MEMCPYTOIO_WORKS
        memcpy_toio(va.vaddr + offs, src, len);
 #elif defined(MEMCPYTOIO_WRITEL)
-#define srcd ((const u_int32_t*)src)
        if (offs & 3) {
                while (len >= 4) {
-                       mga_writel(va, offs, get_unaligned(srcd++));
+                       mga_writel(va, offs, get_unaligned((u32 *)src));
                        offs += 4;
                        len -= 4;
+                       src += 4;
                }
        } else {
                while (len >= 4) {
-                       mga_writel(va, offs, *srcd++);
+                       mga_writel(va, offs, *(u32 *)src);
                        offs += 4;
                        len -= 4;
+                       src += 4;
                }
        }
-#undef srcd
        if (len) {
                u_int32_t tmp;
 
index 55082e5ecaeddb6704f192f74d465b63cf4a24c3..771cb85c42190e9fe68b35432917c647e8c41799 100644 (file)
@@ -237,8 +237,8 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr * exec,
        if (interp_aout) {
                argv = sp + 2;
                envp = argv + argc + 1;
-               __put_user((elf_addr_t)(long)argv, sp++);
-               __put_user((elf_addr_t)(long)envp, sp++);
+               __put_user((elf_addr_t)(unsigned long)argv, sp++);
+               __put_user((elf_addr_t)(unsigned long)envp, sp++);
        } else {
                argv = sp;
                envp = argv + argc + 1;
index 231cb2b643c764f834a688835f5ce345f5a29f3e..d98a93d82ed3c2f21d83dd285511955f653a94fd 100644 (file)
@@ -33,11 +33,11 @@ extern unsigned int csum_partial_copy_generic(const char *src, char *dst,
                                              int *src_err, int *dst_err);
 
 #define csum_partial_copy_from_user(src, dst, len, sum, errp)  \
-       csum_partial_copy_generic((src), (dst), (len), (sum), (errp), 0)
+       csum_partial_copy_generic((src), (dst), (len), (sum), (errp), NULL)
 
 /* FIXME: this needs to be written to really do no check -- Cort */
 #define csum_partial_copy_nocheck(src, dst, len, sum)  \
-       csum_partial_copy_generic((src), (dst), (len), (sum), 0, 0)
+       csum_partial_copy_generic((src), (dst), (len), (sum), NULL, NULL)
 
 /*
  * turns a 32-bit partial checksum (e.g. from csum_partial) into a
index 1bc43aaa49eb0333943a7dcf2428c6c3b46fd67e..e071b4b4edfd8ec8b92ceb4d3d8edcfc4cd644dc 100644 (file)
@@ -164,7 +164,7 @@ unsigned long pdma_size;
 volatile int doing_pdma = 0;
 
 /* This is software state */
-char *pdma_base = 0;
+char *pdma_base = NULL;
 unsigned long pdma_areasize;
 
 /* Common routines to all controller types on the Sparc. */
@@ -173,7 +173,7 @@ static void sun_fd_disable_dma(void)
        doing_pdma = 0;
        if (pdma_base) {
                mmu_unlockarea(pdma_base, pdma_areasize);
-               pdma_base = 0;
+               pdma_base = NULL;
        }
 }
 
@@ -613,7 +613,7 @@ static unsigned long __init sun_floppy_init(void)
        } else {
 #ifdef CONFIG_PCI
                struct linux_ebus *ebus;
-               struct linux_ebus_device *edev = 0;
+               struct linux_ebus_device *edev = NULL;
                unsigned long config = 0;
                unsigned long auxio_reg;
 
index c1e04aa5a80f8eb93680862a3e3c2fbd54d0c9a0..3acf9f22707ee4b2fe2cb6d11477cc1763203c98 100644 (file)
@@ -118,7 +118,7 @@ typedef u32         compat_old_sigset_t;    /* at least 32 bits */
 typedef u32               compat_sigset_word;
 
 #define COMPAT_OFF_T_MAX       0x7fffffff
-#define COMPAT_LOFF_T_MAX      0x7fffffffffffffff
+#define COMPAT_LOFF_T_MAX      0x7fffffffffffffffL
 
 struct compat_ipc64_perm {
        compat_key_t key;
index db5fca2fac5a71f4e8d4302f6ecb980b9e75fe12..e872ad77058bf3ee49faa832121465b0492560b8 100644 (file)
@@ -15,7 +15,7 @@ struct erase_info_user {
 struct mtd_oob_buf {
        uint32_t start;
        uint32_t length;
-       unsigned char *ptr;
+       unsigned char __user *ptr;
 };
 
 #define MTD_ABSENT             0
index 3ae9e7568738c4dc9d52aac6695c09e2a668369d..e7435ba0f35b15b2fbc6f8164da2b52c8883605a 100644 (file)
@@ -113,7 +113,7 @@ extern int sysctl_hz_timer;
 #if defined(CONFIG_PPC32) && defined(CONFIG_6xx)
 extern unsigned long powersave_nap;
 int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
-                 void *buffer, size_t *lenp);
+                 void __user *buffer, size_t *lenp);
 #endif
 
 #ifdef CONFIG_BSD_PROCESS_ACCT