Commit 93b3d545 authored by Mika Kukkonen's avatar Mika Kukkonen Committed by Linus Torvalds

[PATCH] sparse: remaining integer zero / NULL fixes in allmodconfig & vmlinux

This fixes the the remaining 0 to NULL things that were found with 'make
allmodconfig' and 'make C=1 vmlinux'.
parent faa7a4c0
...@@ -128,7 +128,7 @@ acpi_ns_dump_root_devices (void) ...@@ -128,7 +128,7 @@ acpi_ns_dump_root_devices (void)
return; return;
} }
status = acpi_get_handle (0, ACPI_NS_SYSTEM_BUS, &sys_bus_handle); status = acpi_get_handle(NULL, ACPI_NS_SYSTEM_BUS, &sys_bus_handle);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
return; return;
} }
......
...@@ -328,7 +328,7 @@ static int hpet_release(struct inode *inode, struct file *file) ...@@ -328,7 +328,7 @@ static int hpet_release(struct inode *inode, struct file *file)
if (file->f_flags & FASYNC) if (file->f_flags & FASYNC)
hpet_fasync(-1, file, 0); hpet_fasync(-1, file, 0);
file->private_data = 0; file->private_data = NULL;
return 0; return 0;
} }
...@@ -559,7 +559,7 @@ int hpet_register(struct hpet_task *tp, int periodic) ...@@ -559,7 +559,7 @@ int hpet_register(struct hpet_task *tp, int periodic)
spin_lock_irq(&hpet_task_lock); spin_lock_irq(&hpet_task_lock);
spin_lock(&hpet_lock); spin_lock(&hpet_lock);
for (devp = 0, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next) for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next)
for (timer = hpetp->hp_hpet->hpet_timers, i = 0; for (timer = hpetp->hp_hpet->hpet_timers, i = 0;
i < hpetp->hp_ntimer; i++, timer++) { i < hpetp->hp_ntimer; i++, timer++) {
if ((readq(&timer->hpet_config) & Tn_PER_INT_CAP_MASK) if ((readq(&timer->hpet_config) & Tn_PER_INT_CAP_MASK)
...@@ -569,7 +569,7 @@ int hpet_register(struct hpet_task *tp, int periodic) ...@@ -569,7 +569,7 @@ int hpet_register(struct hpet_task *tp, int periodic)
devp = &hpetp->hp_dev[i]; devp = &hpetp->hp_dev[i];
if (devp->hd_flags & HPET_OPEN || devp->hd_task) { if (devp->hd_flags & HPET_OPEN || devp->hd_task) {
devp = 0; devp = NULL;
continue; continue;
} }
...@@ -629,7 +629,7 @@ int hpet_unregister(struct hpet_task *tp) ...@@ -629,7 +629,7 @@ int hpet_unregister(struct hpet_task *tp)
writeq((readq(&timer->hpet_config) & ~Tn_INT_ENB_CNF_MASK), writeq((readq(&timer->hpet_config) & ~Tn_INT_ENB_CNF_MASK),
&timer->hpet_config); &timer->hpet_config);
devp->hd_flags &= ~(HPET_IE | HPET_PERIODIC); devp->hd_flags &= ~(HPET_IE | HPET_PERIODIC);
devp->hd_task = 0; devp->hd_task = NULL;
spin_unlock(&hpet_lock); spin_unlock(&hpet_lock);
spin_unlock_irq(&hpet_task_lock); spin_unlock_irq(&hpet_task_lock);
...@@ -739,14 +739,13 @@ static struct ctl_table_header *sysctl_header; ...@@ -739,14 +739,13 @@ static struct ctl_table_header *sysctl_header;
static unsigned long __init hpet_calibrate(struct hpets *hpetp) static unsigned long __init hpet_calibrate(struct hpets *hpetp)
{ {
struct hpet_timer *timer; struct hpet_timer *timer = NULL;
unsigned long t, m, count, i, flags, start; unsigned long t, m, count, i, flags, start;
struct hpet_dev *devp; struct hpet_dev *devp;
int j; int j;
struct hpet *hpet; struct hpet *hpet;
for (timer = 0, j = 0, devp = hpetp->hp_dev; j < hpetp->hp_ntimer; for (j = 0, devp = hpetp->hp_dev; j < hpetp->hp_ntimer; j++, devp++)
j++, devp++)
if ((devp->hd_flags & HPET_OPEN) == 0) { if ((devp->hd_flags & HPET_OPEN) == 0) {
timer = devp->hd_timer; timer = devp->hd_timer;
break; break;
......
...@@ -500,7 +500,7 @@ compute_imstt_regvals_ibm(struct imstt_par *par, int xres, int yres) ...@@ -500,7 +500,7 @@ compute_imstt_regvals_ibm(struct imstt_par *par, int xres, int yres)
MHz = 200; MHz = 200;
break; break;
default: default:
return 0; return NULL;
} }
setclkMHz(par, MHz); setclkMHz(par, MHz);
...@@ -547,7 +547,7 @@ compute_imstt_regvals_tvp(struct imstt_par *par, int xres, int yres) ...@@ -547,7 +547,7 @@ compute_imstt_regvals_tvp(struct imstt_par *par, int xres, int yres)
init = yres == 960 ? &tvp_reg_init_19 : &tvp_reg_init_20; init = yres == 960 ? &tvp_reg_init_19 : &tvp_reg_init_20;
break; break;
default: default:
return 0; return NULL;
} }
par->init = *init; par->init = *init;
return init; return init;
......
...@@ -35,7 +35,7 @@ extern const struct linux_logo logo_superh_clut224; ...@@ -35,7 +35,7 @@ extern const struct linux_logo logo_superh_clut224;
const struct linux_logo *fb_find_logo(int depth) const struct linux_logo *fb_find_logo(int depth)
{ {
const struct linux_logo *logo = 0; const struct linux_logo *logo = NULL;
if (depth >= 1) { if (depth >= 1) {
#ifdef CONFIG_LOGO_LINUX_MONO #ifdef CONFIG_LOGO_LINUX_MONO
......
...@@ -52,7 +52,7 @@ static int mtrr = 1; ...@@ -52,7 +52,7 @@ static int mtrr = 1;
static int vram __initdata = 0; /* Set amount of memory to be used */ static int vram __initdata = 0; /* Set amount of memory to be used */
static int pmi_setpal = 0; /* pmi for palette changes ??? */ static int pmi_setpal = 0; /* pmi for palette changes ??? */
static int ypan = 0; /* 0..nothing, 1..ypan, 2..ywrap */ static int ypan = 0; /* 0..nothing, 1..ypan, 2..ywrap */
static unsigned short *pmi_base = 0; static unsigned short *pmi_base = NULL;
static void (*pmi_start)(void); static void (*pmi_start)(void);
static void (*pmi_pal)(void); static void (*pmi_pal)(void);
......
...@@ -21,7 +21,7 @@ static void do_poweroff(void *dummy) ...@@ -21,7 +21,7 @@ static void do_poweroff(void *dummy)
pm_power_off(); pm_power_off();
} }
static DECLARE_WORK(poweroff_work, do_poweroff, 0); static DECLARE_WORK(poweroff_work, do_poweroff, NULL);
static void handle_poweroff(int key, struct pt_regs *pt_regs, static void handle_poweroff(int key, struct pt_regs *pt_regs,
struct tty_struct *tty) struct tty_struct *tty)
......
...@@ -122,7 +122,7 @@ static void prep_compound_page(struct page *page, unsigned long order) ...@@ -122,7 +122,7 @@ static void prep_compound_page(struct page *page, unsigned long order)
int i; int i;
int nr_pages = 1 << order; int nr_pages = 1 << order;
page[1].mapping = 0; page[1].mapping = NULL;
page[1].index = order; page[1].index = order;
for (i = 0; i < nr_pages; i++) { for (i = 0; i < nr_pages; i++) {
struct page *p = page + i; struct page *p = page + i;
......
...@@ -237,14 +237,14 @@ static void arp_reply(struct sk_buff *skb) ...@@ -237,14 +237,14 @@ static void arp_reply(struct sk_buff *skb)
struct sk_buff *send_skb; struct sk_buff *send_skb;
unsigned long flags; unsigned long flags;
struct list_head *p; struct list_head *p;
struct netpoll *np = 0; struct netpoll *np = NULL;
spin_lock_irqsave(&rx_list_lock, flags); spin_lock_irqsave(&rx_list_lock, flags);
list_for_each(p, &rx_list) { list_for_each(p, &rx_list) {
np = list_entry(p, struct netpoll, rx_list); np = list_entry(p, struct netpoll, rx_list);
if ( np->dev == skb->dev ) if ( np->dev == skb->dev )
break; break;
np = 0; np = NULL;
} }
spin_unlock_irqrestore(&rx_list_lock, flags); spin_unlock_irqrestore(&rx_list_lock, flags);
...@@ -411,7 +411,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt) ...@@ -411,7 +411,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
if ((delim = strchr(cur, '@')) == NULL) if ((delim = strchr(cur, '@')) == NULL)
goto parse_failed; goto parse_failed;
*delim=0; *delim=0;
np->local_port=simple_strtol(cur, 0, 10); np->local_port=simple_strtol(cur, NULL, 10);
cur=delim; cur=delim;
} }
cur++; cur++;
...@@ -446,7 +446,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt) ...@@ -446,7 +446,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
if ((delim = strchr(cur, '@')) == NULL) if ((delim = strchr(cur, '@')) == NULL)
goto parse_failed; goto parse_failed;
*delim=0; *delim=0;
np->remote_port=simple_strtol(cur, 0, 10); np->remote_port=simple_strtol(cur, NULL, 10);
cur=delim; cur=delim;
} }
cur++; cur++;
...@@ -468,29 +468,29 @@ int netpoll_parse_options(struct netpoll *np, char *opt) ...@@ -468,29 +468,29 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
if ((delim = strchr(cur, ':')) == NULL) if ((delim = strchr(cur, ':')) == NULL)
goto parse_failed; goto parse_failed;
*delim=0; *delim=0;
np->remote_mac[0]=simple_strtol(cur, 0, 16); np->remote_mac[0]=simple_strtol(cur, NULL, 16);
cur=delim+1; cur=delim+1;
if ((delim = strchr(cur, ':')) == NULL) if ((delim = strchr(cur, ':')) == NULL)
goto parse_failed; goto parse_failed;
*delim=0; *delim=0;
np->remote_mac[1]=simple_strtol(cur, 0, 16); np->remote_mac[1]=simple_strtol(cur, NULL, 16);
cur=delim+1; cur=delim+1;
if ((delim = strchr(cur, ':')) == NULL) if ((delim = strchr(cur, ':')) == NULL)
goto parse_failed; goto parse_failed;
*delim=0; *delim=0;
np->remote_mac[2]=simple_strtol(cur, 0, 16); np->remote_mac[2]=simple_strtol(cur, NULL, 16);
cur=delim+1; cur=delim+1;
if ((delim = strchr(cur, ':')) == NULL) if ((delim = strchr(cur, ':')) == NULL)
goto parse_failed; goto parse_failed;
*delim=0; *delim=0;
np->remote_mac[3]=simple_strtol(cur, 0, 16); np->remote_mac[3]=simple_strtol(cur, NULL, 16);
cur=delim+1; cur=delim+1;
if ((delim = strchr(cur, ':')) == NULL) if ((delim = strchr(cur, ':')) == NULL)
goto parse_failed; goto parse_failed;
*delim=0; *delim=0;
np->remote_mac[4]=simple_strtol(cur, 0, 16); np->remote_mac[4]=simple_strtol(cur, NULL, 16);
cur=delim+1; cur=delim+1;
np->remote_mac[5]=simple_strtol(cur, 0, 16); np->remote_mac[5]=simple_strtol(cur, NULL, 16);
} }
printk(KERN_INFO "%s: remote ethernet address " printk(KERN_INFO "%s: remote ethernet address "
...@@ -620,7 +620,7 @@ void netpoll_cleanup(struct netpoll *np) ...@@ -620,7 +620,7 @@ void netpoll_cleanup(struct netpoll *np)
} }
dev_put(np->dev); dev_put(np->dev);
np->dev = 0; np->dev = NULL;
} }
int netpoll_trap(void) int netpoll_trap(void)
......
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