sys/dev: Replace zero with NULL for pointers.
Makes things easier to read, plus architectures may set NULL to something different than zero. Found with: devel/coccinelle MFC after: 3 weeks
This commit is contained in:
parent
85161825cf
commit
4d24901ac9
@ -820,7 +820,7 @@ agp_close(struct cdev *kdev, int fflag, int devtype, struct thread *td)
|
||||
/*
|
||||
* Clear the GATT and force release on last close
|
||||
*/
|
||||
while ((mem = TAILQ_FIRST(&sc->as_memory)) != 0) {
|
||||
while ((mem = TAILQ_FIRST(&sc->as_memory)) != NULL) {
|
||||
if (mem->am_is_bound)
|
||||
AGP_UNBIND_MEMORY(dev, mem);
|
||||
AGP_FREE_MEMORY(dev, mem);
|
||||
|
@ -2009,7 +2009,7 @@ al_eth_enable_msix(struct al_eth_adapter *adapter)
|
||||
adapter->msix_entries = malloc(msix_vecs*sizeof(*adapter->msix_entries),
|
||||
M_IFAL, M_ZERO | M_WAITOK);
|
||||
|
||||
if (adapter->msix_entries == 0) {
|
||||
if (adapter->msix_entries == NULL) {
|
||||
device_printf_dbg(adapter->dev, "failed to allocate"
|
||||
" msix_entries %d\n", msix_vecs);
|
||||
rc = ENOMEM;
|
||||
@ -3544,7 +3544,7 @@ al_miibus_linkchg(device_t dev)
|
||||
uint8_t duplex = 0;
|
||||
uint8_t speed = 0;
|
||||
|
||||
if (adapter->mii == 0)
|
||||
if (adapter->mii == NULL)
|
||||
return;
|
||||
|
||||
if ((adapter->netdev->if_flags & IFF_UP) == 0)
|
||||
|
@ -1168,7 +1168,7 @@ al_eth_lm_link_detection(struct al_eth_lm_context *lm_context,
|
||||
boolean_t lm_pause = lm_context->lm_pause(lm_context->i2c_context);
|
||||
if (lm_pause == TRUE) {
|
||||
*new_mode = AL_ETH_LM_MODE_DISCONNECTED;
|
||||
if (link_fault != 0) {
|
||||
if (link_fault != NULL) {
|
||||
if (lm_context->link_state == AL_ETH_LM_LINK_UP)
|
||||
*link_fault = FALSE;
|
||||
else
|
||||
|
@ -3057,7 +3057,7 @@ static void
|
||||
an_cache_store(struct an_softc *sc, struct ether_header *eh, struct mbuf *m,
|
||||
u_int8_t rx_rssi, u_int8_t rx_quality)
|
||||
{
|
||||
struct ip *ip = 0;
|
||||
struct ip *ip = NULL;
|
||||
int i;
|
||||
static int cache_slot = 0; /* use this cache entry */
|
||||
static int wrapindex = 0; /* next "free" cache entry */
|
||||
|
@ -1398,8 +1398,8 @@ static u_int32_t arcmsr_Read_iop_rqbuffer_data_D(struct AdapterControlBlock *acb
|
||||
struct QBUFFER *prbuffer) {
|
||||
|
||||
u_int8_t *pQbuffer;
|
||||
u_int8_t *buf1 = 0;
|
||||
u_int32_t *iop_data, *buf2 = 0;
|
||||
u_int8_t *buf1 = NULL;
|
||||
u_int32_t *iop_data, *buf2 = NULL;
|
||||
u_int32_t iop_len, data_len;
|
||||
|
||||
iop_data = (u_int32_t *)prbuffer->data;
|
||||
@ -1494,8 +1494,8 @@ static void arcmsr_Write_data_2iop_wqbuffer_D(struct AdapterControlBlock *acb)
|
||||
{
|
||||
u_int8_t *pQbuffer;
|
||||
struct QBUFFER *pwbuffer;
|
||||
u_int8_t *buf1 = 0;
|
||||
u_int32_t *iop_data, *buf2 = 0;
|
||||
u_int8_t *buf1 = NULL;
|
||||
u_int32_t *iop_data, *buf2 = NULL;
|
||||
u_int32_t allxfer_len = 0, data_len;
|
||||
|
||||
if(acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_READ) {
|
||||
|
@ -2800,7 +2800,7 @@ bce_nvram_write(struct bce_softc *sc, u32 offset, u8 *data_buf,
|
||||
|
||||
if (align_start || align_end) {
|
||||
buf = malloc(len32, M_DEVBUF, M_NOWAIT);
|
||||
if (buf == 0) {
|
||||
if (buf == NULL) {
|
||||
rc = ENOMEM;
|
||||
goto bce_nvram_write_exit;
|
||||
}
|
||||
|
@ -457,7 +457,7 @@ beri_ioctl(struct cdev *dev, u_long cmd, caddr_t addr,
|
||||
sc->opened = 1;
|
||||
break;
|
||||
case MDIOCDETACH:
|
||||
if (sc->vnode == 0) {
|
||||
if (sc->vnode == NULL) {
|
||||
/* File not opened */
|
||||
return (1);
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ bhnd_usb_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
|
||||
rv = rman_reserve_resource(&sc->mem_rman, start, end, count,
|
||||
flags, child);
|
||||
if (rv == 0) {
|
||||
if (rv == NULL) {
|
||||
BHND_ERROR_DEV(bus, "could not reserve resource");
|
||||
return (0);
|
||||
}
|
||||
@ -312,7 +312,7 @@ bhnd_usb_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
|
||||
rv = rman_reserve_resource(&sc->irq_rman, start, end, count,
|
||||
flags, child);
|
||||
if (rv == 0) {
|
||||
if (rv == NULL) {
|
||||
BHND_ERROR_DEV(bus, "could not reserve resource");
|
||||
return (0);
|
||||
}
|
||||
|
@ -58,8 +58,8 @@ static int
|
||||
bt_pci_alloc_resources(device_t dev)
|
||||
{
|
||||
int type = 0, rid, zero;
|
||||
struct resource *regs = 0;
|
||||
struct resource *irq = 0;
|
||||
struct resource *regs = NULL;
|
||||
struct resource *irq = NULL;
|
||||
|
||||
#if 0
|
||||
/* XXX Memory Mapped I/O seems to cause problems */
|
||||
|
@ -840,11 +840,11 @@ static int ce_detach (device_t dev)
|
||||
if (! d || ! d->chan)
|
||||
continue;
|
||||
callout_drain (&d->timeout_handle);
|
||||
channel [b->num * NCHAN + c->num] = 0;
|
||||
channel [b->num * NCHAN + c->num] = NULL;
|
||||
/* Deallocate buffers. */
|
||||
ce_bus_dma_mem_free (&d->dmamem);
|
||||
}
|
||||
adapter [b->num] = 0;
|
||||
adapter [b->num] = NULL;
|
||||
ce_bus_dma_mem_free (&bd->dmamem);
|
||||
free (b, M_DEVBUF);
|
||||
#if __FreeBSD_version >= 504000
|
||||
|
@ -373,7 +373,7 @@ cm_start_locked(ifp)
|
||||
m = arc_frag_next(ifp);
|
||||
buffer = sc->sc_tx_act ^ 1;
|
||||
|
||||
if (m == 0)
|
||||
if (m == NULL)
|
||||
return;
|
||||
|
||||
#ifdef CM_DEBUG
|
||||
@ -388,7 +388,7 @@ cm_start_locked(ifp)
|
||||
#endif
|
||||
cm_ram_ptr = buffer * 512;
|
||||
|
||||
if (m == 0)
|
||||
if (m == NULL)
|
||||
return;
|
||||
|
||||
/* write the addresses to RAM and throw them away */
|
||||
@ -505,7 +505,7 @@ cm_srint_locked(vsc)
|
||||
/* Allocate header mbuf */
|
||||
MGETHDR(m, M_NOWAIT, MT_DATA);
|
||||
|
||||
if (m == 0) {
|
||||
if (m == NULL) {
|
||||
/*
|
||||
* in case s.th. goes wrong with mem, drop it
|
||||
* to make sure the receiver can be started again
|
||||
@ -546,7 +546,7 @@ cm_srint_locked(vsc)
|
||||
}
|
||||
}
|
||||
|
||||
if (m == 0) {
|
||||
if (m == NULL) {
|
||||
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -628,11 +628,11 @@ static int cp_detach (device_t dev)
|
||||
if (! d || ! d->chan->type)
|
||||
continue;
|
||||
callout_drain (&d->timeout_handle);
|
||||
channel [b->num*NCHAN + c->num] = 0;
|
||||
channel [b->num*NCHAN + c->num] = NULL;
|
||||
/* Deallocate buffers. */
|
||||
cp_bus_dma_mem_free (&d->dmamem);
|
||||
}
|
||||
adapter [b->num] = 0;
|
||||
adapter [b->num] = NULL;
|
||||
cp_bus_dma_mem_free (&bd->dmamem);
|
||||
free (b, M_DEVBUF);
|
||||
mtx_destroy (&bd->cp_mtx);
|
||||
|
@ -104,7 +104,7 @@ int ct_open_board (ct_board_t *b, int num, port_t port, int irq, int dma)
|
||||
case B_TAU2_E1D:
|
||||
fw = ctau2_fw_data;
|
||||
flen = 0;
|
||||
ft = 0;
|
||||
ft = NULL;
|
||||
break;
|
||||
#ifndef CT_DDK_NO_G703
|
||||
case B_TAU_G703:
|
||||
|
@ -839,8 +839,8 @@ static int ct_detach (device_t dev)
|
||||
/* Deallocate buffers. */
|
||||
ct_bus_dma_mem_free (&d->dmamem);
|
||||
}
|
||||
bd->board = 0;
|
||||
adapter [b->num] = 0;
|
||||
bd->board = NULL;
|
||||
adapter [b->num] = NULL;
|
||||
free (b, M_DEVBUF);
|
||||
|
||||
mtx_destroy (&bd->ct_mtx);
|
||||
|
@ -440,7 +440,7 @@ static int cx_receive_interrupt (cx_chan_t *c)
|
||||
if (c->mode == M_ASYNC && (risr & RISA_TIMEOUT)) {
|
||||
unsigned long rcbadr = (unsigned short) inw (RCBADRL(c->port)) |
|
||||
(long) inw (RCBADRU(c->port)) << 16;
|
||||
unsigned char *buf = 0;
|
||||
unsigned char *buf = NULL;
|
||||
port_t cnt_port = 0, sts_port = 0;
|
||||
|
||||
if (rcbadr >= c->brphys && rcbadr < c->brphys+DMABUFSZ) {
|
||||
|
@ -991,8 +991,8 @@ static int cx_detach (device_t dev)
|
||||
/* Deallocate buffers. */
|
||||
cx_bus_dma_mem_free (&d->dmamem);
|
||||
}
|
||||
bd->board = 0;
|
||||
adapter [b->num] = 0;
|
||||
bd->board = NULL;
|
||||
adapter [b->num] = NULL;
|
||||
free (b, M_DEVBUF);
|
||||
splx (s);
|
||||
|
||||
|
@ -4887,8 +4887,8 @@ tulip_pci_attach(device_t dev)
|
||||
rid = 0;
|
||||
res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
|
||||
RF_SHAREABLE | RF_ACTIVE);
|
||||
if (res == 0 || bus_setup_intr(dev, res, INTR_TYPE_NET |
|
||||
INTR_MPSAFE, NULL, intr_rtn, sc, &ih)) {
|
||||
if (res == NULL || bus_setup_intr(dev, res, INTR_TYPE_NET |
|
||||
INTR_MPSAFE, NULL, intr_rtn, sc, &ih)) {
|
||||
device_printf(dev, "couldn't map interrupt\n");
|
||||
tulip_busdma_cleanup(sc);
|
||||
ether_ifdetach(sc->tulip_ifp);
|
||||
|
@ -751,7 +751,7 @@ outloop:
|
||||
return;
|
||||
}
|
||||
IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
|
||||
if (m == 0) {
|
||||
if (m == NULL) {
|
||||
|
||||
/*
|
||||
* We are using the !OACTIVE flag to indicate to the outside
|
||||
|
@ -1501,7 +1501,7 @@ fatm_intr_drain_rx(struct fatm_softc *sc)
|
||||
|
||||
rpd->nseg = le32toh(rpd->nseg);
|
||||
mlen = 0;
|
||||
m0 = last = 0;
|
||||
m0 = last = NULL;
|
||||
for (i = 0; i < rpd->nseg; i++) {
|
||||
rb = sc->rbufs + rpd->segment[i].handle;
|
||||
if (m0 == NULL) {
|
||||
|
@ -2002,7 +2002,7 @@ fe_write_mbufs (struct fe_softc *sc, struct mbuf *m)
|
||||
if ((sc->proto_dlcr6 & FE_D6_SBW) == FE_D6_SBW_BYTE)
|
||||
{
|
||||
/* 8-bit cards are easy. */
|
||||
for (mp = m; mp != 0; mp = mp->m_next) {
|
||||
for (mp = m; mp != NULL; mp = mp->m_next) {
|
||||
if (mp->m_len)
|
||||
fe_outsb(sc, FE_BMPR8, mtod(mp, caddr_t),
|
||||
mp->m_len);
|
||||
@ -2012,7 +2012,7 @@ fe_write_mbufs (struct fe_softc *sc, struct mbuf *m)
|
||||
{
|
||||
/* 16-bit cards are a pain. */
|
||||
savebyte = NO_PENDING_BYTE;
|
||||
for (mp = m; mp != 0; mp = mp->m_next) {
|
||||
for (mp = m; mp != NULL; mp = mp->m_next) {
|
||||
|
||||
/* Ignore empty mbuf. */
|
||||
len = mp->m_len;
|
||||
|
@ -575,7 +575,7 @@ fwip_async_output(struct fwip_softc *fwip, struct ifnet *ifp)
|
||||
*/
|
||||
mtag = m_tag_locate(m, MTAG_FIREWIRE, MTAG_FIREWIRE_HWADDR, 0);
|
||||
if (mtag == NULL)
|
||||
destfw = 0;
|
||||
destfw = NULL;
|
||||
else
|
||||
destfw = (struct fw_hwaddr *) (mtag + 1);
|
||||
|
||||
|
@ -330,7 +330,7 @@ static void hptiop_request_callback_itl(struct hpt_iop_hba * hba,
|
||||
u_int32_t index)
|
||||
{
|
||||
struct hpt_iop_srb *srb;
|
||||
struct hpt_iop_request_scsi_command *req=0;
|
||||
struct hpt_iop_request_scsi_command *req=NULL;
|
||||
union ccb *ccb;
|
||||
u_int8_t *cdb;
|
||||
u_int32_t result, temp, dxfer;
|
||||
|
@ -138,8 +138,8 @@ static MV_BOOLEAN hptmv_event_notify(MV_SATA_ADAPTER *pMvSataAdapter,
|
||||
|
||||
static struct sx hptmv_list_lock;
|
||||
SX_SYSINIT(hptmv_list_lock, &hptmv_list_lock, "hptmv list");
|
||||
IAL_ADAPTER_T *gIal_Adapter = 0;
|
||||
IAL_ADAPTER_T *pCurAdapter = 0;
|
||||
IAL_ADAPTER_T *gIal_Adapter = NULL;
|
||||
IAL_ADAPTER_T *pCurAdapter = NULL;
|
||||
static MV_SATA_CHANNEL gMvSataChannels[MAX_VBUS][MV_SATA_CHANNELS_NUM];
|
||||
|
||||
typedef struct st_HPT_DPC {
|
||||
@ -1262,7 +1262,7 @@ init_adapter(IAL_ADAPTER_T *pAdapter)
|
||||
sx_xlock(&hptmv_list_lock);
|
||||
pAdapter->next = 0;
|
||||
|
||||
if(gIal_Adapter == 0){
|
||||
if(gIal_Adapter == NULL){
|
||||
gIal_Adapter = pAdapter;
|
||||
pCurAdapter = gIal_Adapter;
|
||||
}
|
||||
@ -2427,7 +2427,7 @@ static void hpt_worker_thread(void)
|
||||
sx_slock(&hptmv_list_lock);
|
||||
pAdapter = gIal_Adapter;
|
||||
|
||||
while(pAdapter != 0){
|
||||
while(pAdapter != NULL){
|
||||
mtx_lock(&pAdapter->lock);
|
||||
_vbus_p = &pAdapter->VBus;
|
||||
|
||||
|
@ -74,7 +74,7 @@ check_VDevice_valid(PVDevice p)
|
||||
PVBus _vbus_p;
|
||||
IAL_ADAPTER_T *pAdapter = gIal_Adapter;
|
||||
|
||||
while(pAdapter != 0)
|
||||
while(pAdapter != NULL)
|
||||
{
|
||||
for (i = 0; i < MV_SATA_CHANNELS_NUM; i++)
|
||||
if(&(pAdapter->VDevices[i]) == p) return 0;
|
||||
@ -83,7 +83,7 @@ check_VDevice_valid(PVDevice p)
|
||||
|
||||
#ifdef SUPPORT_ARRAY
|
||||
pAdapter = gIal_Adapter;
|
||||
while(pAdapter != 0)
|
||||
while(pAdapter != NULL)
|
||||
{
|
||||
_vbus_p = &pAdapter->VBus;
|
||||
for (i=0;i<MAX_ARRAY_PER_VBUS;i++)
|
||||
@ -403,7 +403,7 @@ int hpt_get_controller_count(void)
|
||||
IAL_ADAPTER_T *pAdapTemp = gIal_Adapter;
|
||||
int iControllerCount = 0;
|
||||
|
||||
while(pAdapTemp != 0)
|
||||
while(pAdapTemp != NULL)
|
||||
{
|
||||
iControllerCount++;
|
||||
pAdapTemp = pAdapTemp->next;
|
||||
@ -448,7 +448,7 @@ int hpt_get_channel_info(int id, int bus, PCHANNEL_INFO pInfo)
|
||||
IAL_ADAPTER_T *pAdapTemp = gIal_Adapter;
|
||||
int i,iControllerCount = 0;
|
||||
|
||||
while(pAdapTemp != 0)
|
||||
while(pAdapTemp != NULL)
|
||||
{
|
||||
if (iControllerCount++==id)
|
||||
goto found;
|
||||
|
@ -427,7 +427,7 @@ static void
|
||||
hpt_copy_array_info(HPT_GET_INFO *pinfo, int nld, PVDevice pArray)
|
||||
{
|
||||
int i;
|
||||
char *sType=0, *sStatus=0;
|
||||
char *sType = NULL, *sStatus = NULL;
|
||||
char buf[32];
|
||||
PVDevice pTmpArray;
|
||||
|
||||
|
@ -691,7 +691,7 @@ hpt_rebuild_data_block(IAL_ADAPTER_T *pAdapter, PVDevice pArray, UCHAR flags)
|
||||
PCommand pCmd;
|
||||
UINT result;
|
||||
int needsync=0, retry=0, needdelete=0;
|
||||
void *buffer = 0;
|
||||
void *buffer = NULL;
|
||||
|
||||
_VBUS_INST(&pAdapter->VBus)
|
||||
|
||||
|
@ -251,7 +251,7 @@ icioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
|
||||
case SIOCADDMULTI:
|
||||
case SIOCDELMULTI:
|
||||
if (ifr == 0)
|
||||
if (ifr == NULL)
|
||||
return (EAFNOSUPPORT); /* XXX */
|
||||
switch (ifr->ifr_addr.sa_family) {
|
||||
case AF_INET:
|
||||
|
@ -583,10 +583,10 @@ isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp)
|
||||
name, &tval) == 0 && tval != 0) {
|
||||
isp->isp_confopts |= ISP_CFG_FULL_DUPLEX;
|
||||
}
|
||||
sptr = 0;
|
||||
sptr = NULL;
|
||||
snprintf(name, sizeof(name), "%stopology", prefix);
|
||||
if (resource_string_value(device_get_name(dev), device_get_unit(dev),
|
||||
name, (const char **) &sptr) == 0 && sptr != 0) {
|
||||
name, (const char **) &sptr) == 0 && sptr != NULL) {
|
||||
if (strcmp(sptr, "lport") == 0) {
|
||||
isp->isp_confopts |= ISP_CFG_LPORT;
|
||||
} else if (strcmp(sptr, "nport") == 0) {
|
||||
@ -631,12 +631,12 @@ isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp)
|
||||
* hint replacement to specify WWN strings with a leading
|
||||
* 'w' (e..g w50000000aaaa0001). Sigh.
|
||||
*/
|
||||
sptr = 0;
|
||||
sptr = NULL;
|
||||
snprintf(name, sizeof(name), "%sportwwn", prefix);
|
||||
tval = resource_string_value(device_get_name(dev), device_get_unit(dev),
|
||||
name, (const char **) &sptr);
|
||||
if (tval == 0 && sptr != 0 && *sptr++ == 'w') {
|
||||
char *eptr = 0;
|
||||
if (tval == 0 && sptr != NULL && *sptr++ == 'w') {
|
||||
char *eptr = NULL;
|
||||
ISP_FC_PC(isp, chan)->def_wwpn = strtouq(sptr, &eptr, 16);
|
||||
if (eptr < sptr + 16 || ISP_FC_PC(isp, chan)->def_wwpn == -1) {
|
||||
device_printf(dev, "mangled portwwn hint '%s'\n", sptr);
|
||||
@ -644,12 +644,12 @@ isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp)
|
||||
}
|
||||
}
|
||||
|
||||
sptr = 0;
|
||||
sptr = NULL;
|
||||
snprintf(name, sizeof(name), "%snodewwn", prefix);
|
||||
tval = resource_string_value(device_get_name(dev), device_get_unit(dev),
|
||||
name, (const char **) &sptr);
|
||||
if (tval == 0 && sptr != 0 && *sptr++ == 'w') {
|
||||
char *eptr = 0;
|
||||
if (tval == 0 && sptr != NULL && *sptr++ == 'w') {
|
||||
char *eptr = NULL;
|
||||
ISP_FC_PC(isp, chan)->def_wwnn = strtouq(sptr, &eptr, 16);
|
||||
if (eptr < sptr + 16 || ISP_FC_PC(isp, chan)->def_wwnn == 0) {
|
||||
device_printf(dev, "mangled nodewwn hint '%s'\n", sptr);
|
||||
|
@ -519,7 +519,7 @@ am7990_start_locked(struct lance_softc *sc)
|
||||
}
|
||||
|
||||
IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
|
||||
if (m == 0)
|
||||
if (m == NULL)
|
||||
break;
|
||||
|
||||
/*
|
||||
|
@ -557,7 +557,7 @@ am79900_start_locked(struct lance_softc *sc)
|
||||
}
|
||||
|
||||
IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
|
||||
if (m == 0)
|
||||
if (m == NULL)
|
||||
break;
|
||||
|
||||
/*
|
||||
|
@ -418,7 +418,7 @@ lance_get(struct lance_softc *sc, int boff, int totlen)
|
||||
totlen -= len;
|
||||
if (totlen > 0) {
|
||||
MGET(newm, M_NOWAIT, MT_DATA);
|
||||
if (newm == 0)
|
||||
if (newm == NULL)
|
||||
goto bad;
|
||||
len = MLEN;
|
||||
m = m->m_next = newm;
|
||||
|
@ -153,7 +153,7 @@ static g_access_t g_md_access;
|
||||
static void g_md_dumpconf(struct sbuf *sb, const char *indent,
|
||||
struct g_geom *gp, struct g_consumer *cp __unused, struct g_provider *pp);
|
||||
|
||||
static struct cdev *status_dev = 0;
|
||||
static struct cdev *status_dev = NULL;
|
||||
static struct sx md_sx;
|
||||
static struct unrhdr *md_uh;
|
||||
|
||||
|
@ -5206,7 +5206,7 @@ static void ncr_log_hard_error(ncb_p np, u_short sist, u_char dstat)
|
||||
} else {
|
||||
script_ofs = dsp;
|
||||
script_size = 0;
|
||||
script_base = 0;
|
||||
script_base = NULL;
|
||||
script_name = "mem";
|
||||
}
|
||||
|
||||
@ -5809,7 +5809,7 @@ static void ncr_int_sir (ncb_p np)
|
||||
u_char scntl3;
|
||||
u_char chg, ofs, per, fak, wide;
|
||||
u_char num = INB (nc_dsps);
|
||||
nccb_p cp=0;
|
||||
nccb_p cp = NULL;
|
||||
u_long dsa;
|
||||
u_int target = INB (nc_sdid) & 0x0f;
|
||||
tcb_p tp = &np->target[target];
|
||||
|
@ -648,7 +648,7 @@ nm_os_pt_memdev_iomap(struct ptnetmap_memdev *ptn_dev, vm_paddr_t *nm_paddr,
|
||||
&rid, 0, ~0, *mem_size, RF_ACTIVE);
|
||||
if (ptn_dev->pci_mem == NULL) {
|
||||
*nm_paddr = 0;
|
||||
*nm_addr = 0;
|
||||
*nm_addr = NULL;
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
|
@ -2143,7 +2143,7 @@ netmap_mem_pt_guest_deref(struct netmap_mem_d *nmd)
|
||||
if (ptnmd->ptn_dev) {
|
||||
nm_os_pt_memdev_iounmap(ptnmd->ptn_dev);
|
||||
}
|
||||
ptnmd->nm_addr = 0;
|
||||
ptnmd->nm_addr = NULL;
|
||||
ptnmd->nm_paddr = 0;
|
||||
}
|
||||
}
|
||||
|
@ -963,7 +963,7 @@ ofw_bus_string_list_to_array(phandle_t node, const char *list_name,
|
||||
i += len;
|
||||
tptr += len;
|
||||
}
|
||||
array[cnt] = 0;
|
||||
array[cnt] = NULL;
|
||||
*out_array = array;
|
||||
|
||||
return (cnt);
|
||||
|
@ -440,7 +440,7 @@ patm_tx_pad(struct patm_softc *sc, struct mbuf *m0)
|
||||
}
|
||||
}
|
||||
MGET(m, M_NOWAIT, MT_DATA);
|
||||
if (m == 0) {
|
||||
if (m == NULL) {
|
||||
m_freem(m0);
|
||||
if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1);
|
||||
return (NULL);
|
||||
|
@ -470,7 +470,7 @@ pccard_function_init(struct pccard_function *pf, int entry)
|
||||
struct pccard_ivar *devi = PCCARD_IVAR(pf->dev);
|
||||
struct resource_list *rl = &devi->resources;
|
||||
struct resource_list_entry *rle;
|
||||
struct resource *r = 0;
|
||||
struct resource *r = NULL;
|
||||
struct pccard_ce_iospace *ios;
|
||||
struct pccard_ce_memspace *mems;
|
||||
device_t bus;
|
||||
@ -1115,7 +1115,7 @@ pccard_alloc_resource(device_t dev, device_t child, int type, int *rid,
|
||||
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
|
||||
{
|
||||
struct pccard_ivar *dinfo;
|
||||
struct resource_list_entry *rle = 0;
|
||||
struct resource_list_entry *rle = NULL;
|
||||
int passthrough = (device_get_parent(child) != dev);
|
||||
int isdefault = (RMAN_IS_DEFAULT_RANGE(start, end) && count == 1);
|
||||
struct resource *r = NULL;
|
||||
@ -1165,7 +1165,7 @@ pccard_release_resource(device_t dev, device_t child, int type, int rid,
|
||||
{
|
||||
struct pccard_ivar *dinfo;
|
||||
int passthrough = (device_get_parent(child) != dev);
|
||||
struct resource_list_entry *rle = 0;
|
||||
struct resource_list_entry *rle = NULL;
|
||||
|
||||
if (passthrough)
|
||||
return BUS_RELEASE_RESOURCE(device_get_parent(dev), child,
|
||||
|
@ -48,7 +48,7 @@ bit32 gLLSoftResetCounter = 0;
|
||||
bit32 gPollForMissingInt;
|
||||
|
||||
#ifdef FW_EVT_LOG_TST
|
||||
void *eventLogAddress = 0;
|
||||
void *eventLogAddress = NULL;
|
||||
#endif
|
||||
|
||||
extern bit32 gWait_3;
|
||||
|
@ -379,7 +379,7 @@ tiCOMMgntIOCTL(
|
||||
bit32 Offset = 0;
|
||||
bit32 RequestLength = 0; /* user request on how much data to pass to application */
|
||||
agsaContext_t *agContext = NULL;
|
||||
bit8 *loc = 0;
|
||||
bit8 *loc = NULL;
|
||||
|
||||
TI_DBG3(("tiCOMMgntIOCTL: start\n"));
|
||||
|
||||
|
@ -5032,7 +5032,7 @@ STATIC void agtiapi_PrepCCBs( struct agtiapi_softc *pCard,
|
||||
|
||||
int i;
|
||||
U32 hdr_sz, ccb_sz;
|
||||
ccb_t *pccb = 0;
|
||||
ccb_t *pccb = NULL;
|
||||
int offset = 0;
|
||||
int nsegs = 0;
|
||||
int sgl_sz = 0;
|
||||
@ -5159,7 +5159,7 @@ STATIC U32 agtiapi_InitCCBs(struct agtiapi_softc *pCard, int tgtCount, int tid)
|
||||
|
||||
U32 max_ccb, size, ccb_sz, hdr_sz;
|
||||
int no_allocs = 0, i;
|
||||
ccb_hdr_t *hdr = 0;
|
||||
ccb_hdr_t *hdr = NULL;
|
||||
|
||||
AGTIAPI_PRINTK("agtiapi_InitCCBs: start\n");
|
||||
AGTIAPI_PRINTK("agtiapi_InitCCBs: tgtCount %d tid %d\n", tgtCount, tid);
|
||||
@ -5395,7 +5395,7 @@ STATIC U32 agtiapi_GetDevHandle( struct agtiapi_softc *pCard,
|
||||
|
||||
for ( devIdx = 0; devIdx < pCard->devDiscover; devIdx++ )
|
||||
{
|
||||
if ( agDev[devIdx] != 0 )
|
||||
if ( agDev[devIdx] != NULL )
|
||||
{
|
||||
// AGTIAPI_PRINTK( "agtiapi_GetDevHandle: agDev %d not NULL %p\n",
|
||||
// devIdx, agDev[devIdx] );
|
||||
@ -5820,7 +5820,7 @@ STATIC void agtiapi_ReleaseCCBs( struct agtiapi_softc *pCard )
|
||||
|
||||
ccb_hdr_t *hdr;
|
||||
U32 hdr_sz;
|
||||
ccb_t *pccb = 0;
|
||||
ccb_t *pccb = NULL;
|
||||
|
||||
AGTIAPI_PRINTK( "agtiapi_ReleaseCCBs: start\n" );
|
||||
|
||||
|
@ -245,7 +245,7 @@ lp_attach(device_t dev)
|
||||
*/
|
||||
lp->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
|
||||
RF_SHAREABLE);
|
||||
if (lp->res_irq == 0) {
|
||||
if (lp->res_irq == NULL) {
|
||||
device_printf(dev, "cannot reserve interrupt, failed.\n");
|
||||
return (ENXIO);
|
||||
}
|
||||
@ -453,7 +453,7 @@ lpioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
|
||||
case SIOCADDMULTI:
|
||||
case SIOCDELMULTI:
|
||||
if (ifr == 0) {
|
||||
if (ifr == NULL) {
|
||||
return (EAFNOSUPPORT); /* XXX */
|
||||
}
|
||||
switch (ifr->ifr_addr.sa_family) {
|
||||
|
@ -206,7 +206,7 @@ search_token(char *str, int slen, char *token)
|
||||
static int
|
||||
ppb_pnp_detect(device_t bus)
|
||||
{
|
||||
char *token, *class = 0;
|
||||
char *token, *class = NULL;
|
||||
int i, len, error;
|
||||
int class_id = -1;
|
||||
char str[PPB_PnP_STRING_SIZE+1];
|
||||
|
@ -1324,9 +1324,9 @@ ppc_exec_microseq(device_t dev, struct ppb_microseq **p_msq)
|
||||
register int reg;
|
||||
register char mask;
|
||||
register int accum = 0;
|
||||
register char *ptr = 0;
|
||||
register char *ptr = NULL;
|
||||
|
||||
struct ppb_microseq *stack = 0;
|
||||
struct ppb_microseq *stack = NULL;
|
||||
|
||||
/* microsequence registers are equivalent to PC-like port registers */
|
||||
|
||||
@ -1496,7 +1496,7 @@ ppc_exec_microseq(device_t dev, struct ppb_microseq **p_msq)
|
||||
mi = stack;
|
||||
|
||||
/* reset the stack */
|
||||
stack = 0;
|
||||
stack = NULL;
|
||||
|
||||
/* XXX return code */
|
||||
|
||||
|
@ -132,7 +132,7 @@ sbni_attach_isa(device_t dev)
|
||||
} else {
|
||||
struct sbni_softc *master;
|
||||
|
||||
if ((master = connect_to_master(sc)) == 0) {
|
||||
if ((master = connect_to_master(sc)) == NULL) {
|
||||
device_printf(dev, "failed to alloc irq\n");
|
||||
sbni_release_resources(sc);
|
||||
return (ENXIO);
|
||||
|
@ -393,7 +393,7 @@ startagain:
|
||||
* Sneak a peek at the next packet
|
||||
*/
|
||||
m = ifp->if_snd.ifq_head;
|
||||
if (m == 0)
|
||||
if (m == NULL)
|
||||
return;
|
||||
/*
|
||||
* Compute the frame length and set pad to give an overall even
|
||||
@ -509,7 +509,7 @@ startagain:
|
||||
/*
|
||||
* Push out the data to the card.
|
||||
*/
|
||||
for (top = m; m != 0; m = m->m_next) {
|
||||
for (top = m; m != NULL; m = m->m_next) {
|
||||
|
||||
/*
|
||||
* Push out words.
|
||||
@ -607,7 +607,7 @@ snresume(struct ifnet *ifp)
|
||||
* Sneak a peek at the next packet
|
||||
*/
|
||||
m = ifp->if_snd.ifq_head;
|
||||
if (m == 0) {
|
||||
if (m == NULL) {
|
||||
if_printf(ifp, "snresume() with nothing to send\n");
|
||||
return;
|
||||
}
|
||||
@ -708,7 +708,7 @@ snresume(struct ifnet *ifp)
|
||||
/*
|
||||
* Push out the data to the card.
|
||||
*/
|
||||
for (top = m; m != 0; m = m->m_next) {
|
||||
for (top = m; m != NULL; m = m->m_next) {
|
||||
|
||||
/*
|
||||
* Push out words.
|
||||
|
@ -3710,7 +3710,7 @@ static void sym_log_hard_error(hcb_p np, u_short sist, u_char dstat)
|
||||
} else {
|
||||
script_ofs = dsp;
|
||||
script_size = 0;
|
||||
script_base = 0;
|
||||
script_base = NULL;
|
||||
script_name = "mem";
|
||||
}
|
||||
|
||||
@ -4296,7 +4296,7 @@ static void sym_int_ma (hcb_p np)
|
||||
* try to find the interrupted script command,
|
||||
* and the address at which to continue.
|
||||
*/
|
||||
vdsp = 0;
|
||||
vdsp = NULL;
|
||||
nxtdsp = 0;
|
||||
if (dsp > np->scripta_ba &&
|
||||
dsp <= np->scripta_ba + np->scripta_sz) {
|
||||
@ -6673,7 +6673,7 @@ static void sym_alloc_lcb_tags (hcb_p np, u_char tn, u_char ln)
|
||||
lp->cb_tags = sym_calloc(SYM_CONF_MAX_TASK, "CB_TAGS");
|
||||
if (!lp->cb_tags) {
|
||||
sym_mfree_dma(lp->itlq_tbl, SYM_CONF_MAX_TASK*4, "ITLQ_TBL");
|
||||
lp->itlq_tbl = 0;
|
||||
lp->itlq_tbl = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -350,7 +350,7 @@ vx_setlink(struct vx_softc *sc)
|
||||
*/
|
||||
i = sc->vx_connector; /* default in EEPROM */
|
||||
reason = "default";
|
||||
warning = 0;
|
||||
warning = NULL;
|
||||
|
||||
if (ifp->if_flags & IFF_LINK0) {
|
||||
if (sc->vx_connectors & conn_tab[CONNECTOR_AUI].bit) {
|
||||
@ -729,7 +729,7 @@ again:
|
||||
|
||||
/* Pull packet off interface. */
|
||||
m = vx_get(sc, len);
|
||||
if (m == 0) {
|
||||
if (m == NULL) {
|
||||
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||
goto abort;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user