svn commit: r188058 - head/sys/kern
Warner Losh
imp at FreeBSD.org
Mon Feb 2 23:51:43 PST 2009
Author: imp
Date: Tue Feb 3 07:51:41 2009
New Revision: 188058
URL: http://svn.freebsd.org/changeset/base/188058
Log:
Use NULL in preference to 0 for pointers.
Modified:
head/sys/kern/subr_clist.c
head/sys/kern/subr_taskqueue.c
Modified: head/sys/kern/subr_clist.c
==============================================================================
--- head/sys/kern/subr_clist.c Tue Feb 3 07:51:11 2009 (r188057)
+++ head/sys/kern/subr_clist.c Tue Feb 3 07:51:41 2009 (r188058)
@@ -43,7 +43,7 @@ SYSINIT(clist, SI_SUB_CLIST, SI_ORDER_FI
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 cli
int
unputc(struct clist *clistp)
{
- struct cblock *cblockp = 0, *cbp = 0;
+ struct cblock *cblockp = NULL, *cbp = NULL;
int s;
int chr = -1;
Modified: head/sys/kern/subr_taskqueue.c
==============================================================================
--- head/sys/kern/subr_taskqueue.c Tue Feb 3 07:51:11 2009 (r188057)
+++ head/sys/kern/subr_taskqueue.c Tue Feb 3 07:51:41 2009 (r188058)
@@ -114,7 +114,7 @@ _taskqueue_create(const char *name, int
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 *queu
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));
More information about the svn-src-all
mailing list