Use NULL in preference to 0 for pointers.

This commit is contained in:
Warner Losh 2009-02-03 07:51:41 +00:00
parent 4592c621f3
commit d710cae75a
2 changed files with 7 additions and 7 deletions

View File

@ -43,7 +43,7 @@ SYSINIT(clist, SI_SUB_CLIST, SI_ORDER_FIRST, clist_init, NULL);
static MALLOC_DEFINE(M_CLIST, "clist", "clist queue blocks");
static struct cblock *cfreelist = 0;
static struct cblock *cfreelist = NULL;
int cfreecount = 0;
static int cslushcount;
static int ctotcount;
@ -478,7 +478,7 @@ b_to_q(char *src, int amount, struct clist *clistp)
int
unputc(struct clist *clistp)
{
struct cblock *cblockp = 0, *cbp = 0;
struct cblock *cblockp = NULL, *cbp = NULL;
int s;
int chr = -1;

View File

@ -114,7 +114,7 @@ _taskqueue_create(const char *name, int mflags,
queue = malloc(sizeof(struct taskqueue), M_TASKQUEUE, mflags | M_ZERO);
if (!queue)
return 0;
return NULL;
STAILQ_INIT(&queue->tq_queue);
queue->tq_name = name;
@ -213,7 +213,7 @@ taskqueue_enqueue(struct taskqueue *queue, struct task *task)
if (!prev || prev->ta_priority >= task->ta_priority) {
STAILQ_INSERT_TAIL(&queue->tq_queue, task, ta_link);
} else {
prev = 0;
prev = NULL;
for (ins = STAILQ_FIRST(&queue->tq_queue); ins;
prev = ins, ins = STAILQ_NEXT(ins, ta_link))
if (ins->ta_priority < task->ta_priority)
@ -423,11 +423,11 @@ taskqueue_thread_enqueue(void *context)
wakeup_one(tq);
}
TASKQUEUE_DEFINE(swi, taskqueue_swi_enqueue, 0,
TASKQUEUE_DEFINE(swi, taskqueue_swi_enqueue, NULL,
swi_add(NULL, "task queue", taskqueue_swi_run, NULL, SWI_TQ,
INTR_MPSAFE, &taskqueue_ih));
TASKQUEUE_DEFINE(swi_giant, taskqueue_swi_giant_enqueue, 0,
TASKQUEUE_DEFINE(swi_giant, taskqueue_swi_giant_enqueue, NULL,
swi_add(NULL, "Giant taskq", taskqueue_swi_giant_run,
NULL, SWI_TQ_GIANT, 0, &taskqueue_giant_ih));
@ -462,6 +462,6 @@ taskqueue_fast_run(void *dummy)
taskqueue_run(taskqueue_fast);
}
TASKQUEUE_FAST_DEFINE(fast, taskqueue_fast_enqueue, 0,
TASKQUEUE_FAST_DEFINE(fast, taskqueue_fast_enqueue, NULL,
swi_add(NULL, "Fast task queue", taskqueue_fast_run, NULL,
SWI_TQ_FAST, INTR_MPSAFE, &taskqueue_fast_ih));