mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-01 00:18:15 +01:00
Don't use NULL in non-pointer contexts.
This commit is contained in:
parent
746a432165
commit
6ab46d52a5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=17108
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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*/
|
||||
|
Loading…
Reference in New Issue
Block a user