Author: pfg
Date: Mon Feb 20 03:43:12 2017
New Revision: 313982
URL: https://svnweb.freebsd.org/changeset/base/313982

Log:
  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

Modified:
  head/sys/dev/agp/agp.c
  head/sys/dev/al_eth/al_eth.c
  head/sys/dev/al_eth/al_init_eth_lm.c
  head/sys/dev/an/if_an.c
  head/sys/dev/arcmsr/arcmsr.c
  head/sys/dev/bce/if_bce.c
  head/sys/dev/beri/virtio/virtio_block.c
  head/sys/dev/bhnd/cores/usb/bhnd_usb.c
  head/sys/dev/buslogic/bt_pci.c
  head/sys/dev/ce/if_ce.c
  head/sys/dev/cm/smc90cx6.c
  head/sys/dev/cp/if_cp.c
  head/sys/dev/ctau/ctddk.c
  head/sys/dev/ctau/if_ct.c
  head/sys/dev/cx/cxddk.c
  head/sys/dev/cx/if_cx.c
  head/sys/dev/de/if_de.c
  head/sys/dev/ed/if_ed.c
  head/sys/dev/fatm/if_fatm.c
  head/sys/dev/fe/if_fe.c
  head/sys/dev/firewire/if_fwip.c
  head/sys/dev/hptiop/hptiop.c
  head/sys/dev/hptmv/entry.c
  head/sys/dev/hptmv/gui_lib.c
  head/sys/dev/hptmv/hptproc.c
  head/sys/dev/hptmv/ioctl.c
  head/sys/dev/iicbus/if_ic.c
  head/sys/dev/isp/isp_pci.c
  head/sys/dev/le/am7990.c
  head/sys/dev/le/am79900.c
  head/sys/dev/le/lance.c
  head/sys/dev/md/md.c
  head/sys/dev/ncr/ncr.c
  head/sys/dev/netmap/netmap_freebsd.c
  head/sys/dev/netmap/netmap_mem2.c
  head/sys/dev/ofw/ofw_bus_subr.c
  head/sys/dev/patm/if_patm_tx.c
  head/sys/dev/pccard/pccard.c
  head/sys/dev/pms/RefTisa/sallsdk/spc/sainit.c
  head/sys/dev/pms/RefTisa/tisa/sassata/common/tdioctl.c
  head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
  head/sys/dev/ppbus/if_plip.c
  head/sys/dev/ppbus/ppbconf.c
  head/sys/dev/ppc/ppc.c
  head/sys/dev/sbni/if_sbni_isa.c
  head/sys/dev/sn/if_sn.c
  head/sys/dev/sym/sym_hipd.c
  head/sys/dev/vx/if_vx.c

Modified: head/sys/dev/agp/agp.c
==============================================================================
--- head/sys/dev/agp/agp.c      Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/agp/agp.c      Mon Feb 20 03:43:12 2017        (r313982)
@@ -820,7 +820,7 @@ agp_close(struct cdev *kdev, int fflag, 
        /*
         * 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);

Modified: head/sys/dev/al_eth/al_eth.c
==============================================================================
--- head/sys/dev/al_eth/al_eth.c        Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/al_eth/al_eth.c        Mon Feb 20 03:43:12 2017        
(r313982)
@@ -2009,7 +2009,7 @@ al_eth_enable_msix(struct al_eth_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)

Modified: head/sys/dev/al_eth/al_init_eth_lm.c
==============================================================================
--- head/sys/dev/al_eth/al_init_eth_lm.c        Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/al_eth/al_init_eth_lm.c        Mon Feb 20 03:43:12 2017        
(r313982)
@@ -1168,7 +1168,7 @@ al_eth_lm_link_detection(struct al_eth_l
                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

Modified: head/sys/dev/an/if_an.c
==============================================================================
--- head/sys/dev/an/if_an.c     Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/an/if_an.c     Mon Feb 20 03:43:12 2017        (r313982)
@@ -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 */

Modified: head/sys/dev/arcmsr/arcmsr.c
==============================================================================
--- head/sys/dev/arcmsr/arcmsr.c        Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/arcmsr/arcmsr.c        Mon Feb 20 03:43:12 2017        
(r313982)
@@ -1398,8 +1398,8 @@ static u_int32_t arcmsr_Read_iop_rqbuffe
        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_wqbuf
 {
        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) {

Modified: head/sys/dev/bce/if_bce.c
==============================================================================
--- head/sys/dev/bce/if_bce.c   Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/bce/if_bce.c   Mon Feb 20 03:43:12 2017        (r313982)
@@ -2800,7 +2800,7 @@ bce_nvram_write(struct bce_softc *sc, u3
 
        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;
                }

Modified: head/sys/dev/beri/virtio/virtio_block.c
==============================================================================
--- head/sys/dev/beri/virtio/virtio_block.c     Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/beri/virtio/virtio_block.c     Mon Feb 20 03:43:12 2017        
(r313982)
@@ -457,7 +457,7 @@ beri_ioctl(struct cdev *dev, u_long cmd,
                sc->opened = 1;
                break;
        case MDIOCDETACH:
-               if (sc->vnode == 0) {
+               if (sc->vnode == NULL) {
                        /* File not opened */
                        return (1);
                }

Modified: head/sys/dev/bhnd/cores/usb/bhnd_usb.c
==============================================================================
--- head/sys/dev/bhnd/cores/usb/bhnd_usb.c      Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/bhnd/cores/usb/bhnd_usb.c      Mon Feb 20 03:43:12 2017        
(r313982)
@@ -291,7 +291,7 @@ bhnd_usb_alloc_resource(device_t bus, de
 
                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, de
 
                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);
                }

Modified: head/sys/dev/buslogic/bt_pci.c
==============================================================================
--- head/sys/dev/buslogic/bt_pci.c      Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/buslogic/bt_pci.c      Mon Feb 20 03:43:12 2017        
(r313982)
@@ -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 */

Modified: head/sys/dev/ce/if_ce.c
==============================================================================
--- head/sys/dev/ce/if_ce.c     Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/ce/if_ce.c     Mon Feb 20 03:43:12 2017        (r313982)
@@ -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

Modified: head/sys/dev/cm/smc90cx6.c
==============================================================================
--- head/sys/dev/cm/smc90cx6.c  Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/cm/smc90cx6.c  Mon Feb 20 03:43:12 2017        (r313982)
@@ -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;
        }

Modified: head/sys/dev/cp/if_cp.c
==============================================================================
--- head/sys/dev/cp/if_cp.c     Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/cp/if_cp.c     Mon Feb 20 03:43:12 2017        (r313982)
@@ -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);

Modified: head/sys/dev/ctau/ctddk.c
==============================================================================
--- head/sys/dev/ctau/ctddk.c   Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/ctau/ctddk.c   Mon Feb 20 03:43:12 2017        (r313982)
@@ -104,7 +104,7 @@ int ct_open_board (ct_board_t *b, int nu
        case B_TAU2_E1D:
                fw = ctau2_fw_data;
                flen = 0;
-               ft = 0;
+               ft = NULL;
                break;
 #ifndef CT_DDK_NO_G703
        case B_TAU_G703:

Modified: head/sys/dev/ctau/if_ct.c
==============================================================================
--- head/sys/dev/ctau/if_ct.c   Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/ctau/if_ct.c   Mon Feb 20 03:43:12 2017        (r313982)
@@ -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);

Modified: head/sys/dev/cx/cxddk.c
==============================================================================
--- head/sys/dev/cx/cxddk.c     Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/cx/cxddk.c     Mon Feb 20 03:43:12 2017        (r313982)
@@ -440,7 +440,7 @@ static int cx_receive_interrupt (cx_chan
        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) {

Modified: head/sys/dev/cx/if_cx.c
==============================================================================
--- head/sys/dev/cx/if_cx.c     Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/cx/if_cx.c     Mon Feb 20 03:43:12 2017        (r313982)
@@ -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);
 

Modified: head/sys/dev/de/if_de.c
==============================================================================
--- head/sys/dev/de/if_de.c     Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/de/if_de.c     Mon Feb 20 03:43:12 2017        (r313982)
@@ -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);

Modified: head/sys/dev/ed/if_ed.c
==============================================================================
--- head/sys/dev/ed/if_ed.c     Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/ed/if_ed.c     Mon Feb 20 03:43:12 2017        (r313982)
@@ -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

Modified: head/sys/dev/fatm/if_fatm.c
==============================================================================
--- head/sys/dev/fatm/if_fatm.c Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/fatm/if_fatm.c Mon Feb 20 03:43:12 2017        (r313982)
@@ -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) {

Modified: head/sys/dev/fe/if_fe.c
==============================================================================
--- head/sys/dev/fe/if_fe.c     Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/fe/if_fe.c     Mon Feb 20 03:43:12 2017        (r313982)
@@ -2002,7 +2002,7 @@ fe_write_mbufs (struct fe_softc *sc, str
        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, str
        {
                /* 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;

Modified: head/sys/dev/firewire/if_fwip.c
==============================================================================
--- head/sys/dev/firewire/if_fwip.c     Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/firewire/if_fwip.c     Mon Feb 20 03:43:12 2017        
(r313982)
@@ -575,7 +575,7 @@ fwip_async_output(struct fwip_softc *fwi
                 */
                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);
 

Modified: head/sys/dev/hptiop/hptiop.c
==============================================================================
--- head/sys/dev/hptiop/hptiop.c        Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/hptiop/hptiop.c        Mon Feb 20 03:43:12 2017        
(r313982)
@@ -330,7 +330,7 @@ static void hptiop_request_callback_itl(
                                                        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;

Modified: head/sys/dev/hptmv/entry.c
==============================================================================
--- head/sys/dev/hptmv/entry.c  Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/hptmv/entry.c  Mon Feb 20 03:43:12 2017        (r313982)
@@ -138,8 +138,8 @@ static MV_BOOLEAN hptmv_event_notify(MV_
 
 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;
 

Modified: head/sys/dev/hptmv/gui_lib.c
==============================================================================
--- head/sys/dev/hptmv/gui_lib.c        Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/hptmv/gui_lib.c        Mon Feb 20 03:43:12 2017        
(r313982)
@@ -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
        IAL_ADAPTER_T    *pAdapTemp = gIal_Adapter;
        int i,iControllerCount = 0;
 
-       while(pAdapTemp != 0)
+       while(pAdapTemp != NULL)
        {
                if (iControllerCount++==id) 
                        goto found;

Modified: head/sys/dev/hptmv/hptproc.c
==============================================================================
--- head/sys/dev/hptmv/hptproc.c        Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/hptmv/hptproc.c        Mon Feb 20 03:43:12 2017        
(r313982)
@@ -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;
 

Modified: head/sys/dev/hptmv/ioctl.c
==============================================================================
--- head/sys/dev/hptmv/ioctl.c  Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/hptmv/ioctl.c  Mon Feb 20 03:43:12 2017        (r313982)
@@ -691,7 +691,7 @@ hpt_rebuild_data_block(IAL_ADAPTER_T *pA
     PCommand pCmd;
        UINT result;
        int needsync=0, retry=0, needdelete=0;
-       void *buffer = 0;
+       void *buffer = NULL;
 
        _VBUS_INST(&pAdapter->VBus)
 

Modified: head/sys/dev/iicbus/if_ic.c
==============================================================================
--- head/sys/dev/iicbus/if_ic.c Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/iicbus/if_ic.c Mon Feb 20 03:43:12 2017        (r313982)
@@ -251,7 +251,7 @@ icioctl(struct ifnet *ifp, u_long cmd, c
 
        case SIOCADDMULTI:
        case SIOCDELMULTI:
-               if (ifr == 0)
+               if (ifr == NULL)
                        return (EAFNOSUPPORT);          /* XXX */
                switch (ifr->ifr_addr.sa_family) {
                case AF_INET:

Modified: head/sys/dev/isp/isp_pci.c
==============================================================================
--- head/sys/dev/isp/isp_pci.c  Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/isp/isp_pci.c  Mon Feb 20 03:43:12 2017        (r313982)
@@ -583,10 +583,10 @@ isp_get_specific_options(device_t dev, i
            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, i
         * 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, i
                }
        }
 
-       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);

Modified: head/sys/dev/le/am7990.c
==============================================================================
--- head/sys/dev/le/am7990.c    Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/le/am7990.c    Mon Feb 20 03:43:12 2017        (r313982)
@@ -519,7 +519,7 @@ am7990_start_locked(struct lance_softc *
                }
 
                IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
-               if (m == 0)
+               if (m == NULL)
                        break;
 
                /*

Modified: head/sys/dev/le/am79900.c
==============================================================================
--- head/sys/dev/le/am79900.c   Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/le/am79900.c   Mon Feb 20 03:43:12 2017        (r313982)
@@ -557,7 +557,7 @@ am79900_start_locked(struct lance_softc 
                }
 
                IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
-               if (m == 0)
+               if (m == NULL)
                        break;
 
                /*

Modified: head/sys/dev/le/lance.c
==============================================================================
--- head/sys/dev/le/lance.c     Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/le/lance.c     Mon Feb 20 03:43:12 2017        (r313982)
@@ -418,7 +418,7 @@ lance_get(struct lance_softc *sc, int bo
                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;

Modified: head/sys/dev/md/md.c
==============================================================================
--- head/sys/dev/md/md.c        Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/md/md.c        Mon Feb 20 03:43:12 2017        (r313982)
@@ -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;
 

Modified: head/sys/dev/ncr/ncr.c
==============================================================================
--- head/sys/dev/ncr/ncr.c      Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/ncr/ncr.c      Mon Feb 20 03:43:12 2017        (r313982)
@@ -5206,7 +5206,7 @@ static void ncr_log_hard_error(ncb_p np,
        } 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];

Modified: head/sys/dev/netmap/netmap_freebsd.c
==============================================================================
--- head/sys/dev/netmap/netmap_freebsd.c        Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/netmap/netmap_freebsd.c        Mon Feb 20 03:43:12 2017        
(r313982)
@@ -648,7 +648,7 @@ nm_os_pt_memdev_iomap(struct ptnetmap_me
                        &rid, 0, ~0, *mem_size, RF_ACTIVE);
        if (ptn_dev->pci_mem == NULL) {
                *nm_paddr = 0;
-               *nm_addr = 0;
+               *nm_addr = NULL;
                return ENOMEM;
        }
 

Modified: head/sys/dev/netmap/netmap_mem2.c
==============================================================================
--- head/sys/dev/netmap/netmap_mem2.c   Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/netmap/netmap_mem2.c   Mon Feb 20 03:43:12 2017        
(r313982)
@@ -2143,7 +2143,7 @@ netmap_mem_pt_guest_deref(struct netmap_
            if (ptnmd->ptn_dev) {
                nm_os_pt_memdev_iounmap(ptnmd->ptn_dev);
            }
-           ptnmd->nm_addr = 0;
+           ptnmd->nm_addr = NULL;
            ptnmd->nm_paddr = 0;
        }
 }

Modified: head/sys/dev/ofw/ofw_bus_subr.c
==============================================================================
--- head/sys/dev/ofw/ofw_bus_subr.c     Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/ofw/ofw_bus_subr.c     Mon Feb 20 03:43:12 2017        
(r313982)
@@ -963,7 +963,7 @@ ofw_bus_string_list_to_array(phandle_t n
                i += len;
                tptr += len;
        }
-       array[cnt] = 0;
+       array[cnt] = NULL;
        *out_array = array;
 
        return (cnt);

Modified: head/sys/dev/patm/if_patm_tx.c
==============================================================================
--- head/sys/dev/patm/if_patm_tx.c      Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/patm/if_patm_tx.c      Mon Feb 20 03:43:12 2017        
(r313982)
@@ -440,7 +440,7 @@ patm_tx_pad(struct patm_softc *sc, struc
                }
        }
        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);

Modified: head/sys/dev/pccard/pccard.c
==============================================================================
--- head/sys/dev/pccard/pccard.c        Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/pccard/pccard.c        Mon Feb 20 03:43:12 2017        
(r313982)
@@ -470,7 +470,7 @@ pccard_function_init(struct pccard_funct
        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, devi
     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, de
 {
        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,

Modified: head/sys/dev/pms/RefTisa/sallsdk/spc/sainit.c
==============================================================================
--- head/sys/dev/pms/RefTisa/sallsdk/spc/sainit.c       Mon Feb 20 03:33:59 
2017        (r313981)
+++ head/sys/dev/pms/RefTisa/sallsdk/spc/sainit.c       Mon Feb 20 03:43:12 
2017        (r313982)
@@ -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;

Modified: head/sys/dev/pms/RefTisa/tisa/sassata/common/tdioctl.c
==============================================================================
--- head/sys/dev/pms/RefTisa/tisa/sassata/common/tdioctl.c      Mon Feb 20 
03:33:59 2017        (r313981)
+++ head/sys/dev/pms/RefTisa/tisa/sassata/common/tdioctl.c      Mon Feb 20 
03:43:12 2017        (r313982)
@@ -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"));
 

Modified: head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
==============================================================================
--- head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c   Mon Feb 20 03:33:59 
2017        (r313981)
+++ head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c   Mon Feb 20 03:43:12 
2017        (r313982)
@@ -5032,7 +5032,7 @@ STATIC void agtiapi_PrepCCBs( struct agt
 
   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 agtia
 
   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 
 
   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 
 
   ccb_hdr_t *hdr;
   U32 hdr_sz;
-  ccb_t *pccb = 0;
+  ccb_t *pccb = NULL;
 
   AGTIAPI_PRINTK( "agtiapi_ReleaseCCBs: start\n" );
 

Modified: head/sys/dev/ppbus/if_plip.c
==============================================================================
--- head/sys/dev/ppbus/if_plip.c        Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/ppbus/if_plip.c        Mon Feb 20 03:43:12 2017        
(r313982)
@@ -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, c
 
        case SIOCADDMULTI:
        case SIOCDELMULTI:
-               if (ifr == 0) {
+               if (ifr == NULL) {
                        return (EAFNOSUPPORT);          /* XXX */
                }
                switch (ifr->ifr_addr.sa_family) {

Modified: head/sys/dev/ppbus/ppbconf.c
==============================================================================
--- head/sys/dev/ppbus/ppbconf.c        Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/ppbus/ppbconf.c        Mon Feb 20 03:43:12 2017        
(r313982)
@@ -206,7 +206,7 @@ search_token(char *str, int slen, char *
 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];

Modified: head/sys/dev/ppc/ppc.c
==============================================================================
--- head/sys/dev/ppc/ppc.c      Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/ppc/ppc.c      Mon Feb 20 03:43:12 2017        (r313982)
@@ -1324,9 +1324,9 @@ ppc_exec_microseq(device_t dev, struct p
        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 p
                        mi = stack;
 
                        /* reset the stack */
-                       stack = 0;
+                       stack = NULL;
 
                        /* XXX return code */
 

Modified: head/sys/dev/sbni/if_sbni_isa.c
==============================================================================
--- head/sys/dev/sbni/if_sbni_isa.c     Mon Feb 20 03:33:59 2017        
(r313981)
+++ head/sys/dev/sbni/if_sbni_isa.c     Mon Feb 20 03:43:12 2017        
(r313982)
@@ -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);

Modified: head/sys/dev/sn/if_sn.c
==============================================================================
--- head/sys/dev/sn/if_sn.c     Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/sn/if_sn.c     Mon Feb 20 03:43:12 2017        (r313982)
@@ -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.

Modified: head/sys/dev/sym/sym_hipd.c
==============================================================================
--- head/sys/dev/sym/sym_hipd.c Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/sym/sym_hipd.c Mon Feb 20 03:43:12 2017        (r313982)
@@ -3710,7 +3710,7 @@ static void sym_log_hard_error(hcb_p np,
        } 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
        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;
        }
 

Modified: head/sys/dev/vx/if_vx.c
==============================================================================
--- head/sys/dev/vx/if_vx.c     Mon Feb 20 03:33:59 2017        (r313981)
+++ head/sys/dev/vx/if_vx.c     Mon Feb 20 03:43:12 2017        (r313982)
@@ -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;
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to