summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1996-07-12 04:12:25 +0000
committerbde <bde@FreeBSD.org>1996-07-12 04:12:25 +0000
commit4c9b9ce103f19e9cf0ec1b8e6b5d05db44be4176 (patch)
tree779349387d8c1e223fa67195929cd05163410911 /sys
parent214f4abc72a6e5fdfbd318b73ec1c66f7a9a826b (diff)
downloadFreeBSD-src-4c9b9ce103f19e9cf0ec1b8e6b5d05db44be4176.zip
FreeBSD-src-4c9b9ce103f19e9cf0ec1b8e6b5d05db44be4176.tar.gz
Don't use NULL in non-pointer contexts.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/vm_machdep.c6
-rw-r--r--sys/dev/scd/scd.c4
-rw-r--r--sys/i386/i386/vm_machdep.c6
-rw-r--r--sys/i386/isa/if_ze.c4
-rw-r--r--sys/i386/isa/if_zp.c4
-rw-r--r--sys/i386/isa/scd.c4
-rw-r--r--sys/kern/kern_exec.c6
-rw-r--r--sys/netinet/ip_mroute.c4
-rw-r--r--sys/pci/meteor.c20
-rw-r--r--sys/scsi/scsiconf.c6
-rw-r--r--sys/ufs/ffs/ffs_alloc.c32
-rw-r--r--sys/ufs/lfs/lfs_bio.c4
-rw-r--r--sys/vm/vm_swap.c4
13 files changed, 50 insertions, 54 deletions
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c
index fef61cd..bfa37bb 100644
--- a/sys/amd64/amd64/vm_machdep.c
+++ b/sys/amd64/amd64/vm_machdep.c
@@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
- * $Id: vm_machdep.c,v 1.65 1996/06/20 01:47:21 davidg Exp $
+ * $Id: vm_machdep.c,v 1.66 1996/06/20 08:07:30 davidg Exp $
*/
#include "npx.h"
@@ -226,13 +226,13 @@ more:
if( size == 0) {
splx(s);
- return NULL;
+ return 0;
}
if ((kva = kmem_alloc_pageable(io_map, size)) == 0) {
if( !waitok) {
splx(s);
- return NULL;
+ return 0;
}
bmwait = 1;
tsleep((caddr_t) io_map, PRIBIO, "bmwait", 0);
diff --git a/sys/dev/scd/scd.c b/sys/dev/scd/scd.c
index f6c15e4..df219c7 100644
--- a/sys/dev/scd/scd.c
+++ b/sys/dev/scd/scd.c
@@ -41,7 +41,7 @@
*/
-/* $Id: scd.c,v 1.21 1996/06/08 09:18:23 bde Exp $ */
+/* $Id: scd.c,v 1.22 1996/06/18 01:22:30 bde Exp $ */
/* Please send any comments to micke@dynas.se */
@@ -1159,7 +1159,7 @@ spin_up(unsigned unit)
int loop_count = 0;
again:
- rc = send_cmd(unit, CMD_SPIN_UP, NULL, 0, res_reg, &res_size);
+ rc = send_cmd(unit, CMD_SPIN_UP, 0, 0, res_reg, &res_size);
if (rc != 0) {
XDEBUG(2, ("scd%d: CMD_SPIN_UP error 0x%x\n", unit, rc));
return rc;
diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c
index fef61cd..bfa37bb 100644
--- a/sys/i386/i386/vm_machdep.c
+++ b/sys/i386/i386/vm_machdep.c
@@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
- * $Id: vm_machdep.c,v 1.65 1996/06/20 01:47:21 davidg Exp $
+ * $Id: vm_machdep.c,v 1.66 1996/06/20 08:07:30 davidg Exp $
*/
#include "npx.h"
@@ -226,13 +226,13 @@ more:
if( size == 0) {
splx(s);
- return NULL;
+ return 0;
}
if ((kva = kmem_alloc_pageable(io_map, size)) == 0) {
if( !waitok) {
splx(s);
- return NULL;
+ return 0;
}
bmwait = 1;
tsleep((caddr_t) io_map, PRIBIO, "bmwait", 0);
diff --git a/sys/i386/isa/if_ze.c b/sys/i386/isa/if_ze.c
index 655516b..736b54a 100644
--- a/sys/i386/isa/if_ze.c
+++ b/sys/i386/isa/if_ze.c
@@ -47,7 +47,7 @@
*/
/*
- * $Id: if_ze.c,v 1.30 1996/06/12 05:03:45 gpalmer Exp $
+ * $Id: if_ze.c,v 1.31 1996/06/25 20:30:30 bde Exp $
*/
#include "ze.h"
@@ -355,7 +355,7 @@ ze_probe(isa_dev)
int slot;
if ((slot = ze_find_adapter (isa_dev->id_maddr, isa_dev->id_reconfig)) < 0)
- return NULL;
+ return 0;
/*
* okay, we found a card, so set it up
diff --git a/sys/i386/isa/if_zp.c b/sys/i386/isa/if_zp.c
index ae53e23..0746ee4 100644
--- a/sys/i386/isa/if_zp.c
+++ b/sys/i386/isa/if_zp.c
@@ -34,7 +34,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* From: if_ep.c,v 1.9 1994/01/25 10:46:29 deraadt Exp $
- * $Id: if_zp.c,v 1.21 1996/06/18 01:22:24 bde Exp $
+ * $Id: if_zp.c,v 1.22 1996/06/25 20:30:34 bde Exp $
*/
/*-
* TODO:
@@ -339,7 +339,7 @@ zpprobe(struct isa_device * isa_dev)
int re_init_flag;
if ((slot = zp_find_adapter(isa_dev->id_maddr, isa_dev->id_reconfig)) < 0)
- return NULL;
+ return 0;
/* okay, we found a card, so set it up */
/* Inhibit 16 bit memory delay. POINTETH.SYS apparently does this, for
diff --git a/sys/i386/isa/scd.c b/sys/i386/isa/scd.c
index f6c15e4..df219c7 100644
--- a/sys/i386/isa/scd.c
+++ b/sys/i386/isa/scd.c
@@ -41,7 +41,7 @@
*/
-/* $Id: scd.c,v 1.21 1996/06/08 09:18:23 bde Exp $ */
+/* $Id: scd.c,v 1.22 1996/06/18 01:22:30 bde Exp $ */
/* Please send any comments to micke@dynas.se */
@@ -1159,7 +1159,7 @@ spin_up(unsigned unit)
int loop_count = 0;
again:
- rc = send_cmd(unit, CMD_SPIN_UP, NULL, 0, res_reg, &res_size);
+ rc = send_cmd(unit, CMD_SPIN_UP, 0, 0, res_reg, &res_size);
if (rc != 0) {
XDEBUG(2, ("scd%d: CMD_SPIN_UP error 0x%x\n", unit, rc));
return rc;
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 137f9d2..cfe55e0 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_exec.c,v 1.42 1996/06/03 04:07:35 davidg Exp $
+ * $Id: kern_exec.c,v 1.43 1996/06/03 04:12:18 davidg Exp $
*/
#include <sys/param.h>
@@ -525,7 +525,7 @@ exec_copyout_strings(imgp)
}
/* a null vector table pointer seperates the argp's from the envp's */
- suword(vectp++, NULL);
+ suword(vectp++, 0);
suword(&arginfo->ps_envstr, (int)vectp);
suword(&arginfo->ps_nenvstr, envc);
@@ -541,7 +541,7 @@ exec_copyout_strings(imgp)
}
/* end of vector table is a null pointer */
- suword(vectp, NULL);
+ suword(vectp, 0);
return (stack_base);
}
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 6ab802f..e53b2a5 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -9,7 +9,7 @@
* Modified by Bill Fenner, PARC, April 1995
*
* MROUTING Revision: 3.5
- * $Id: ip_mroute.c,v 1.31 1996/03/26 19:16:44 fenner Exp $
+ * $Id: ip_mroute.c,v 1.32 1996/04/18 15:41:11 wollman Exp $
*/
#include "opt_mrouting.h"
@@ -610,7 +610,7 @@ X_ip_mrouter_done()
/*
* Reset de-encapsulation cache
*/
- last_encap_src = NULL;
+ last_encap_src = 0;
last_encap_vif = NULL;
have_encap_tunnel = 0;
diff --git a/sys/pci/meteor.c b/sys/pci/meteor.c
index 2f2917f..b4c8b74 100644
--- a/sys/pci/meteor.c
+++ b/sys/pci/meteor.c
@@ -860,13 +860,13 @@ set_fps(meteor_reg_t *mtr, u_short fps)
static vm_offset_t
get_meteor_mem(int unit, unsigned size)
{
-vm_offset_t addr = NULL;
+vm_offset_t addr = 0;
addr = vm_page_alloc_contig(size, 0x100000, 0xffffffff, 1<<24);
- if(addr == NULL)
+ if(addr == 0)
addr = vm_page_alloc_contig(size, 0x100000, 0xffffffff,
PAGE_SIZE);
- if(addr == NULL) {
+ if(addr == 0) {
printf("meteor%d: Unable to allocate %d bytes of memory.\n",
unit, size);
}
@@ -1056,7 +1056,7 @@ met_attach(pcici_t tag, int unit)
if(METEOR_ALLOC)
buf = get_meteor_mem(unit, METEOR_ALLOC);
else
- buf = NULL;
+ buf = 0;
if(bootverbose) {
printf("meteor%d: buffer size %d, addr 0x%x\n",
unit, METEOR_ALLOC, vtophys(buf));
@@ -1064,7 +1064,7 @@ met_attach(pcici_t tag, int unit)
mtr->bigbuf = buf;
mtr->alloc_pages = METEOR_ALLOC_PAGES;
- if(buf != NULL) {
+ if(buf != 0) {
bzero((caddr_t) buf, METEOR_ALLOC);
buf = vtophys(buf);
/* 640x480 RGB 16 */
@@ -1259,7 +1259,7 @@ meteor_read(dev_t dev, struct uio *uio, int ioflag)
return(ENXIO);
mtr = &(meteor[unit]);
- if (mtr->bigbuf == NULL)/* no frame buffer allocated (ioctl failed) */
+ if (mtr->bigbuf == 0)/* no frame buffer allocated (ioctl failed) */
return(ENOMEM);
if (mtr->flags & METEOR_CAP_MASK)
@@ -1570,7 +1570,7 @@ meteor_ioctl(dev_t dev, int cmd, caddr_t arg, int flag, struct proc *pr)
temp = mtr->flags;
switch (*(int *) arg) {
case METEOR_CAP_SINGLE:
- if (mtr->bigbuf==NULL) /* no frame buffer allocated */
+ if (mtr->bigbuf==0) /* no frame buffer allocated */
return(ENOMEM);
if (temp & METEOR_CAP_MASK)
@@ -1586,7 +1586,7 @@ meteor_ioctl(dev_t dev, int cmd, caddr_t arg, int flag, struct proc *pr)
mtr->flags &= ~(METEOR_SINGLE|METEOR_WANT_MASK);
break;
case METEOR_CAP_CONTINOUS:
- if (mtr->bigbuf==NULL) /* no frame buffer allocated */
+ if (mtr->bigbuf==0) /* no frame buffer allocated */
return(ENOMEM);
if (temp & METEOR_CAP_MASK)
@@ -1618,7 +1618,7 @@ meteor_ioctl(dev_t dev, int cmd, caddr_t arg, int flag, struct proc *pr)
return(EIO);
if (mtr->flags & (METEOR_YUV_PLANAR | METEOR_YUV_422)) /* XXX */
return(EINVAL); /* should fix intr so we allow these */
- if (mtr->bigbuf == NULL)
+ if (mtr->bigbuf == 0)
return(ENOMEM);
if ((mtr->frames < 2) ||
(frame->lowat < 1 || frame->lowat >= mtr->frames) ||
@@ -1723,7 +1723,7 @@ meteor_ioctl(dev_t dev, int cmd, caddr_t arg, int flag, struct proc *pr)
#endif
) {
buf = get_meteor_mem(unit, temp*PAGE_SIZE);
- if(buf != NULL) {
+ if(buf != 0) {
kmem_free(kernel_map, mtr->bigbuf,
(mtr->alloc_pages * PAGE_SIZE));
mtr->bigbuf = buf;
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c
index 24223d3..7da014e 100644
--- a/sys/scsi/scsiconf.c
+++ b/sys/scsi/scsiconf.c
@@ -16,7 +16,7 @@
*
* New configuration setup: dufault@hda.com
*
- * $Id: scsiconf.c,v 1.59 1996/06/03 14:25:11 jfieber Exp $
+ * $Id: scsiconf.c,v 1.60 1996/06/14 11:02:16 asami Exp $
*/
#include "opt_scsi.h"
@@ -407,10 +407,6 @@ static struct scsi_device probe_switch =
NULL,
NULL,
"probe",
- 0,
- {0, 0},
- NULL,
- 0
};
/*
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 7450088..fd10f11 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_alloc.c 8.8 (Berkeley) 2/21/94
- * $Id: ffs_alloc.c,v 1.23 1996/01/05 18:31:45 wollman Exp $
+ * $Id: ffs_alloc.c,v 1.24 1996/05/08 04:29:07 gpalmer Exp $
*/
#include "opt_quota.h"
@@ -654,7 +654,7 @@ ffs_blkpref(ip, lbn, indx, bap)
fs->fs_cgrotor = cg;
return (fs->fs_fpg * cg + fs->fs_frag);
}
- return (NULL);
+ return (0);
}
/*
* One or more previous blocks have been laid out. If less
@@ -756,30 +756,30 @@ ffs_fragextend(ip, cg, bprev, osize, nsize)
fs = ip->i_fs;
if (fs->fs_cs(fs, cg).cs_nffree < numfrags(fs, nsize - osize))
- return (NULL);
+ return (0);
frags = numfrags(fs, nsize);
bbase = fragnum(fs, bprev);
if (bbase > fragnum(fs, (bprev + frags - 1))) {
/* cannot extend across a block boundary */
- return (NULL);
+ return (0);
}
error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)),
(int)fs->fs_cgsize, NOCRED, &bp);
if (error) {
brelse(bp);
- return (NULL);
+ return (0);
}
cgp = (struct cg *)bp->b_data;
if (!cg_chkmagic(cgp)) {
brelse(bp);
- return (NULL);
+ return (0);
}
cgp->cg_time = time.tv_sec;
bno = dtogd(fs, bprev);
for (i = numfrags(fs, osize); i < frags; i++)
if (isclr(cg_blksfree(cgp), bno + i)) {
brelse(bp);
- return (NULL);
+ return (0);
}
/*
* the current fragment can be extended
@@ -825,18 +825,18 @@ ffs_alloccg(ip, cg, bpref, size)
fs = ip->i_fs;
if (fs->fs_cs(fs, cg).cs_nbfree == 0 && size == fs->fs_bsize)
- return (NULL);
+ return (0);
error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)),
(int)fs->fs_cgsize, NOCRED, &bp);
if (error) {
brelse(bp);
- return (NULL);
+ return (0);
}
cgp = (struct cg *)bp->b_data;
if (!cg_chkmagic(cgp) ||
(cgp->cg_cs.cs_nbfree == 0 && size == fs->fs_bsize)) {
brelse(bp);
- return (NULL);
+ return (0);
}
cgp->cg_time = time.tv_sec;
if (size == fs->fs_bsize) {
@@ -860,7 +860,7 @@ ffs_alloccg(ip, cg, bpref, size)
*/
if (cgp->cg_cs.cs_nbfree == 0) {
brelse(bp);
- return (NULL);
+ return (0);
}
bno = ffs_alloccgblk(fs, cgp, bpref);
bpref = dtogd(fs, bno);
@@ -878,7 +878,7 @@ ffs_alloccg(ip, cg, bpref, size)
bno = ffs_mapsearch(fs, cgp, bpref, allocsiz);
if (bno < 0) {
brelse(bp);
- return (NULL);
+ return (0);
}
for (i = 0; i < frags; i++)
clrbit(cg_blksfree(cgp), bno + i);
@@ -992,7 +992,7 @@ norot:
*/
bno = ffs_mapsearch(fs, cgp, bpref, (int)fs->fs_frag);
if (bno < 0)
- return (NULL);
+ return (0);
cgp->cg_rotor = bno;
gotit:
blkno = fragstoblks(fs, bno);
@@ -1122,17 +1122,17 @@ ffs_nodealloccg(ip, cg, ipref, mode)
fs = ip->i_fs;
if (fs->fs_cs(fs, cg).cs_nifree == 0)
- return (NULL);
+ return (0);
error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)),
(int)fs->fs_cgsize, NOCRED, &bp);
if (error) {
brelse(bp);
- return (NULL);
+ return (0);
}
cgp = (struct cg *)bp->b_data;
if (!cg_chkmagic(cgp) || cgp->cg_cs.cs_nifree == 0) {
brelse(bp);
- return (NULL);
+ return (0);
}
cgp->cg_time = time.tv_sec;
if (ipref) {
diff --git a/sys/ufs/lfs/lfs_bio.c b/sys/ufs/lfs/lfs_bio.c
index 4816ab2..e184936 100644
--- a/sys/ufs/lfs/lfs_bio.c
+++ b/sys/ufs/lfs/lfs_bio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)lfs_bio.c 8.4 (Berkeley) 12/30/93
- * $Id: lfs_bio.c,v 1.7 1995/12/03 11:16:35 bde Exp $
+ * $Id: lfs_bio.c,v 1.8 1995/12/17 21:09:46 phk Exp $
*/
#include <sys/param.h>
@@ -103,7 +103,7 @@ lfs_bwrite(ap)
/* Out of space, need cleaner to run */
wakeup(&lfs_allclean_wakeup);
error = tsleep(&fs->lfs_avail, PCATCH | PUSER,
- "cleaner", NULL);
+ "cleaner", 0);
if (error) {
brelse(bp);
return (error);
diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c
index 31c73df..c033872 100644
--- a/sys/vm/vm_swap.c
+++ b/sys/vm/vm_swap.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)vm_swap.c 8.5 (Berkeley) 2/17/94
- * $Id: vm_swap.c,v 1.37 1996/03/28 14:36:48 scrappy Exp $
+ * $Id: vm_swap.c,v 1.38 1996/03/28 15:40:17 bde Exp $
*/
#include <sys/param.h>
@@ -64,7 +64,7 @@ extern struct cdevsw sw_cdevsw ;
static struct bdevsw sw_bdevsw =
{ noopen, noclose, swstrategy, noioc, /*1*/
- nodump, nopsize, NULL, "sw", &sw_cdevsw, -1 };
+ nodump, nopsize, 0, "sw", &sw_cdevsw, -1 };
static struct cdevsw sw_cdevsw =
{ nullopen, nullclose, rawread, rawwrite, /*4*/
OpenPOWER on IntegriCloud