Replace (ab)uses of "NULL" where "0" is really meant.
This commit is contained in:
parent
b87a69181e
commit
4a6a94d8d8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=102291
@ -44,13 +44,13 @@ AcpiOsInitialize(void)
|
||||
*/
|
||||
PnPBIOStable = NULL;
|
||||
|
||||
return(NULL);
|
||||
return(0);
|
||||
}
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiOsTerminate(void)
|
||||
{
|
||||
return(NULL);
|
||||
return(0);
|
||||
}
|
||||
|
||||
ACPI_STATUS
|
||||
|
@ -188,7 +188,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
|
||||
int pteobj_allocated = 0;
|
||||
u_long ef;
|
||||
|
||||
if (sc->acpi_wakeaddr == NULL) {
|
||||
if (sc->acpi_wakeaddr == 0) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -148,7 +148,7 @@ pecoff_fixup(register_t ** stack_base, struct image_params * imgp)
|
||||
pos = *stack_base + (imgp->argc + imgp->envc + 2);
|
||||
ap = (struct pecoff_imghdr *) imgp->auxargs;
|
||||
if (copyout(ap, pos, len)) {
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
free(ap, M_TEMP);
|
||||
imgp->auxargs = NULL;
|
||||
|
@ -1712,7 +1712,7 @@ ASR_queue(
|
||||
I2O_SGL_FLAGS_SIMPLE_ADDRESS_ELEMENT | (Flags)); \
|
||||
I2O_SGE_SIMPLE_ELEMENT_setPhysicalAddress( \
|
||||
&(((PI2O_SG_ELEMENT)(SGL))->u.Simple[Index]), \
|
||||
(Buffer == NULL) ? NULL : KVTOPHYS(Buffer))
|
||||
(Buffer == NULL) ? 0 : KVTOPHYS(Buffer))
|
||||
|
||||
/*
|
||||
* Retrieve Parameter Group.
|
||||
|
@ -241,7 +241,7 @@ static struct
|
||||
{ 0x0e11, 0x4070, CISS_BOARD_SA5, "Compaq Smart Array 5300" },
|
||||
{ 0x0e11, 0x4080, CISS_BOARD_SA5B, "Compaq Smart Array 5i" },
|
||||
{ 0x0e11, 0x4082, CISS_BOARD_SA5B, "Compaq Smart Array 532" },
|
||||
{ 0, 0, NULL }
|
||||
{ 0, 0, 0, NULL }
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
|
@ -114,7 +114,7 @@ digi_isa_check(struct digi_softc *sc)
|
||||
outb(sc->port, FEPRST);
|
||||
for (i = 0; (inb(sc->port) & FEPMASK) != FEPRST; i++) {
|
||||
if (i == hz / 10)
|
||||
return (NULL);
|
||||
return (0);
|
||||
digi_delay(sc, "digirst", 1);
|
||||
}
|
||||
DLOG(DIGIDB_INIT, (sc->dev, "got reset after %d iterations\n", i));
|
||||
@ -188,7 +188,7 @@ digi_isa_check(struct digi_softc *sc)
|
||||
|
||||
if (ident & 0x1) {
|
||||
device_printf(sc->dev, "PC/Xm is unsupported\n");
|
||||
return (NULL);
|
||||
return (0);
|
||||
}
|
||||
|
||||
sc->mem_seg = 0xf000;
|
||||
|
@ -119,7 +119,7 @@ static struct gx_device gx_devs[] = {
|
||||
8 | 8 << 10 | 6 << 20,
|
||||
"Intel Gigabit Ethernet (82544GC-T)" },
|
||||
#endif
|
||||
{ 0, 0, 0, NULL }
|
||||
{ 0, 0, 0, 0, NULL }
|
||||
};
|
||||
|
||||
static struct gx_regs new_regs = {
|
||||
|
@ -406,7 +406,7 @@ fore_buf_supply_1s(fup)
|
||||
bdp->bsd_handle = bhp;
|
||||
KB_DATASTART(m, cp, caddr_t);
|
||||
bhp->bh_dma = bdp->bsd_buffer = vtophys(cp);
|
||||
if (bdp->bsd_buffer == NULL) {
|
||||
if (bdp->bsd_buffer == 0) {
|
||||
/*
|
||||
* Unable to assign dma address - free up
|
||||
* this descriptor's buffer
|
||||
@ -546,7 +546,7 @@ fore_buf_supply_1l(fup)
|
||||
bdp->bsd_handle = bhp;
|
||||
KB_DATASTART(m, cp, caddr_t);
|
||||
bhp->bh_dma = bdp->bsd_buffer = vtophys(cp);
|
||||
if (bdp->bsd_buffer == NULL) {
|
||||
if (bdp->bsd_buffer == 0) {
|
||||
/*
|
||||
* Unable to assign dma address - free up
|
||||
* this descriptor's buffer
|
||||
|
@ -349,7 +349,7 @@ s_write(struct indir *ip, off_t offset, uintptr_t ptr)
|
||||
up = lip[li]->array[idx];
|
||||
KASSERT(up == (uintptr_t)cip, ("md screwed up"));
|
||||
del_indir(cip);
|
||||
lip[li]->array[idx] = NULL;
|
||||
lip[li]->array[idx] = 0;
|
||||
lip[li]->used--;
|
||||
cip = lip[li];
|
||||
}
|
||||
|
@ -1505,11 +1505,11 @@ mly_start(struct mly_command *mc)
|
||||
/* copy in new command */
|
||||
bcopy(mc->mc_packet->mmbox.data, pkt->mmbox.data, sizeof(pkt->mmbox.data));
|
||||
/* barrier to ensure completion of previous write before we write the flag */
|
||||
bus_space_barrier(NULL, NULL, 0, 0, BUS_SPACE_BARRIER_WRITE); /* tag/handle? */
|
||||
bus_space_barrier(0, 0, 0, 0, BUS_SPACE_BARRIER_WRITE); /* tag/handle? */
|
||||
/* copy flag last */
|
||||
pkt->mmbox.flag = mc->mc_packet->mmbox.flag;
|
||||
/* barrier to ensure completion of previous write before we notify the controller */
|
||||
bus_space_barrier(NULL, NULL, 0, 0, BUS_SPACE_BARRIER_WRITE); /* tag/handle */
|
||||
bus_space_barrier(0, 0, 0, 0, BUS_SPACE_BARRIER_WRITE); /* tag/handle */
|
||||
|
||||
/* signal controller, update index */
|
||||
MLY_SET_REG(sc, sc->mly_idbr, MLY_AM_CMDSENT);
|
||||
|
@ -727,7 +727,7 @@ nsp_setup_fifo(sc, on, direction, datalen)
|
||||
/* determine a transfer type */
|
||||
if (datalen < DEV_BSIZE || (datalen & 3) != 0)
|
||||
{
|
||||
if (sc->sc_memh != NULL &&
|
||||
if (sc->sc_memh != 0 &&
|
||||
(nsp_io_control & NSP_USE_MEMIO) != 0)
|
||||
xfermode = XFERMR_XEN | XFERMR_MEM8;
|
||||
else
|
||||
@ -735,7 +735,7 @@ nsp_setup_fifo(sc, on, direction, datalen)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sc->sc_memh != NULL &&
|
||||
if (sc->sc_memh != 0 &&
|
||||
(nsp_io_control & NSP_USE_MEMIO) != 0)
|
||||
xfermode = XFERMR_XEN | XFERMR_MEM32;
|
||||
else
|
||||
|
@ -1124,7 +1124,7 @@ chn_buildfeeder(struct pcm_channel *c)
|
||||
} else {
|
||||
if (c->direction == PCMDIR_REC) {
|
||||
tmp[0] = c->format;
|
||||
tmp[1] = NULL;
|
||||
tmp[1] = 0;
|
||||
hwfmt = chn_fmtchain(c, tmp);
|
||||
} else {
|
||||
hwfmt = chn_fmtchain(c, chn_getcaps(c)->fmtlist);
|
||||
|
@ -824,7 +824,7 @@ twe_init_connection(struct twe_softc *sc, int mode)
|
||||
|
||||
/* get a command */
|
||||
if (twe_get_request(sc, &tr))
|
||||
return(NULL);
|
||||
return(0);
|
||||
|
||||
/* build the command */
|
||||
cmd = &tr->tr_command;
|
||||
|
@ -289,7 +289,7 @@ usbd_get_report(usbd_interface_handle iface, int type, int id, void *data,
|
||||
usb_device_request_t req;
|
||||
|
||||
DPRINTFN(4, ("usbd_set_report: len=%d\n", len));
|
||||
if (id == NULL)
|
||||
if (id == 0)
|
||||
return (USBD_IOERROR);
|
||||
usbd_interface2device_handle(iface, &dev);
|
||||
req.bmRequestType = UT_READ_CLASS_INTERFACE;
|
||||
|
@ -44,13 +44,13 @@ AcpiOsInitialize(void)
|
||||
*/
|
||||
PnPBIOStable = NULL;
|
||||
|
||||
return(NULL);
|
||||
return(0);
|
||||
}
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiOsTerminate(void)
|
||||
{
|
||||
return(NULL);
|
||||
return(0);
|
||||
}
|
||||
|
||||
ACPI_STATUS
|
||||
|
@ -188,7 +188,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
|
||||
int pteobj_allocated = 0;
|
||||
u_long ef;
|
||||
|
||||
if (sc->acpi_wakeaddr == NULL) {
|
||||
if (sc->acpi_wakeaddr == 0) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -1979,7 +1979,7 @@ lio_listio(struct thread *td, struct lio_listio_args *uap)
|
||||
cbptr = uap->acb_list;
|
||||
for (i = 0; i < uap->nent; i++) {
|
||||
iocb = (struct aiocb *)(intptr_t)fuword(&cbptr[i]);
|
||||
if (((intptr_t)iocb != -1) && ((intptr_t)iocb != NULL)) {
|
||||
if (((intptr_t)iocb != -1) && ((intptr_t)iocb != 0)) {
|
||||
error = _aio_aqueue(td, iocb, lj, 0);
|
||||
if (error == 0)
|
||||
nentqueued++;
|
||||
|
@ -253,7 +253,7 @@ iso88025_output(ifp, m, dst, rt0)
|
||||
|
||||
/* Calculate routing info length based on arp table entry */
|
||||
if (rt && (sdl = (struct sockaddr_dl *)rt->rt_gateway))
|
||||
if (SDL_ISO88025(sdl)->trld_rcf != NULL)
|
||||
if (SDL_ISO88025(sdl)->trld_rcf != 0)
|
||||
rif_len = TR_RCF_RIFLEN(SDL_ISO88025(sdl)->trld_rcf);
|
||||
|
||||
/* Generate a generic 802.5 header for the packet */
|
||||
|
@ -971,7 +971,7 @@ tcp6_connect(tp, nam, td)
|
||||
inp->in6p_laddr = *addr6;
|
||||
inp->in6p_faddr = sin6->sin6_addr;
|
||||
inp->inp_fport = sin6->sin6_port;
|
||||
if ((sin6->sin6_flowinfo & IPV6_FLOWINFO_MASK) != NULL)
|
||||
if ((sin6->sin6_flowinfo & IPV6_FLOWINFO_MASK) != 0)
|
||||
inp->in6p_flowinfo = sin6->sin6_flowinfo;
|
||||
in_pcbrehash(inp);
|
||||
|
||||
@ -1163,7 +1163,7 @@ tcp_attach(so, td)
|
||||
struct inpcb *inp;
|
||||
int error;
|
||||
#ifdef INET6
|
||||
int isipv6 = INP_CHECK_SOCKAF(so, AF_INET6) != NULL;
|
||||
int isipv6 = INP_CHECK_SOCKAF(so, AF_INET6) != 0;
|
||||
#endif
|
||||
|
||||
if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) {
|
||||
|
@ -1796,7 +1796,7 @@ pim6_input(mp, offp, proto)
|
||||
#endif
|
||||
|
||||
rc = if_simloop(mif6table[reg_mif_num].m6_ifp, m,
|
||||
dst.sin6_family, NULL);
|
||||
dst.sin6_family, 0);
|
||||
|
||||
/* prepare the register head to send to the mrouting daemon */
|
||||
m = mcp;
|
||||
|
@ -1296,10 +1296,10 @@ ip6_ctloutput(so, sopt)
|
||||
struct mbuf *m;
|
||||
|
||||
error = soopt_getm(sopt, &m); /* XXX */
|
||||
if (error != NULL)
|
||||
if (error != 0)
|
||||
break;
|
||||
error = soopt_mcopyin(sopt, m); /* XXX */
|
||||
if (error != NULL)
|
||||
if (error != 0)
|
||||
break;
|
||||
error = ip6_pcbopts(&in6p->in6p_outputopts,
|
||||
m, so, sopt);
|
||||
@ -1646,10 +1646,10 @@ do { \
|
||||
struct mbuf **mp = &m;
|
||||
|
||||
error = soopt_getm(sopt, &m); /* XXX */
|
||||
if (error != NULL)
|
||||
if (error != 0)
|
||||
break;
|
||||
error = soopt_mcopyin(sopt, m); /* XXX */
|
||||
if (error != NULL)
|
||||
if (error != 0)
|
||||
break;
|
||||
if (m) {
|
||||
req = mtod(m, caddr_t);
|
||||
@ -2496,7 +2496,7 @@ ip6_mloopback(ifp, m, dst)
|
||||
in6_clearscope(&ip6->ip6_dst);
|
||||
#endif
|
||||
|
||||
(void)if_simloop(ifp, copym, dst->sin6_family, NULL);
|
||||
(void)if_simloop(ifp, copym, dst->sin6_family, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user