Commit a6c13231 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: misc cleanups

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