diff -u -p a/arm/xilinx/zy7_gpio.c b/arm/xilinx/zy7_gpio.c --- a/arm/xilinx/zy7_gpio.c +++ b/arm/xilinx/zy7_gpio.c @@ -411,7 +411,7 @@ zy7_gpio_probe(device_t dev) return (ENXIO); conf = (struct zynq_gpio_conf *)ofw_bus_search_compatible(dev, compat_data)->ocd_data; - if (conf == 0) + if (conf == NULL) return (ENXIO); device_set_desc(dev, conf->name); diff -u -p a/arm/broadcom/bcm2835/bcm2835_sdhci.c b/arm/broadcom/bcm2835/bcm2835_sdhci.c --- a/arm/broadcom/bcm2835/bcm2835_sdhci.c +++ b/arm/broadcom/bcm2835/bcm2835_sdhci.c @@ -230,7 +230,7 @@ bcm_sdhci_attach(device_t dev) sc->conf = (struct bcm_mmc_conf *)ofw_bus_search_compatible(dev, compat_data)->ocd_data; - if (sc->conf == 0) + if (sc->conf == NULL) return (ENXIO); err = bcm2835_mbox_set_power_state(BCM2835_MBOX_POWER_ID_EMMC, TRUE); diff -u -p a/dev/gve/gve_adminq.c b/dev/gve/gve_adminq.c --- a/dev/gve/gve_adminq.c +++ b/dev/gve/gve_adminq.c @@ -696,7 +696,7 @@ gve_release_adminq(struct gve_priv *priv) gve_dma_free_coherent(&priv->aq_mem); priv->aq_mem = (struct gve_dma_handle){}; - priv->adminq = 0; + priv->adminq = NULL; priv->adminq_bus_addr = 0; gve_clear_state_flag(priv, GVE_STATE_FLAG_ADMINQ_OK); diff -u -p a/dev/iicbus/iichid.c b/dev/iicbus/iichid.c --- a/dev/iicbus/iichid.c +++ b/dev/iicbus/iichid.c @@ -688,7 +688,7 @@ iichid_setup_interrupt(struct iichid_softc *sc) static int iichid_setup_interrupt(struct iichid_softc *sc) { - sc->irq_cookie = 0; + sc->irq_cookie = NULL; int error = bus_setup_intr(sc->dev, sc->irq_res, INTR_TYPE_TTY|INTR_MPSAFE, NULL, iichid_intr, sc, &sc->irq_cookie); @@ -706,7 +706,7 @@ iichid_teardown_interrupt(struct iichid_softc *sc) if (sc->irq_cookie) bus_teardown_intr(sc->dev, sc->irq_res, sc->irq_cookie); - sc->irq_cookie = 0; + sc->irq_cookie = NULL; } #ifdef IICHID_SAMPLING diff -u -p a/dev/pms/RefTisa/sallsdk/spc/sassp.c b/dev/pms/RefTisa/sallsdk/spc/sassp.c --- a/dev/pms/RefTisa/sallsdk/spc/sassp.c +++ b/dev/pms/RefTisa/sallsdk/spc/sassp.c @@ -521,7 +521,7 @@ ext: if (fr && ret != AGSA_RC_SUCCESS) { saFastSSPCancel(fr); - ioh = 0; + ioh = NULL; } OSSA_INP_LEAVE(agRoot); return ioh; diff -u -p a/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c b/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c --- a/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c +++ b/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c @@ -500,7 +500,7 @@ tiINIFastIOPrepare( { TI_DBG1(("tiINIFastIOPrepare: tiDeviceHandle=%p DeviceData is NULL\n", tiDeviceHandle)); - ioHandle = 0; + ioHandle = NULL; TD_ASSERT((0), ""); goto ext; } @@ -511,7 +511,7 @@ tiINIFastIOPrepare( { TI_DBG1(("tiINISuperIOSend: wrong Device %d\n", oneDeviceData->DeviceType)); /* error: unsupported IO */ - ioHandle = 0; + ioHandle = NULL; TD_ASSERT((0), ""); goto ext; } diff -u -p a/dev/qlnx/qlnxe/ecore_ooo.c b/dev/qlnx/qlnxe/ecore_ooo.c --- a/dev/qlnx/qlnxe/ecore_ooo.c +++ b/dev/qlnx/qlnxe/ecore_ooo.c @@ -568,7 +568,7 @@ void ecore_ooo_dump_rx_event(struct ecore_hwfn *p_hwfn int i; u32 dp_module = ECORE_MSG_OOO; u32 ph_hi, ph_lo; - u8 *packet_buffer = 0; + u8 *packet_buffer = NULL; if (p_hwfn->dp_level > ECORE_LEVEL_VERBOSE) return; diff -u -p a/dev/ice/ice_lib.c b/dev/ice/ice_lib.c --- a/dev/ice/ice_lib.c +++ b/dev/ice/ice_lib.c @@ -4816,7 +4816,7 @@ ice_add_sysctls_eth_stats(struct sysctl_ctx_list *ctx, struct sysctl_oid_list *parent_list = SYSCTL_CHILDREN(parent); const struct ice_sysctl_info *entry = ctls; - while (entry->stat != 0) { + while (entry->stat != NULL) { SYSCTL_ADD_U64(ctx, parent_list, OID_AUTO, entry->name, CTLFLAG_RD | CTLFLAG_STATS, entry->stat, 0, entry->description); @@ -5215,7 +5215,7 @@ ice_add_sysctls_mac_stats(struct sysctl_ctx_list *ctx, }; const struct ice_sysctl_info *entry = ctls; - while (entry->stat != 0) { + while (entry->stat != NULL) { SYSCTL_ADD_U64(ctx, mac_list, OID_AUTO, entry->name, CTLFLAG_RD | CTLFLAG_STATS, entry->stat, 0, entry->description); @@ -7255,7 +7255,7 @@ ice_add_txq_sysctls(struct ice_tx_queue *txq) this_txq_list = SYSCTL_CHILDREN(txq_node); /* Add the Tx queue statistics */ - while (entry->stat != 0) { + while (entry->stat != NULL) { SYSCTL_ADD_U64(ctx, this_txq_list, OID_AUTO, entry->name, CTLFLAG_RD | CTLFLAG_STATS, entry->stat, 0, entry->description); @@ -7301,7 +7301,7 @@ ice_add_rxq_sysctls(struct ice_rx_queue *rxq) this_rxq_list = SYSCTL_CHILDREN(rxq_node); /* Add the Rx queue statistics */ - while (entry->stat != 0) { + while (entry->stat != NULL) { SYSCTL_ADD_U64(ctx, this_rxq_list, OID_AUTO, entry->name, CTLFLAG_RD | CTLFLAG_STATS, entry->stat, 0, entry->description); diff -u -p a/dev/hid/hidraw.c b/dev/hid/hidraw.c --- a/dev/hid/hidraw.c +++ b/dev/hid/hidraw.c @@ -371,7 +371,7 @@ hidraw_open(struct cdev *dev, int flag, int mode, stru /* Set up interrupt pipe. */ sc->sc_state.immed = false; - sc->sc_async = 0; + sc->sc_async = NULL; sc->sc_state.uhid = false; /* hidraw mode is default */ sc->sc_state.quiet = false; sc->sc_head = sc->sc_tail = 0; @@ -393,7 +393,7 @@ hidraw_dtor(void *data) hid_intr_stop(sc->sc_dev); sc->sc_tail = sc->sc_head = 0; - sc->sc_async = 0; + sc->sc_async = NULL; free(sc->sc_q, M_DEVBUF); free(sc->sc_qlen, M_DEVBUF); sc->sc_q = NULL; diff -u -p a/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c b/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c --- a/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c +++ b/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c @@ -48,7 +48,7 @@ adf_heartbeat_dbg_add(struct adf_accel_dev *accel_dev) struct sysctl_ctx_list *qat_hb_sysctl_ctx; struct sysctl_oid *qat_hb_sysctl_tree; struct adf_heartbeat *hb; - struct sysctl_oid *rc = 0; + struct sysctl_oid *rc = NULL; if (accel_dev == NULL) { return EINVAL; diff -u -p a/dev/qat/qat_common/qat_uclo.c b/dev/qat/qat_common/qat_uclo.c --- a/dev/qat/qat_common/qat_uclo.c +++ b/dev/qat/qat_common/qat_uclo.c @@ -1973,7 +1973,7 @@ qat_uclo_map_objs_from_mof(struct icp_qat_mof_handle * struct icp_qat_mof_obj_chunkhdr *uobj_chunkhdr; struct icp_qat_mof_obj_chunkhdr *sobj_chunkhdr; unsigned int uobj_chunk_num = 0, sobj_chunk_num = 0; - unsigned int *valid_chunks = 0; + unsigned int *valid_chunks = NULL; int ret, i; uobj_hdr = (const struct icp_qat_mof_obj_hdr *)mobj_handle->uobjs_hdr; diff -u -p a/dev/qat/qat_common/adf_freebsd_ver_dbg.c b/dev/qat/qat_common/adf_freebsd_ver_dbg.c --- a/dev/qat/qat_common/adf_freebsd_ver_dbg.c +++ b/dev/qat/qat_common/adf_freebsd_ver_dbg.c @@ -86,7 +86,7 @@ adf_ver_dbg_add(struct adf_accel_dev *accel_dev) { struct sysctl_ctx_list *qat_sysctl_ctx; struct sysctl_oid *qat_sysctl_tree; - struct sysctl_oid *rc = 0; + struct sysctl_oid *rc = NULL; if (!accel_dev) return -EINVAL; diff -u -p a/dev/qat/qat_common/adf_clock.c b/dev/qat/qat_common/adf_clock.c --- a/dev/qat/qat_common/adf_clock.c +++ b/dev/qat/qat_common/adf_clock.c @@ -28,7 +28,7 @@ adf_clock_debugfs_add(struct adf_accel_dev *accel_dev) struct sysctl_ctx_list *qat_sysctl_ctx; struct sysctl_oid *qat_sysctl_tree; - struct sysctl_oid *rc = 0; + struct sysctl_oid *rc = NULL; qat_sysctl_ctx = device_get_sysctl_ctx(accel_dev->accel_pci_dev.pci_dev); diff -u -p a/dev/qat/qat_common/adf_fw_counters.c b/dev/qat/qat_common/adf_fw_counters.c --- a/dev/qat/qat_common/adf_fw_counters.c +++ b/dev/qat/qat_common/adf_fw_counters.c @@ -211,7 +211,7 @@ adf_fw_counters_add(struct adf_accel_dev *accel_dev) struct adf_fw_counters_data *fw_counters_data; struct sysctl_ctx_list *qat_sysctl_ctx; struct sysctl_oid *qat_sysctl_tree; - struct sysctl_oid *rc = 0; + struct sysctl_oid *rc = NULL; fw_counters_data = malloc(sizeof(*fw_counters_data), M_QAT, M_WAITOK | M_ZERO); diff -u -p a/dev/ixl/ixl_txrx.c b/dev/ixl/ixl_txrx.c --- a/dev/ixl/ixl_txrx.c +++ b/dev/ixl/ixl_txrx.c @@ -881,7 +881,7 @@ ixl_add_sysctls_eth_stats(struct sysctl_ctx_list *ctx, }; struct ixl_sysctl_info *entry = ctls; - while (entry->stat != 0) + while (entry->stat != NULL) { SYSCTL_ADD_UQUAD(ctx, child, OID_AUTO, entry->name, CTLFLAG_RD, entry->stat, diff -u -p a/dev/cfe/cfe_api.c b/dev/cfe/cfe_api.c --- a/dev/cfe/cfe_api.c +++ b/dev/cfe/cfe_api.c @@ -71,7 +71,7 @@ int cfe_iocb_dispatch(cfe_xiocb_t *xiocb); * passed in two registers each, and CFE expects one. */ -static int (*cfe_dispfunc)(intptr_t handle, intptr_t xiocb) = 0; +static int (*cfe_dispfunc)(intptr_t handle, intptr_t xiocb) = NULL; static cfe_xuint_t cfe_handle = 0; int diff -u -p a/dev/hptmv/gui_lib.c b/dev/hptmv/gui_lib.c --- a/dev/hptmv/gui_lib.c +++ b/dev/hptmv/gui_lib.c @@ -1311,7 +1311,7 @@ int hpt_default_ioctl(_VBUS_ARG if (nInBufferSize!=sizeof(DEVICEID)) return -1; id = *(DEVICEID *)lpInBuffer; - while(pAdapter != 0) + while(pAdapter != NULL) { pVBus = &pAdapter->VBus; for(i = 0; i < MAX_VDEVICE_PER_VBUS; i++) diff -u -p a/dev/hptmv/entry.c b/dev/hptmv/entry.c --- a/dev/hptmv/entry.c +++ b/dev/hptmv/entry.c @@ -1701,7 +1701,7 @@ fDeviceSendCommand(_VBUS_ARG PCommand pCmd) void fDeviceSendCommand(_VBUS_ARG PCommand pCmd) { - MV_SATA_EDMA_PRD_ENTRY *pPRDTable = 0; + MV_SATA_EDMA_PRD_ENTRY *pPRDTable = NULL; MV_SATA_ADAPTER *pMvSataAdapter; MV_SATA_CHANNEL *pMvSataChannel; PVDevice pVDevice = pCmd->pVDevice; diff -u -p a/i386/i386/db_trace.c b/i386/i386/db_trace.c --- a/i386/i386/db_trace.c +++ b/i386/i386/db_trace.c @@ -349,7 +349,7 @@ db_nextframe(struct i386_frame **fp, db_addr_t *ip, st */ if (tf == NULL) { *ip = 0; - *fp = 0; + *fp = NULL; db_printf("--- kthread start\n"); return; } diff -u -p a/contrib/ncsw/etc/mm.c b/contrib/ncsw/etc/mm.c --- a/contrib/ncsw/etc/mm.c +++ b/contrib/ncsw/etc/mm.c @@ -83,7 +83,7 @@ static t_BusyBlock * CreateBusyBlock(uint64_t base, ui n = MM_MAX_NAME_LEN - 1; strncpy(p_BusyBlock->name, name, MM_MAX_NAME_LEN-1); p_BusyBlock->name[n] = '\0'; - p_BusyBlock->p_Next = 0; + p_BusyBlock->p_Next = NULL; return p_BusyBlock; } @@ -116,7 +116,7 @@ static t_MemBlock * CreateNewBlock(uint64_t base, uint p_MemBlock->base = base; p_MemBlock->end = base+size; - p_MemBlock->p_Next = 0; + p_MemBlock->p_Next = NULL; return p_MemBlock; } @@ -149,7 +149,7 @@ static t_FreeBlock * CreateFreeBlock(uint64_t base, ui p_FreeBlock->base = base; p_FreeBlock->end = base + size; - p_FreeBlock->p_Next = 0; + p_FreeBlock->p_Next = NULL; return p_FreeBlock; } @@ -182,7 +182,7 @@ static t_Error AddFree(t_MM *p_MM, uint64_t base, uint /* Updates free lists to include a just released block */ for (i=0; i <= MM_MAX_ALIGNMENT; i++) { - p_PrevB = p_NewB = 0; + p_PrevB = p_NewB = NULL; p_CurrB = p_MM->freeBlocks[i]; alignment = (uint64_t)(0x1 << i); @@ -313,7 +313,7 @@ static t_Error CutFree(t_MM *p_MM, uint64_t holdBase, for (i=0; i <= MM_MAX_ALIGNMENT; i++) { - p_PrevB = p_NewB = 0; + p_PrevB = p_NewB = NULL; p_CurrB = p_MM->freeBlocks[i]; alignment = (uint64_t)(0x1 << i); @@ -400,7 +400,7 @@ static void AddBusy(t_MM *p_MM, t_BusyBlock *p_NewBusy t_BusyBlock *p_CurrBusyB, *p_PrevBusyB; /* finds a place of a new busy block in the list of busy blocks */ - p_PrevBusyB = 0; + p_PrevBusyB = NULL; p_CurrBusyB = p_MM->busyBlocks; while ( p_CurrBusyB && p_NewBusyB->base > p_CurrBusyB->base ) @@ -446,7 +446,7 @@ static t_Error CutBusy(t_MM *p_MM, uint64_t base, uint t_BusyBlock *p_CurrB, *p_PrevB, *p_NewB; p_CurrB = p_MM->busyBlocks; - p_PrevB = p_NewB = 0; + p_PrevB = p_NewB = NULL; while ( p_CurrB ) { @@ -622,7 +622,7 @@ t_Error MM_Init(t_Handle *h_MM, uint64_t base, uint64_ p_MM->freeMemSize = size; /* A busy list is empty */ - p_MM->busyBlocks = 0; + p_MM->busyBlocks = NULL; /* Initializes a new memory block */ if ((p_MM->memBlocks = CreateNewBlock(base, size)) == NULL) @@ -937,7 +937,7 @@ uint64_t MM_Put(t_Handle h_MM, uint64_t base) /* Look for a busy block that have the given base value. * That block will be returned back to the memory. */ - p_PrevBusyB = 0; + p_PrevBusyB = NULL; intFlags = XX_LockIntrSpinlock(p_MM->h_Spinlock); p_BusyB = p_MM->busyBlocks; @@ -1054,7 +1054,7 @@ t_Error MM_Add(t_Handle h_MM, uint64_t base, uint64_t if (errCode) { XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags); - p_MemB->p_Next = 0; + p_MemB->p_Next = NULL; XX_Free(p_NewMemB); return ((t_Error)errCode); } diff -u -p a/contrib/ncsw/Peripherals/FM/Port/fm_port.c b/contrib/ncsw/Peripherals/FM/Port/fm_port.c --- a/contrib/ncsw/Peripherals/FM/Port/fm_port.c +++ b/contrib/ncsw/Peripherals/FM/Port/fm_port.c @@ -2558,8 +2558,8 @@ t_Handle FM_PORT_Config(t_FmPortParams *p_FmPortParams return p_FmPort; } -t_FmPort *rx_port = 0; -t_FmPort *tx_port = 0; +t_FmPort *rx_port = NULL; +t_FmPort *tx_port = NULL; /**************************************************************************//** @Function FM_PORT_Init diff -u -p a/contrib/openzfs/cmd/zstream/zstream_dump.c b/contrib/openzfs/cmd/zstream/zstream_dump.c --- a/contrib/openzfs/cmd/zstream/zstream_dump.c +++ b/contrib/openzfs/cmd/zstream/zstream_dump.c @@ -55,7 +55,7 @@ static uint64_t total_stream_len = 0; #define DUMP_GROUPING 4 static uint64_t total_stream_len = 0; -static FILE *send_stream = 0; +static FILE *send_stream = NULL; static boolean_t do_byteswap = B_FALSE; static boolean_t do_cksum = B_TRUE; diff -u -p a/contrib/openzfs/lib/libzfs/libzfs_dataset.c b/contrib/openzfs/lib/libzfs/libzfs_dataset.c --- a/contrib/openzfs/lib/libzfs/libzfs_dataset.c +++ b/contrib/openzfs/lib/libzfs/libzfs_dataset.c @@ -3780,7 +3780,7 @@ zfs_create(libzfs_handle_t *hdl, const char *path, zfs return (-1); if (props && (props = zfs_valid_proplist(hdl, type, props, - zoned, NULL, zpool_handle, B_TRUE, errbuf)) == 0) { + zoned, NULL, zpool_handle, B_TRUE, errbuf)) == NULL) { zpool_close(zpool_handle); return (-1); } diff -u -p a/contrib/openzfs/lib/libzfs_core/libzfs_core.c b/contrib/openzfs/lib/libzfs_core/libzfs_core.c --- a/contrib/openzfs/lib/libzfs_core/libzfs_core.c +++ b/contrib/openzfs/lib/libzfs_core/libzfs_core.c @@ -718,7 +718,7 @@ lzc_send_wrapper(int (*func)(int, void *), int orig_fd void *send_err; close(rw[1]); pthread_join(send_thread, &send_err); - if (err == 0 && send_err != 0) + if (err == 0 && send_err != NULL) errno = err = (uintptr_t)send_err; return (err); diff -u -p a/contrib/openzfs/module/lua/ldebug.c b/contrib/openzfs/module/lua/ldebug.c --- a/contrib/openzfs/module/lua/ldebug.c +++ b/contrib/openzfs/module/lua/ldebug.c @@ -158,7 +158,7 @@ LUA_API const char *lua_getlocal (lua_State *L, const name = luaF_getlocalname(clLvalue(L->top - 1)->p, n, 0); } else { /* active function; get information through 'ar' */ - StkId pos = 0; /* to avoid warnings */ + StkId pos = NULL; /* to avoid warnings */ name = findlocal(L, ar->i_ci, n, &pos); if (name) { setobj2s(L, L->top, pos); @@ -172,7 +172,7 @@ LUA_API const char *lua_setlocal (lua_State *L, const LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) { - StkId pos = 0; /* to avoid warnings */ + StkId pos = NULL; /* to avoid warnings */ const char *name; lua_lock(L); swapextra(L); diff -u -p a/contrib/openzfs/module/zfs/zfs_chksum.c b/contrib/openzfs/module/zfs/zfs_chksum.c --- a/contrib/openzfs/module/zfs/zfs_chksum.c +++ b/contrib/openzfs/module/zfs/zfs_chksum.c @@ -51,7 +51,7 @@ typedef struct { zio_checksum_tmpl_free_t *(free); } chksum_stat_t; -static chksum_stat_t *chksum_stat_data = 0; +static chksum_stat_t *chksum_stat_data = NULL; static int chksum_stat_cnt = 0; static kstat_t *chksum_kstat = NULL; @@ -187,7 +187,7 @@ chksum_benchit(chksum_stat_t *cs) chksum_benchit(chksum_stat_t *cs) { abd_t *abd; - void *ctx = 0; + void *ctx = NULL; void *salt = &cs->salt.zcs_bytes; static int chksum_stat_limit = LIMIT_INIT; @@ -370,7 +370,7 @@ chksum_fini(void) kmem_free(chksum_stat_data, sizeof (chksum_stat_t) * chksum_stat_cnt); chksum_stat_cnt = 0; - chksum_stat_data = 0; + chksum_stat_data = NULL; } #ifdef _KERNEL diff -u -p a/contrib/openzfs/module/nvpair/fnvpair.c b/contrib/openzfs/module/nvpair/fnvpair.c --- a/contrib/openzfs/module/nvpair/fnvpair.c +++ b/contrib/openzfs/module/nvpair/fnvpair.c @@ -76,7 +76,7 @@ fnvlist_pack(nvlist_t *nvl, size_t *sizep) char * fnvlist_pack(nvlist_t *nvl, size_t *sizep) { - char *packed = 0; + char *packed = NULL; VERIFY3U(nvlist_pack(nvl, &packed, sizep, NV_ENCODE_NATIVE, KM_SLEEP), ==, 0); return (packed); diff -u -p a/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c b/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c --- a/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c +++ b/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c @@ -87,7 +87,7 @@ void ar9300_calibration_data_set(struct ath_hal *ah, i */ void ar9300_calibration_data_set(struct ath_hal *ah, int32_t source) { - if (ah != 0) { + if (ah != NULL) { AH9300(ah)->calibration_data_source = source; } else { calibration_data_try = source; @@ -96,7 +96,7 @@ int32_t ar9300_calibration_data_get(struct ath_hal *ah int32_t ar9300_calibration_data_get(struct ath_hal *ah) { - if (ah != 0) { + if (ah != NULL) { return AH9300(ah)->calibration_data_source; } else { return calibration_data_try; @@ -110,7 +110,7 @@ void ar9300_calibration_data_address_set(struct ath_ha */ void ar9300_calibration_data_address_set(struct ath_hal *ah, int32_t size) { - if (ah != 0) { + if (ah != NULL) { AH9300(ah)->calibration_data_source_address = size; } else { calibration_data_try_address = size; @@ -119,7 +119,7 @@ int32_t ar9300_calibration_data_address_get(struct ath int32_t ar9300_calibration_data_address_get(struct ath_hal *ah) { - if (ah != 0) { + if (ah != NULL) { return AH9300(ah)->calibration_data_source_address; } else { return calibration_data_try_address; @@ -149,13 +149,13 @@ int32_t ar9300_eeprom_template_install(struct ath_hal mptr = &ahp->ah_eeprom; mdata_size = ar9300_eeprom_struct_size(); - if (mptr != 0) { + if (mptr != NULL) { #if 0 calibration_data_source = calibration_data_none; calibration_data_source_address = 0; #endif dptr = ar9300_eeprom_struct_default_find_by_id(value); - if (dptr != 0) { + if (dptr != NULL) { OS_MEMCPY(mptr, dptr, mdata_size); return 0; } @@ -181,7 +181,7 @@ ar9300_eeprom_restore_something(struct ath_hal *ah, ar AH9300(ah)->calibration_data_source_address = 0; dptr = ar9300_eeprom_struct_default_find_by_id( Ar9300_eeprom_template_preference); - if (dptr != 0) { + if (dptr != NULL) { OS_MEMCPY(mptr, dptr, mdata_size); nptr = 0; } @@ -195,7 +195,7 @@ ar9300_eeprom_restore_something(struct ath_hal *ah, ar AH9300(ah)->calibration_data_source_address = 0; dptr = ar9300_eeprom_struct_default_find_by_id( ar9300_eeprom_template_default); - if (dptr != 0) { + if (dptr != NULL) { OS_MEMCPY(mptr, dptr, mdata_size); nptr = 0; } @@ -209,7 +209,7 @@ ar9300_eeprom_restore_something(struct ath_hal *ah, ar AH9300(ah)->calibration_data_source_address = 0; for (it = ar9300_eeprom_struct_default_many() - 1; it >= 0; it--) { dptr = ar9300_eeprom_struct_default(it); - if (dptr != 0) { + if (dptr != NULL) { OS_MEMCPY(mptr, dptr, mdata_size); nptr = 0; break; @@ -3640,7 +3640,7 @@ ar9300_eeprom_struct_default_find_by_id(int id) int it; for (it = 0; it < ARRAY_LENGTH(default9300); it++) { - if (default9300[it] != 0 && default9300[it]->template_version == id) { + if (default9300[it] != NULL && default9300[it]->template_version == id) { return default9300[it]; } } @@ -4395,7 +4395,7 @@ void ar9300_eeprom_template_swap(void) for (it = 0; it < ARRAY_LENGTH(default9300); it++) { dptr = ar9300_eeprom_struct_default(it); - if (dptr != 0) { + if (dptr != NULL) { ar9300_swap_eeprom(dptr); } } @@ -4418,7 +4418,7 @@ ar9300_eeprom_restore(struct ath_hal *ah) mptr = &ahp->ah_eeprom; mdata_size = ar9300_eeprom_struct_size(); - if (mptr != 0 && mdata_size > 0) { + if (mptr != NULL && mdata_size > 0) { #if AH_BYTE_ORDER == AH_BIG_ENDIAN ar9300_eeprom_template_swap(); ar9300_swap_eeprom(mptr); @@ -4785,7 +4785,7 @@ u_int8_t ar9300_eeprom_set_tx_gain_cap(struct ath_hal } } for (ig = 1; ig <= tx_gain_table_max; ig++) { - if (ah != 0 && ah->ah_reset != 0) + if (ah != NULL && ah->ah_reset != 0) { ar9300_eeprom_get_pcdac_tx_gain_table_i(ah, ig, &pcdac); if (pcdac >= tx_gain_max[i]) diff -u -p a/contrib/zstd/programs/fileio.c b/contrib/zstd/programs/fileio.c --- a/contrib/zstd/programs/fileio.c +++ b/contrib/zstd/programs/fileio.c @@ -2875,7 +2875,7 @@ FIO_decompressMultipleFilenames(FIO_ctx_t* const fCtx, } if (!prefs->testMode) { ress.dstFile = FIO_openDstFile(fCtx, prefs, NULL, outFileName, DEFAULT_FILE_PERMISSIONS); - if (ress.dstFile == 0) EXM_THROW(19, "cannot open %s", outFileName); + if (ress.dstFile == NULL) EXM_THROW(19, "cannot open %s", outFileName); } for (; fCtx->currFileIdx < fCtx->nbFilesTotal; fCtx->currFileIdx++) { status = FIO_decompressSrcFile(fCtx, prefs, ress, outFileName, srcNamesTable[fCtx->currFileIdx]); diff -u -p a/contrib/libnv/nvlist.c b/contrib/libnv/nvlist.c --- a/contrib/libnv/nvlist.c +++ b/contrib/libnv/nvlist.c @@ -1849,7 +1849,7 @@ nvlist_move_descriptor_array(nvlist_t *nvl, const char size_t i; if (nvlist_error(nvl) != 0) { - if (value != 0) { + if (value != NULL) { for (i = 0; i < nitems; i++) close(value[i]); nv_free(value); diff -u -p a/kern/link_elf_obj.c b/kern/link_elf_obj.c --- a/kern/link_elf_obj.c +++ b/kern/link_elf_obj.c @@ -807,7 +807,7 @@ link_elf_load_file(linker_class_t cls, const char *fil } ef = (elf_file_t) lf; ef->nprogtab = 0; - ef->e_shdr = 0; + ef->e_shdr = NULL; ef->nreltab = 0; ef->nrelatab = 0; diff -u -p a/powerpc/powerpc/interrupt.c b/powerpc/powerpc/interrupt.c --- a/powerpc/powerpc/interrupt.c +++ b/powerpc/powerpc/interrupt.c @@ -124,7 +124,7 @@ powerpc_interrupt(struct trapframe *framep) #ifdef POWERNV case EXC_HMI: - if (hmi_handler != 0 && hmi_handler(framep) == 0) + if (hmi_handler != NULL && hmi_handler(framep) == 0) break; /* If no handler, or failure to handle, just drop to trap. */ #endif diff -u -p a/powerpc/booke/pmap_64.c b/powerpc/booke/pmap_64.c --- a/powerpc/booke/pmap_64.c +++ b/powerpc/booke/pmap_64.c @@ -218,10 +218,10 @@ pte_find_next(pmap_t pmap, vm_offset_t *pva) /* truncate the VA for later. */ va &= ~((1UL << (PG_ROOT_H + 1)) - 1); for (; i < PG_ROOT_NENTRIES; i++, j = 0, k = 0, l = 0) { - if (pm_root[i] == 0) + if (pm_root[i] == NULL) continue; for (; j < PDIR_L1_NENTRIES; j++, k = 0, l = 0) { - if (pm_root[i][j] == 0) + if (pm_root[i][j] == NULL) continue; for (; k < PDIR_NENTRIES; k++, l = 0) { if (pm_root[i][j][k] == NULL) diff -u -p a/libkern/divmoddi4.c b/libkern/divmoddi4.c --- a/libkern/divmoddi4.c +++ b/libkern/divmoddi4.c @@ -59,7 +59,7 @@ __divmoddi4(quad_t a, quad_t b, quad_t *rem) } else ub = b; uq = __qdivrem(ua, ub, &urem); - if (rem != 0) + if (rem != NULL) *rem = negr ? -urem : urem; return (negq ? -uq : uq); } diff -u -p a/arm64/arm64/trap.c b/arm64/arm64/trap.c --- a/arm64/arm64/trap.c +++ b/arm64/arm64/trap.c @@ -549,7 +549,7 @@ do_el1h_sync(struct thread *td, struct trapframe *fram case EXCP_BRK: #ifdef KDTRACE_HOOKS if ((esr & ESR_ELx_ISS_MASK) == 0x40d && \ - dtrace_invop_jump_addr != 0) { + dtrace_invop_jump_addr != NULL) { dtrace_invop_jump_addr(frame); break; } diff -u -p a/arm64/arm64/pl031_rtc.c b/arm64/arm64/pl031_rtc.c --- a/arm64/arm64/pl031_rtc.c +++ b/arm64/arm64/pl031_rtc.c @@ -90,7 +90,7 @@ pl031_attach(device_t dev) sc->reg_rid = 0; sc->reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->reg_rid, RF_ACTIVE); - if (sc->reg == 0) + if (sc->reg == NULL) return (ENXIO); clock_register(dev, 1000000); diff -u -p a/netlink/netlink_domain.c b/netlink/netlink_domain.c --- a/netlink/netlink_domain.c +++ b/netlink/netlink_domain.c @@ -274,7 +274,7 @@ nl_find_port(void) return (curproc->p_pid); for (int i = 0; i < 16; i++) { uint32_t nl_port = (arc4random() % 65536) + 65536 * 4; - if (nl_port_lookup(nl_port) == 0) + if (nl_port_lookup(nl_port) == NULL) return (nl_port); NL_LOG(LOG_DEBUG3, "tried %u\n", nl_port); } @@ -437,7 +437,7 @@ nl_autobind_port(struct nlpcb *nlp, uint32_t candidate for (int i = 0; i < 10; i++) { NL_LOG(LOG_DEBUG3, "socket %p, trying to assign port %d", nlp->nl_socket, port_id); NLCTL_RLOCK(ctl); - exist = nl_port_lookup(port_id) != 0; + exist = nl_port_lookup(port_id) != NULL; NLCTL_RUNLOCK(ctl); if (!exist) { error = nl_assign_port(nlp, port_id); diff -u -p a/netlink/route/iface.c b/netlink/route/iface.c --- a/netlink/route/iface.c +++ b/netlink/route/iface.c @@ -1252,7 +1252,7 @@ handle_newaddr_inet6(struct nlmsghdr *hdr, struct nl_p uint32_t flags = nl_flags_to_in6(attrs->ifa_flags) | attrs->ifaf_flags; uint32_t pltime = 0, vltime = 0; - if (attrs->ifa_cacheinfo != 0) { + if (attrs->ifa_cacheinfo != NULL) { pltime = attrs->ifa_cacheinfo->ifa_prefered; vltime = attrs->ifa_cacheinfo->ifa_valid; } diff -u -p a/geom/geom_ctl.c b/geom/geom_ctl.c --- a/geom/geom_ctl.c +++ b/geom/geom_ctl.c @@ -536,7 +536,7 @@ g_ctl_getxml(struct gctl_req *req, struct g_class *mp) } KASSERT(i == n, ("different number of geoms found (%d != %d)", i, n)); - gps[i] = 0; + gps[i] = NULL; buf = gctl_get_param_flags(req, "output", GCTL_PARAM_WR, &len); if (buf == NULL) { diff -u -p a/cddl/dev/dtrace/amd64/dtrace_isa.c b/cddl/dev/dtrace/amd64/dtrace_isa.c --- a/cddl/dev/dtrace/amd64/dtrace_isa.c +++ b/cddl/dev/dtrace/amd64/dtrace_isa.c @@ -64,7 +64,7 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in vm_offset_t callpc; pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; - if (intrpc != 0) + if (intrpc != NULL) pcstack[depth++] = (pc_t) intrpc; aframes++; diff -u -p a/cddl/dev/dtrace/powerpc/dtrace_subr.c b/cddl/dev/dtrace/powerpc/dtrace_subr.c --- a/cddl/dev/dtrace/powerpc/dtrace_subr.c +++ b/cddl/dev/dtrace/powerpc/dtrace_subr.c @@ -363,5 +363,5 @@ void dtrace_invop_uninit(void) void dtrace_invop_uninit(void) { - dtrace_invop_jump_addr = 0; + dtrace_invop_jump_addr = NULL; } diff -u -p a/cddl/dev/dtrace/powerpc/dtrace_isa.c b/cddl/dev/dtrace/powerpc/dtrace_isa.c --- a/cddl/dev/dtrace/powerpc/dtrace_isa.c +++ b/cddl/dev/dtrace/powerpc/dtrace_isa.c @@ -102,7 +102,7 @@ dtrace_next_sp_pc(uintptr_t sp, uintptr_t *nsp, uintpt vm_offset_t callpc; struct trapframe *frame; - if (lr != 0 && *lr != 0) + if (lr != NULL && *lr != 0) callpc = *lr; else #ifdef __powerpc64__ @@ -148,7 +148,7 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; osp = PAGE_SIZE; - if (intrpc != 0) + if (intrpc != NULL) pcstack[depth++] = (pc_t) intrpc; aframes++; diff -u -p a/cddl/dev/dtrace/i386/dtrace_isa.c b/cddl/dev/dtrace/i386/dtrace_isa.c --- a/cddl/dev/dtrace/i386/dtrace_isa.c +++ b/cddl/dev/dtrace/i386/dtrace_isa.c @@ -63,7 +63,7 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in vm_offset_t callpc; pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; - if (intrpc != 0) + if (intrpc != NULL) pcstack[depth++] = (pc_t) intrpc; aframes++; diff -u -p a/cddl/dev/dtrace/arm/dtrace_subr.c b/cddl/dev/dtrace/arm/dtrace_subr.c --- a/cddl/dev/dtrace/arm/dtrace_subr.c +++ b/cddl/dev/dtrace/arm/dtrace_subr.c @@ -353,5 +353,5 @@ void dtrace_invop_uninit(void) void dtrace_invop_uninit(void) { - dtrace_invop_jump_addr = 0; + dtrace_invop_jump_addr = NULL; } diff -u -p a/cddl/dev/dtrace/arm/dtrace_isa.c b/cddl/dev/dtrace/arm/dtrace_isa.c --- a/cddl/dev/dtrace/arm/dtrace_isa.c +++ b/cddl/dev/dtrace/arm/dtrace_isa.c @@ -63,7 +63,7 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in int scp_offset; int depth = 0; - if (intrpc != 0) + if (intrpc != NULL) pcstack[depth++] = (pc_t) intrpc; aframes++; diff -u -p a/cddl/dev/dtrace/aarch64/dtrace_subr.c b/cddl/dev/dtrace/aarch64/dtrace_subr.c --- a/cddl/dev/dtrace/aarch64/dtrace_subr.c +++ b/cddl/dev/dtrace/aarch64/dtrace_subr.c @@ -345,5 +345,5 @@ dtrace_invop_uninit(void) dtrace_invop_uninit(void) { - dtrace_invop_jump_addr = 0; + dtrace_invop_jump_addr = NULL; } diff -u -p a/cddl/dev/dtrace/aarch64/dtrace_isa.c b/cddl/dev/dtrace/aarch64/dtrace_isa.c --- a/cddl/dev/dtrace/aarch64/dtrace_isa.c +++ b/cddl/dev/dtrace/aarch64/dtrace_isa.c @@ -68,7 +68,7 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in depth = 0; - if (intrpc != 0) { + if (intrpc != NULL) { pcstack[depth++] = (pc_t) intrpc; } diff -u -p a/cddl/dev/dtrace/riscv/dtrace_isa.c b/cddl/dev/dtrace/riscv/dtrace_isa.c --- a/cddl/dev/dtrace/riscv/dtrace_isa.c +++ b/cddl/dev/dtrace/riscv/dtrace_isa.c @@ -79,7 +79,7 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in depth = 0; caller = solaris_cpu[curcpu].cpu_dtrace_caller; - if (intrpc != 0) { + if (intrpc != NULL) { pcstack[depth++] = (pc_t)intrpc; } diff -u -p a/cddl/dev/dtrace/riscv/dtrace_subr.c b/cddl/dev/dtrace/riscv/dtrace_subr.c --- a/cddl/dev/dtrace/riscv/dtrace_subr.c +++ b/cddl/dev/dtrace/riscv/dtrace_subr.c @@ -308,5 +308,5 @@ dtrace_invop_uninit(void) dtrace_invop_uninit(void) { - dtrace_invop_jump_addr = 0; + dtrace_invop_jump_addr = NULL; } diff -u -p a/cddl/boot/zfs/blake3_zfs.c b/cddl/boot/zfs/blake3_zfs.c --- a/cddl/boot/zfs/blake3_zfs.c +++ b/cddl/boot/zfs/blake3_zfs.c @@ -36,7 +36,7 @@ zio_checksum_blake3_native(const void *buf, uint64_t s { BLAKE3_CTX ctx; - ASSERT(ctx_template != 0); + ASSERT(ctx_template != NULL); memcpy(&ctx, ctx_template, sizeof(ctx)); Blake3_Update(&ctx, buf, size); @@ -56,7 +56,7 @@ zio_checksum_blake3_byteswap(const void *buf, uint64_t { zio_cksum_t tmp; - ASSERT(ctx_template != 0); + ASSERT(ctx_template != NULL); zio_checksum_blake3_native(buf, size, ctx_template, &tmp); zcp->zc_word[0] = BSWAP_64(tmp.zc_word[0]);