diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-06-29 00:35:41 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-06-29 00:35:41 -0700 |
commit | 9893721cdf2953fdafd90988899307ec14794f4c (patch) | |
tree | 257e88d2751bc57fc6a07eca96011e6fd4eb1379 /kernel | |
parent | 4d1ae8c58dd8a8505a7684fa393c95da04082ef7 (diff) | |
download | history-9893721cdf2953fdafd90988899307ec14794f4c.tar.gz |
sparse: fix pointer/integer confusion
I don't think we're in K&R any more, Toto.
If you want a NULL pointer, use NULL. Don't use an integer.
Most of the users really didn't seem to know the proper type.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/dma.c | 9 | ||||
-rw-r--r-- | kernel/itimer.c | 2 | ||||
-rw-r--r-- | kernel/posix-timers.c | 8 | ||||
-rw-r--r-- | kernel/signal.c | 6 |
4 files changed, 9 insertions, 16 deletions
diff --git a/kernel/dma.c b/kernel/dma.c index af1d982a0c5768..940d02c5087991 100644 --- a/kernel/dma.c +++ b/kernel/dma.c @@ -58,14 +58,7 @@ struct dma_chan { }; static struct dma_chan dma_chan_busy[MAX_DMA_CHANNELS] = { - { 0, 0 }, - { 0, 0 }, - { 0, 0 }, - { 0, 0 }, - { 1, "cascade" }, - { 0, 0 }, - { 0, 0 }, - { 0, 0 } + [4] = { 1, "cascade" }, }; diff --git a/kernel/itimer.c b/kernel/itimer.c index 1a95e09b41b62d..6918cb7460a8a4 100644 --- a/kernel/itimer.c +++ b/kernel/itimer.c @@ -134,7 +134,7 @@ asmlinkage long sys_setitimer(int which, } else memset((char *) &set_buffer, 0, sizeof(set_buffer)); - error = do_setitimer(which, &set_buffer, ovalue ? &get_buffer : 0); + error = do_setitimer(which, &set_buffer, ovalue ? &get_buffer : NULL); if (error || !ovalue) return error; diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index 50b776464964c8..c18d947b582b4a 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c @@ -210,7 +210,7 @@ static __init int init_posix_timers(void) register_posix_clock(CLOCK_MONOTONIC, &clock_monotonic); posix_timers_cache = kmem_cache_create("posix_timers_cache", - sizeof (struct k_itimer), 0, 0, 0, 0); + sizeof (struct k_itimer), 0, 0, NULL, NULL); idr_init(&posix_timers_id); return 0; @@ -399,7 +399,7 @@ static struct k_itimer * alloc_posix_timer(void) memset(tmr, 0, sizeof (struct k_itimer)); if (unlikely(!(tmr->sigq = sigqueue_alloc()))) { kmem_cache_free(posix_timers_cache, tmr); - tmr = 0; + tmr = NULL; } return tmr; } @@ -431,7 +431,7 @@ sys_timer_create(clockid_t which_clock, int error = 0; struct k_itimer *new_timer = NULL; int new_timer_id; - struct task_struct *process = 0; + struct task_struct *process = NULL; unsigned long flags; sigevent_t event; int it_id_set = IT_ID_NOT_SET; @@ -521,7 +521,7 @@ sys_timer_create(clockid_t which_clock, get_task_struct(process); } else { spin_unlock_irqrestore(&process->sighand->siglock, flags); - process = 0; + process = NULL; } } read_unlock(&tasklist_lock); diff --git a/kernel/signal.c b/kernel/signal.c index 18048ca42f0ead..7a8cc4687c7175 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -264,7 +264,7 @@ next_signal(struct sigpending *pending, sigset_t *mask) static struct sigqueue *__sigqueue_alloc(void) { - struct sigqueue *q = 0; + struct sigqueue *q = NULL; if (atomic_read(¤t->user->sigpending) < current->rlim[RLIMIT_SIGPENDING].rlim_cur) @@ -272,7 +272,7 @@ static struct sigqueue *__sigqueue_alloc(void) if (q) { INIT_LIST_HEAD(&q->list); q->flags = 0; - q->lock = 0; + q->lock = NULL; q->user = get_uid(current->user); atomic_inc(&q->user->sigpending); } @@ -454,7 +454,7 @@ unblock_all_signals(void) static inline int collect_signal(int sig, struct sigpending *list, siginfo_t *info) { - struct sigqueue *q, *first = 0; + struct sigqueue *q, *first = NULL; int still_pending = 0; if (unlikely(!sigismember(&list->signal, sig))) |