diff options
60 files changed, 111 insertions, 111 deletions
diff --git a/sys/amd64/amd64/db_disasm.c b/sys/amd64/amd64/db_disasm.c index dd436d7..0ec81f4 100644 --- a/sys/amd64/amd64/db_disasm.c +++ b/sys/amd64/amd64/db_disasm.c @@ -1044,7 +1044,7 @@ db_read_address(loc, short_addr, rex, regmodrm, addrp) return (loc); } addrp->is_reg = FALSE; - addrp->index = 0; + addrp->index = NULL; if (short_addr) size = LONG; @@ -1067,7 +1067,7 @@ db_read_address(loc, short_addr, rex, regmodrm, addrp) if (rm == 5) { get_value_inc(addrp->disp, loc, 4, FALSE); if (have_sib) - addrp->base = 0; + addrp->base = NULL; else if (short_addr) addrp->base = "%eip"; else @@ -1109,9 +1109,9 @@ db_print_address(seg, size, rex, addrp) db_printf("%s:", seg); } - if (addrp->disp != 0 || (addrp->base == 0 && addrp->index == 0)) + if (addrp->disp != 0 || (addrp->base == NULL && addrp->index == NULL)) db_printsym((db_addr_t)addrp->disp, DB_STGY_ANY); - if (addrp->base != 0 || addrp->index != 0) { + if (addrp->base != NULL || addrp->index != NULL) { db_printf("("); if (addrp->base) db_printf("%s", addrp->base); @@ -1248,7 +1248,7 @@ db_disasm(db_addr_t loc, bool altfmt) get_value_inc(inst, loc, 1, FALSE); short_addr = FALSE; size = LONG; - seg = 0; + seg = NULL; /* * Get prefixes @@ -1313,7 +1313,7 @@ db_disasm(db_addr_t loc, bool altfmt) while (ip->i_size == ESC) { get_value_inc(inst, loc, 1, FALSE); ip = ((const struct inst * const *)ip->i_extra)[inst>>4]; - if (ip == 0) { + if (ip == NULL) { ip = &db_bad_inst; } else { diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index d0b1eed..612421e 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -391,7 +391,7 @@ static struct md_page pv_dummy; /* * All those kernel PT submaps that BSD is so fond of */ -pt_entry_t *CMAP1 = 0; +pt_entry_t *CMAP1 = NULL; caddr_t CADDR1 = 0; static vm_offset_t qframe = 0; static struct mtx qframe_mtx; diff --git a/sys/boot/common/md.c b/sys/boot/common/md.c index 2554b04..12a6670 100644 --- a/sys/boot/common/md.c +++ b/sys/boot/common/md.c @@ -103,7 +103,7 @@ md_strategy(void *devdata, int rw, daddr_t blk, size_t size, if ((ofs + size) > MD_IMAGE_SIZE) size = MD_IMAGE_SIZE - ofs; - if (rsize != 0) + if (rsize != NULL) *rsize = size; switch (rw) { diff --git a/sys/boot/efi/libefi/efinet.c b/sys/boot/efi/libefi/efinet.c index 56f9510..d845826 100644 --- a/sys/boot/efi/libefi/efinet.c +++ b/sys/boot/efi/libefi/efinet.c @@ -131,13 +131,13 @@ efinet_put(struct iodesc *desc, void *pkt, size_t len) /* Wait for the buffer to be transmitted */ do { - buf = 0; /* XXX Is this needed? */ + buf = NULL; /* XXX Is this needed? */ status = net->GetStatus(net, 0, &buf); /* * XXX EFI1.1 and the E1000 card returns a different * address than we gave. Sigh. */ - } while (status == EFI_SUCCESS && buf == 0); + } while (status == EFI_SUCCESS && buf == NULL); /* XXX How do we deal with status != EFI_SUCCESS now? */ return ((status == EFI_SUCCESS) ? len : -1); diff --git a/sys/boot/fdt/fdt_overlay.c b/sys/boot/fdt/fdt_overlay.c index a19f06e..0d9b367 100644 --- a/sys/boot/fdt/fdt_overlay.c +++ b/sys/boot/fdt/fdt_overlay.c @@ -64,7 +64,7 @@ fdt_get_fixup_location(void *fdtp, const char *fixup) int prop_offset, o, proplen; void *result; - result = 0; + result = NULL; path = strdup(fixup); prop = strchr(path, ':'); diff --git a/sys/boot/ficl/ficl.c b/sys/boot/ficl/ficl.c index d4370eb..219cf84 100644 --- a/sys/boot/ficl/ficl.c +++ b/sys/boot/ficl/ficl.c @@ -276,7 +276,7 @@ void ficlFreeVM(FICL_VM *pVM) FICL_SYSTEM *pSys = pVM->pSys; FICL_VM *pList = pSys->vmList; - assert(pVM != 0); + assert(pVM != NULL); if (pSys->vmList == pVM) { diff --git a/sys/boot/kshim/bsd_kernel.c b/sys/boot/kshim/bsd_kernel.c index c94b755..75eccb1 100644 --- a/sys/boot/kshim/bsd_kernel.c +++ b/sys/boot/kshim/bsd_kernel.c @@ -75,7 +75,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, void *addr; addr = malloc(dmat->maxsize + dmat->alignment, XXX, XXX); - if (addr == 0) + if (addr == NULL) return (ENOMEM); *mapp = addr; diff --git a/sys/boot/ofw/libofw/ofw_memory.c b/sys/boot/ofw/libofw/ofw_memory.c index 60cc904..5616184 100644 --- a/sys/boot/ofw/libofw/ofw_memory.c +++ b/sys/boot/ofw/libofw/ofw_memory.c @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" #include "openfirm.h" -static void *heap_base = 0; +static void *heap_base = NULL; static unsigned int heap_size = 0; struct ofw_mapping { diff --git a/sys/boot/sparc64/loader/main.c b/sys/boot/sparc64/loader/main.c index d7b4e1e..e70d9bb 100644 --- a/sys/boot/sparc64/loader/main.c +++ b/sys/boot/sparc64/loader/main.c @@ -859,7 +859,7 @@ main(int (*openfirm)(void *)) /* * Initialize devices. */ - for (dp = devsw; *dp != 0; dp++) + for (dp = devsw; *dp != NULL; dp++) if ((*dp)->dv_init != 0) (*dp)->dv_init(); diff --git a/sys/boot/userboot/userboot/userboot_disk.c b/sys/boot/userboot/userboot/userboot_disk.c index ce7dee5..b39101b 100644 --- a/sys/boot/userboot/userboot/userboot_disk.c +++ b/sys/boot/userboot/userboot/userboot_disk.c @@ -91,8 +91,8 @@ userdisk_init(void) return (ENOMEM); for (i = 0; i < userdisk_maxunit; i++) { if (CALLBACK(diskioctl, i, DIOCGSECTORSIZE, - §orsize) != 0 || CALLBACK(diskioctl, i, - DIOCGMEDIASIZE, &mediasize) != 0) + §orsize) != NULL || CALLBACK(diskioctl, i, + DIOCGMEDIASIZE, &mediasize) != NULL) return (ENXIO); ud_info[i].mediasize = mediasize; ud_info[i].sectorsize = sectorsize; diff --git a/sys/boot/zfs/zfs.c b/sys/boot/zfs/zfs.c index 466d18f..1ead135c 100644 --- a/sys/boot/zfs/zfs.c +++ b/sys/boot/zfs/zfs.c @@ -126,7 +126,7 @@ zfs_close(struct open_file *f) { struct file *fp = (struct file *)f->f_fsdata; - dnode_cache_obj = 0; + dnode_cache_obj = NULL; f->f_fsdata = (void *)0; if (fp == (struct file *)0) return (0); diff --git a/sys/boot/zfs/zfsimpl.c b/sys/boot/zfs/zfsimpl.c index aa1a789..4c45924 100644 --- a/sys/boot/zfs/zfsimpl.c +++ b/sys/boot/zfs/zfsimpl.c @@ -67,7 +67,7 @@ static const char *features_for_read[] = { static spa_list_t zfs_pools; static uint64_t zfs_crc64_table[256]; -static const dnode_phys_t *dnode_cache_obj = 0; +static const dnode_phys_t *dnode_cache_obj = NULL; static uint64_t dnode_cache_bn; static char *dnode_cache_buf; static char *zap_scratch; @@ -1430,7 +1430,7 @@ fzap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, uint6 zc = &ZAP_LEAF_CHUNK(&zl, h); while (zc->l_entry.le_hash != hash) { if (zc->l_entry.le_next == 0xffff) { - zc = 0; + zc = NULL; break; } zc = &ZAP_LEAF_CHUNK(&zl, zc->l_entry.le_next); @@ -2127,7 +2127,7 @@ zfs_lookup(const struct zfsmount *mount, const char *upath, dnode_phys_t *dnode) p = q; } else { strcpy(element, p); - p = 0; + p = NULL; } rc = zfs_dnode_stat(spa, &dn, &sb); diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c index 7d024d0..47c0aaa 100644 --- a/sys/dev/agp/agp.c +++ b/sys/dev/agp/agp.c @@ -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); diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c index dc3fbf2..cae604c 100644 --- a/sys/dev/an/if_an.c +++ b/sys/dev/an/if_an.c @@ -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 */ diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c index 2ec73e0..ecf872b 100644 --- a/sys/dev/arcmsr/arcmsr.c +++ b/sys/dev/arcmsr/arcmsr.c @@ -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) { diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c index 0b406e2..cdf234e 100644 --- a/sys/dev/bce/if_bce.c +++ b/sys/dev/bce/if_bce.c @@ -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; } diff --git a/sys/dev/beri/virtio/virtio_block.c b/sys/dev/beri/virtio/virtio_block.c index 405746c..50bb7f3 100644 --- a/sys/dev/beri/virtio/virtio_block.c +++ b/sys/dev/beri/virtio/virtio_block.c @@ -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); } diff --git a/sys/dev/buslogic/bt_pci.c b/sys/dev/buslogic/bt_pci.c index 7615ae8..48c90e0 100644 --- a/sys/dev/buslogic/bt_pci.c +++ b/sys/dev/buslogic/bt_pci.c @@ -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 */ diff --git a/sys/dev/ce/if_ce.c b/sys/dev/ce/if_ce.c index 69779d6..541db6c 100644 --- a/sys/dev/ce/if_ce.c +++ b/sys/dev/ce/if_ce.c @@ -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 diff --git a/sys/dev/cm/smc90cx6.c b/sys/dev/cm/smc90cx6.c index 5607298..e05f9ee 100644 --- a/sys/dev/cm/smc90cx6.c +++ b/sys/dev/cm/smc90cx6.c @@ -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; } diff --git a/sys/dev/cp/if_cp.c b/sys/dev/cp/if_cp.c index 426a5ee..29643b2 100644 --- a/sys/dev/cp/if_cp.c +++ b/sys/dev/cp/if_cp.c @@ -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); diff --git a/sys/dev/ctau/ctddk.c b/sys/dev/ctau/ctddk.c index 0a9dbd2..cd83311 100644 --- a/sys/dev/ctau/ctddk.c +++ b/sys/dev/ctau/ctddk.c @@ -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: diff --git a/sys/dev/ctau/if_ct.c b/sys/dev/ctau/if_ct.c index a3df2a8..41975ba 100644 --- a/sys/dev/ctau/if_ct.c +++ b/sys/dev/ctau/if_ct.c @@ -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); diff --git a/sys/dev/cx/cxddk.c b/sys/dev/cx/cxddk.c index 94780fb..a321000 100644 --- a/sys/dev/cx/cxddk.c +++ b/sys/dev/cx/cxddk.c @@ -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) { diff --git a/sys/dev/cx/if_cx.c b/sys/dev/cx/if_cx.c index 654e913..58fca9f 100644 --- a/sys/dev/cx/if_cx.c +++ b/sys/dev/cx/if_cx.c @@ -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); diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index a6253f5..3e56c86 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -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); diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 1fb4037..0730c96 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -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 diff --git a/sys/dev/fatm/if_fatm.c b/sys/dev/fatm/if_fatm.c index a530a443..2a1dee6 100644 --- a/sys/dev/fatm/if_fatm.c +++ b/sys/dev/fatm/if_fatm.c @@ -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) { diff --git a/sys/dev/fe/if_fe.c b/sys/dev/fe/if_fe.c index 28841b7..c02c33d 100644 --- a/sys/dev/fe/if_fe.c +++ b/sys/dev/fe/if_fe.c @@ -2011,7 +2011,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); @@ -2021,7 +2021,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; diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c index 0a958b2..3928ef1 100644 --- a/sys/dev/firewire/if_fwip.c +++ b/sys/dev/firewire/if_fwip.c @@ -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); diff --git a/sys/dev/hptiop/hptiop.c b/sys/dev/hptiop/hptiop.c index ea05f4b..f8cdbeb 100644 --- a/sys/dev/hptiop/hptiop.c +++ b/sys/dev/hptiop/hptiop.c @@ -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; diff --git a/sys/dev/hptmv/entry.c b/sys/dev/hptmv/entry.c index 93d6549..25133e1 100644 --- a/sys/dev/hptmv/entry.c +++ b/sys/dev/hptmv/entry.c @@ -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; diff --git a/sys/dev/hptmv/gui_lib.c b/sys/dev/hptmv/gui_lib.c index 359a41e..bc57239 100644 --- a/sys/dev/hptmv/gui_lib.c +++ b/sys/dev/hptmv/gui_lib.c @@ -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; diff --git a/sys/dev/hptmv/hptproc.c b/sys/dev/hptmv/hptproc.c index 9e89756..d9ded9f 100644 --- a/sys/dev/hptmv/hptproc.c +++ b/sys/dev/hptmv/hptproc.c @@ -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; diff --git a/sys/dev/hptmv/ioctl.c b/sys/dev/hptmv/ioctl.c index 50a82ae..671d64c 100644 --- a/sys/dev/hptmv/ioctl.c +++ b/sys/dev/hptmv/ioctl.c @@ -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) diff --git a/sys/dev/iicbus/if_ic.c b/sys/dev/iicbus/if_ic.c index 0df2f4a..323b0f7 100644 --- a/sys/dev/iicbus/if_ic.c +++ b/sys/dev/iicbus/if_ic.c @@ -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: diff --git a/sys/dev/isp/isp_pci.c b/sys/dev/isp/isp_pci.c index b0acd96..8a51cf5 100644 --- a/sys/dev/isp/isp_pci.c +++ b/sys/dev/isp/isp_pci.c @@ -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); diff --git a/sys/dev/le/am7990.c b/sys/dev/le/am7990.c index a21be28..32c2e1e 100644 --- a/sys/dev/le/am7990.c +++ b/sys/dev/le/am7990.c @@ -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; /* diff --git a/sys/dev/le/am79900.c b/sys/dev/le/am79900.c index 5ea8228..9a62c62 100644 --- a/sys/dev/le/am79900.c +++ b/sys/dev/le/am79900.c @@ -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; /* diff --git a/sys/dev/le/lance.c b/sys/dev/le/lance.c index f8a333b..2eee7af 100644 --- a/sys/dev/le/lance.c +++ b/sys/dev/le/lance.c @@ -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; diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index de0a696..6802df6 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -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; diff --git a/sys/dev/ncr/ncr.c b/sys/dev/ncr/ncr.c index af0019a..86634d3 100644 --- a/sys/dev/ncr/ncr.c +++ b/sys/dev/ncr/ncr.c @@ -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]; diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c index 1c80106..671ac12 100644 --- a/sys/dev/ofw/ofw_bus_subr.c +++ b/sys/dev/ofw/ofw_bus_subr.c @@ -944,7 +944,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); diff --git a/sys/dev/patm/if_patm_tx.c b/sys/dev/patm/if_patm_tx.c index 1b9a8a5..33ee8f1 100644 --- a/sys/dev/patm/if_patm_tx.c +++ b/sys/dev/patm/if_patm_tx.c @@ -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); diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c index 04dcc44..4c80fea 100644 --- a/sys/dev/pccard/pccard.c +++ b/sys/dev/pccard/pccard.c @@ -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, diff --git a/sys/dev/pms/RefTisa/sallsdk/spc/sainit.c b/sys/dev/pms/RefTisa/sallsdk/spc/sainit.c index 367c75a..6e112ad 100644 --- a/sys/dev/pms/RefTisa/sallsdk/spc/sainit.c +++ b/sys/dev/pms/RefTisa/sallsdk/spc/sainit.c @@ -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; diff --git a/sys/dev/pms/RefTisa/tisa/sassata/common/tdioctl.c b/sys/dev/pms/RefTisa/tisa/sassata/common/tdioctl.c index f192680..f1ee792 100644 --- a/sys/dev/pms/RefTisa/tisa/sassata/common/tdioctl.c +++ b/sys/dev/pms/RefTisa/tisa/sassata/common/tdioctl.c @@ -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")); diff --git a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c index f0646dd..7c68971 100644 --- a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c +++ b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c @@ -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" ); diff --git a/sys/dev/ppbus/if_plip.c b/sys/dev/ppbus/if_plip.c index 93a0da1..7a9d9b0 100644 --- a/sys/dev/ppbus/if_plip.c +++ b/sys/dev/ppbus/if_plip.c @@ -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) { diff --git a/sys/dev/ppbus/ppbconf.c b/sys/dev/ppbus/ppbconf.c index a2370dd..b5b74b4 100644 --- a/sys/dev/ppbus/ppbconf.c +++ b/sys/dev/ppbus/ppbconf.c @@ -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]; diff --git a/sys/dev/ppc/ppc.c b/sys/dev/ppc/ppc.c index 4c6761f..9d93cf6 100644 --- a/sys/dev/ppc/ppc.c +++ b/sys/dev/ppc/ppc.c @@ -1329,9 +1329,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 */ @@ -1501,7 +1501,7 @@ ppc_exec_microseq(device_t dev, struct ppb_microseq **p_msq) mi = stack; /* reset the stack */ - stack = 0; + stack = NULL; /* XXX return code */ diff --git a/sys/dev/sbni/if_sbni_isa.c b/sys/dev/sbni/if_sbni_isa.c index 61a2398..f1db8b1 100644 --- a/sys/dev/sbni/if_sbni_isa.c +++ b/sys/dev/sbni/if_sbni_isa.c @@ -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); diff --git a/sys/dev/sn/if_sn.c b/sys/dev/sn/if_sn.c index 7ac2a13..0306089 100644 --- a/sys/dev/sn/if_sn.c +++ b/sys/dev/sn/if_sn.c @@ -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. diff --git a/sys/dev/sym/sym_hipd.c b/sys/dev/sym/sym_hipd.c index e4e87b1..26075a6 100644 --- a/sys/dev/sym/sym_hipd.c +++ b/sys/dev/sym/sym_hipd.c @@ -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; } diff --git a/sys/dev/vx/if_vx.c b/sys/dev/vx/if_vx.c index 08d84a6..a1ba239 100644 --- a/sys/dev/vx/if_vx.c +++ b/sys/dev/vx/if_vx.c @@ -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; } diff --git a/sys/libkern/iconv_xlat16.c b/sys/libkern/iconv_xlat16.c index dbac892..8facd77 100644 --- a/sys/libkern/iconv_xlat16.c +++ b/sys/libkern/iconv_xlat16.c @@ -268,7 +268,7 @@ iconv_xlat16_conv(void *d2p, const char **inbuf, * there is a case that inbuf char is a single * byte char while inlen == 2 */ - if ((u_char)*(src+1) == 0 && !nullin ) { + if ((u_char)*(src+1) == '\0' && !nullin ) { src++; ir--; } else { diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c index b02901f..3c13483 100644 --- a/sys/net/if_fddisubr.c +++ b/sys/net/if_fddisubr.c @@ -400,7 +400,7 @@ fddi_input(ifp, m) m_adj(m, FDDI_HDR_LEN); m = m_pullup(m, LLC_SNAPFRAMELEN); - if (m == 0) { + if (m == NULL) { if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto dropanyway; } diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c index 8306154..e5667d0 100644 --- a/sys/net/if_iso88025subr.c +++ b/sys/net/if_iso88025subr.c @@ -487,7 +487,7 @@ iso88025_input(ifp, m) m_adj(m, mac_hdr_len); m = m_pullup(m, LLC_SNAPFRAMELEN); - if (m == 0) { + if (m == NULL) { if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto dropanyway; } diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 5938aca..a2b453d 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -989,7 +989,7 @@ iflib_netmap_txq_init(if_ctx_t ctx, iflib_txq_t txq) struct netmap_slot *slot; slot = netmap_reset(na, NR_TX, txq->ift_id, 0); - if (slot == 0) + if (slot == NULL) return; for (int i = 0; i < ctx->ifc_softc_ctx.isc_ntxd[0]; i++) { @@ -1014,7 +1014,7 @@ iflib_netmap_rxq_init(if_ctx_t ctx, iflib_rxq_t rxq) int nrxd; slot = netmap_reset(na, NR_RX, rxq->ifr_id, 0); - if (slot == 0) + if (slot == NULL) return; sd = rxq->ifr_fl[0].ifl_sds; nrxd = ctx->ifc_softc_ctx.isc_nrxd[0]; diff --git a/sys/netpfil/ipfw/ip_fw_sockopt.c b/sys/netpfil/ipfw/ip_fw_sockopt.c index 003f0a9..85e0c8e 100644 --- a/sys/netpfil/ipfw/ip_fw_sockopt.c +++ b/sys/netpfil/ipfw/ip_fw_sockopt.c @@ -3135,7 +3135,7 @@ int classify_opcode_kidx(ipfw_insn *cmd, uint16_t *puidx) { - if (find_op_rw(cmd, puidx, NULL) == 0) + if (find_op_rw(cmd, puidx, NULL) == NULL) return (1); return (0); } |