Commit d2c993d8 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky
Browse files

[S390] Fix sparse warnings.


Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 7e560814
......@@ -403,7 +403,7 @@ static void *diag204_get_buffer(enum diag204_format fmt, int *pages)
*pages = 1;
return diag204_alloc_rbuf();
} else {/* INFO_EXT */
*pages = diag204(SUBC_RSI | INFO_EXT, 0, 0);
*pages = diag204(SUBC_RSI | INFO_EXT, 0, NULL);
if (*pages <= 0)
return ERR_PTR(-ENOSYS);
else
......
......@@ -409,7 +409,7 @@ asmlinkage long sys32_sysinfo(struct sysinfo32 __user *info)
mm_segment_t old_fs = get_fs ();
set_fs (KERNEL_DS);
ret = sys_sysinfo(&s);
ret = sys_sysinfo((struct sysinfo __user *) &s);
set_fs (old_fs);
err = put_user (s.uptime, &info->uptime);
err |= __put_user (s.loads[0], &info->loads[0]);
......@@ -438,7 +438,7 @@ asmlinkage long sys32_sched_rr_get_interval(compat_pid_t pid,
mm_segment_t old_fs = get_fs ();
set_fs (KERNEL_DS);
ret = sys_sched_rr_get_interval(pid, &t);
ret = sys_sched_rr_get_interval(pid, (struct timespec __user *) &t);
set_fs (old_fs);
if (put_compat_timespec(&t, interval))
return -EFAULT;
......@@ -464,7 +464,10 @@ asmlinkage long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
}
}
set_fs (KERNEL_DS);
ret = sys_rt_sigprocmask(how, set ? &s : NULL, oset ? &s : NULL, sigsetsize);
ret = sys_rt_sigprocmask(how,
set ? (sigset_t __user *) &s : NULL,
oset ? (sigset_t __user *) &s : NULL,
sigsetsize);
set_fs (old_fs);
if (ret) return ret;
if (oset) {
......@@ -489,7 +492,7 @@ asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set,
mm_segment_t old_fs = get_fs();
set_fs (KERNEL_DS);
ret = sys_rt_sigpending(&s, sigsetsize);
ret = sys_rt_sigpending((sigset_t __user *) &s, sigsetsize);
set_fs (old_fs);
if (!ret) {
switch (_NSIG_WORDS) {
......@@ -514,7 +517,7 @@ sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo)
if (copy_siginfo_from_user32(&info, uinfo))
return -EFAULT;
set_fs (KERNEL_DS);
ret = sys_rt_sigqueueinfo(pid, sig, &info);
ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *) &info);
set_fs (old_fs);
return ret;
}
......@@ -674,7 +677,8 @@ asmlinkage long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offse
return -EFAULT;
set_fs(KERNEL_DS);
ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count);
ret = sys_sendfile(out_fd, in_fd,
offset ? (off_t __user *) &of : NULL, count);
set_fs(old_fs);
if (offset && put_user(of, offset))
......@@ -694,7 +698,8 @@ asmlinkage long sys32_sendfile64(int out_fd, int in_fd,
return -EFAULT;
set_fs(KERNEL_DS);
ret = sys_sendfile64(out_fd, in_fd, offset ? &lof : NULL, count);
ret = sys_sendfile64(out_fd, in_fd,
offset ? (loff_t __user *) &lof : NULL, count);
set_fs(old_fs);
if (offset && put_user(lof, offset))
......
......@@ -119,7 +119,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
int nrela, i, j;
/* Find symbol table and string table. */
symtab = 0;
symtab = NULL;
for (i = 0; i < hdr->e_shnum; i++)
switch (sechdrs[i].sh_type) {
case SHT_SYMTAB:
......
......@@ -172,7 +172,7 @@ void show_regs(struct pt_regs *regs)
show_registers(regs);
/* Show stack backtrace if pt_regs is from kernel mode */
if (!(regs->psw.mask & PSW_MASK_PSTATE))
show_trace(0,(unsigned long *) regs->gprs[15]);
show_trace(NULL, (unsigned long *) regs->gprs[15]);
}
extern void kernel_thread_starter(void);
......
......@@ -13,7 +13,7 @@ static struct proc_dir_entry * root_irq_dir;
void init_irq_proc(void)
{
/* create /proc/irq */
root_irq_dir = proc_mkdir("irq", 0);
root_irq_dir = proc_mkdir("irq", NULL);
/* create /proc/irq/prof_cpu_mask */
create_prof_cpu_mask(root_irq_dir);
......
......@@ -24,7 +24,7 @@
* (0x1202 external call, 0x1004 cpu timer, 0x2401 hwc console, 0x4000
* iucv and 0x2603 pfault) this is always the first element.
*/
ext_int_info_t *ext_int_hash[256] = { 0, };
ext_int_info_t *ext_int_hash[256] = { NULL, };
static inline int ext_hash(__u16 code)
{
......
......@@ -379,7 +379,7 @@ void __init time_init(void)
-xtime.tv_sec, -xtime.tv_nsec);
/* request the clock comparator external interrupt */
if (register_early_external_interrupt(0x1004, 0,
if (register_early_external_interrupt(0x1004, NULL,
&ext_int_info_cc) != 0)
panic("Couldn't request external interrupt 0x1004");
......
......@@ -170,7 +170,7 @@ void show_stack(struct task_struct *task, unsigned long *sp)
*/
void dump_stack(void)
{
show_stack(0, 0);
show_stack(NULL, NULL);
}
EXPORT_SYMBOL(dump_stack);
......@@ -331,9 +331,9 @@ static void inline do_trap(long interruption_code, int signr, char *str,
}
}
static inline void *get_check_address(struct pt_regs *regs)
static inline void __user *get_check_address(struct pt_regs *regs)
{
return (void *)((regs->psw.addr-S390_lowcore.pgm_ilc) & PSW_ADDR_INSN);
return (void __user *)((regs->psw.addr-S390_lowcore.pgm_ilc) & PSW_ADDR_INSN);
}
void do_single_step(struct pt_regs *regs)
......@@ -360,7 +360,7 @@ asmlinkage void name(struct pt_regs * regs, long interruption_code) \
info.si_signo = signr; \
info.si_errno = 0; \
info.si_code = sicode; \
info.si_addr = (void *)siaddr; \
info.si_addr = siaddr; \
do_trap(interruption_code, signr, str, regs, &info); \
}
......@@ -392,7 +392,7 @@ DO_ERROR_INFO(SIGILL, "translation exception", translation_exception,
ILL_ILLOPN, get_check_address(regs))
static inline void
do_fp_trap(struct pt_regs *regs, void *location,
do_fp_trap(struct pt_regs *regs, void __user *location,
int fpc, long interruption_code)
{
siginfo_t si;
......@@ -424,10 +424,10 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code)
{
siginfo_t info;
__u8 opcode[6];
__u16 *location;
__u16 __user *location;
int signal = 0;
location = (__u16 *) get_check_address(regs);
location = get_check_address(regs);
/*
* We got all needed information from the lowcore and can
......@@ -559,10 +559,10 @@ DO_ERROR_INFO(SIGILL, "specification exception", specification_exception,
asmlinkage void data_exception(struct pt_regs * regs, long interruption_code)
{
__u16 *location;
__u16 __user *location;
int signal = 0;
location = (__u16 *) get_check_address(regs);
location = get_check_address(regs);
/*
* We got all needed information from the lowcore and can
......
......@@ -233,7 +233,7 @@ char * strrchr(const char * s, int c)
if (s[len] == (char) c)
return (char *) s + len;
} while (--len > 0);
return 0;
return NULL;
}
EXPORT_SYMBOL(strrchr);
......@@ -267,7 +267,7 @@ char * strstr(const char * s1,const char * s2)
return (char *) s1;
s1++;
}
return 0;
return NULL;
}
EXPORT_SYMBOL(strstr);
......
......@@ -161,7 +161,7 @@ cmm_thread(void *dummy)
static void
cmm_start_thread(void)
{
kernel_thread(cmm_thread, 0, 0);
kernel_thread(cmm_thread, NULL, 0);
}
static void
......
......@@ -144,7 +144,7 @@ static void do_sigsegv(struct pt_regs *regs, unsigned long error_code,
#endif
si.si_signo = SIGSEGV;
si.si_code = si_code;
si.si_addr = (void *) address;
si.si_addr = (void __user *) address;
force_sig_info(SIGSEGV, &si, current);
}
......
......@@ -394,7 +394,7 @@ dasd_add_busid(char *bus_id, int features)
if (!new)
return ERR_PTR(-ENOMEM);
spin_lock(&dasd_devmap_lock);
devmap = 0;
devmap = NULL;
hash = dasd_hash_busid(bus_id);
list_for_each_entry(tmp, &dasd_hashlists[hash], list)
if (strncmp(tmp->bus_id, bus_id, BUS_ID_SIZE) == 0) {
......@@ -406,10 +406,10 @@ dasd_add_busid(char *bus_id, int features)
new->devindex = dasd_max_devindex++;
strncpy(new->bus_id, bus_id, BUS_ID_SIZE);
new->features = features;
new->device = 0;
new->device = NULL;
list_add(&new->list, &dasd_hashlists[hash]);
devmap = new;
new = 0;
new = NULL;
}
spin_unlock(&dasd_devmap_lock);
kfree(new);
......@@ -479,7 +479,7 @@ dasd_device_from_devindex(int devindex)
int i;
spin_lock(&dasd_devmap_lock);
devmap = 0;
devmap = NULL;
for (i = 0; (i < 256) && !devmap; i++)
list_for_each_entry(tmp, &dasd_hashlists[i], list)
if (tmp->devindex == devindex) {
......
......@@ -65,16 +65,16 @@ struct dasd_eckd_private {
/* The ccw bus type uses this table to find devices that it sends to
* dasd_eckd_probe */
static struct ccw_device_id dasd_eckd_ids[] = {
{ CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3390, 0), driver_info: 0x1},
{ CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3390, 0), driver_info: 0x2},
{ CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3390, 0), driver_info: 0x3},
{ CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3380, 0), driver_info: 0x4},
{ CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3380, 0), driver_info: 0x5},
{ CCW_DEVICE_DEVTYPE (0x9343, 0, 0x9345, 0), driver_info: 0x6},
{ CCW_DEVICE_DEVTYPE (0x2107, 0, 0x3390, 0), driver_info: 0x7},
{ CCW_DEVICE_DEVTYPE (0x2107, 0, 0x3380, 0), driver_info: 0x8},
{ CCW_DEVICE_DEVTYPE (0x1750, 0, 0x3390, 0), driver_info: 0x9},
{ CCW_DEVICE_DEVTYPE (0x1750, 0, 0x3380, 0), driver_info: 0xa},
{ CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3390, 0), .driver_info = 0x1},
{ CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3390, 0), .driver_info = 0x2},
{ CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3390, 0), .driver_info = 0x3},
{ CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3380, 0), .driver_info = 0x4},
{ CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3380, 0), .driver_info = 0x5},
{ CCW_DEVICE_DEVTYPE (0x9343, 0, 0x9345, 0), .driver_info = 0x6},
{ CCW_DEVICE_DEVTYPE (0x2107, 0, 0x3390, 0), .driver_info = 0x7},
{ CCW_DEVICE_DEVTYPE (0x2107, 0, 0x3380, 0), .driver_info = 0x8},
{ CCW_DEVICE_DEVTYPE (0x1750, 0, 0x3390, 0), .driver_info = 0x9},
{ CCW_DEVICE_DEVTYPE (0x1750, 0, 0x3380, 0), .driver_info = 0xa},
{ /* end of list */ },
};
......
......@@ -44,8 +44,8 @@ struct dasd_fba_private {
};
static struct ccw_device_id dasd_fba_ids[] = {
{ CCW_DEVICE_DEVTYPE (0x6310, 0, 0x9336, 0), driver_info: 0x1},
{ CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3370, 0), driver_info: 0x2},
{ CCW_DEVICE_DEVTYPE (0x6310, 0, 0x9336, 0), .driver_info = 0x1},
{ CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3370, 0), .driver_info = 0x2},
{ /* end of list */ },
};
......
......@@ -84,9 +84,9 @@ void
dasd_gendisk_free(struct dasd_device *device)
{
del_gendisk(device->gdp);
device->gdp->queue = 0;
device->gdp->queue = NULL;
put_disk(device->gdp);
device->gdp = 0;
device->gdp = NULL;
}
/*
......@@ -136,7 +136,7 @@ dasd_destroy_partitions(struct dasd_device * device)
* device->bdev to lower the offline open_count limit again.
*/
bdev = device->bdev;
device->bdev = 0;
device->bdev = NULL;
/*
* See fs/partition/check.c:delete_partition
......@@ -145,7 +145,7 @@ dasd_destroy_partitions(struct dasd_device * device)
*/
memset(&bpart, 0, sizeof(struct blkpg_partition));
memset(&barg, 0, sizeof(struct blkpg_ioctl_arg));
barg.data = &bpart;
barg.data = (void __user *) &bpart;
barg.op = BLKPG_DEL_PARTITION;
for (bpart.pno = device->gdp->minors - 1; bpart.pno > 0; bpart.pno--)
ioctl_by_bdev(bdev, BLKPG, (unsigned long) &barg);
......
......@@ -345,7 +345,7 @@ dasd_ioctl_set_ro(struct block_device *bdev, void __user *argp)
if (bdev != bdev->bd_contains)
// ro setting is not allowed for partitions
return -EINVAL;
if (get_user(intval, (int *)argp))
if (get_user(intval, (int __user *)argp))
return -EFAULT;
set_disk_ro(bdev->bd_disk, intval);
......
......@@ -693,7 +693,7 @@ raw3215_probe (struct ccw_device *cdev)
GFP_KERNEL|GFP_DMA);
if (raw->buffer == NULL) {
spin_lock(&raw3215_device_lock);
raw3215[line] = 0;
raw3215[line] = NULL;
spin_unlock(&raw3215_device_lock);
kfree(raw);
return -ENOMEM;
......
......@@ -23,7 +23,7 @@ ctrlchar_handle_sysrq(void *tty)
handle_sysrq(ctrlchar_sysrq_key, NULL, (struct tty_struct *) tty);
}
static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq, 0);
static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq, NULL);
#endif
......
......@@ -83,8 +83,8 @@ static u_short shift_ctrl_map[NR_KEYS] = {
};
ushort *key_maps[MAX_NR_KEYMAPS] = {
plain_map, shift_map, 0, 0,
ctrl_map, shift_ctrl_map, 0
plain_map, shift_map, NULL, NULL,
ctrl_map, shift_ctrl_map, NULL,
};
unsigned int keymap_count = 4;
......@@ -145,7 +145,7 @@ char *func_table[MAX_NR_FUNC] = {
func_buf + 97,
func_buf + 103,
func_buf + 109,
0,
NULL,
};
struct kbdiacr accent_table[MAX_DIACR] = {
......
......@@ -236,7 +236,7 @@ fs3270_irq(struct fs3270 *fp, struct raw3270_request *rq, struct irb *irb)
* Process reads from fullscreen 3270.
*/
static ssize_t
fs3270_read(struct file *filp, char *data, size_t count, loff_t *off)
fs3270_read(struct file *filp, char __user *data, size_t count, loff_t *off)
{
struct fs3270 *fp;
struct raw3270_request *rq;
......@@ -281,7 +281,7 @@ fs3270_read(struct file *filp, char *data, size_t count, loff_t *off)
* Process writes to fullscreen 3270.
*/
static ssize_t
fs3270_write(struct file *filp, const char *data, size_t count, loff_t *off)
fs3270_write(struct file *filp, const char __user *data, size_t count, loff_t *off)
{
struct fs3270 *fp;
struct raw3270_request *rq;
......@@ -338,10 +338,10 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
fp->write_command = arg;
break;
case TUBGETI:
rc = put_user(fp->read_command, (char *) arg);
rc = put_user(fp->read_command, (char __user *) arg);
break;
case TUBGETO:
rc = put_user(fp->write_command,(char *) arg);
rc = put_user(fp->write_command,(char __user *) arg);
break;
case TUBGETMOD:
iocb.model = fp->view.model;
......@@ -350,7 +350,7 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
iocb.pf_cnt = 24;
iocb.re_cnt = 20;
iocb.map = 0;
if (copy_to_user((char *) arg, &iocb,
if (copy_to_user((char __user *) arg, &iocb,
sizeof(struct raw3270_iocb)))
rc = -EFAULT;
break;
......@@ -479,7 +479,7 @@ fs3270_close(struct inode *inode, struct file *filp)
struct fs3270 *fp;
fp = filp->private_data;
filp->private_data = 0;
filp->private_data = NULL;
if (fp) {
fp->fs_pid = 0;
raw3270_reset(&fp->view);
......
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