From 88605e31eec6d1eaee70b8b769fef8117e0a0ea6 Mon Sep 17 00:00:00 2001 From: Josef 'Jeff' Sipek Date: Sat, 7 Jul 2018 17:10:14 -0400 Subject: [PATCH] remove unnecessary uint_t casts of 0 --- kernel/drivers/net/hxge/hxge_main.c | 2 +- kernel/drivers/net/nxge/nxge_main.c | 2 +- kernel/fs/hsfs/hsfs_vfsops.c | 2 +- kernel/fs/nfs/nfs4_subr.c | 2 +- kernel/fs/nfs/nfs_common.c | 2 +- kernel/fs/nfs/nfs_srv.c | 2 +- kernel/fs/specfs/specvfsops.c | 2 +- kernel/fs/udfs/udf_vfsops.c | 2 +- kernel/os/sunddi.c | 2 +- kernel/vm/seg_vn.c | 8 ++++---- usr/src/cmd/truss/codes.c | 2 +- usr/src/lib/libc/port/nsl/rpc_generic.c | 4 ++-- usr/src/lib/libc/port/nsl/xdr.c | 6 +++--- usr/src/lib/libc/port/nsl/xdr_array.c | 2 +- usr/src/lib/libc/port/nsl/xdr_refer.c | 2 +- usr/src/stand/lib/fs/nfs/mount.c | 4 ++-- usr/src/uts/common/io/drm/drm_irq.c | 2 +- usr/src/uts/common/io/ecpp.c | 4 ++-- usr/src/uts/common/io/fdc.c | 4 ++-- usr/src/uts/common/io/fibre-channel/fca/qlc/ql_api.c | 2 +- usr/src/uts/common/io/i8237A.c | 2 +- usr/src/uts/common/rpc/xdr.c | 2 +- usr/src/uts/common/rpc/xdr_array.c | 2 +- usr/src/uts/common/rpc/xdr_refer.c | 2 +- usr/src/uts/intel/io/amd8111s/amd8111s_main.c | 4 ++-- 25 files changed, 35 insertions(+), 35 deletions(-) diff --git a/kernel/drivers/net/hxge/hxge_main.c b/kernel/drivers/net/hxge/hxge_main.c index 03cfc086c4..5d6e5bc739 100644 --- a/kernel/drivers/net/hxge/hxge_main.c +++ b/kernel/drivers/net/hxge/hxge_main.c @@ -355,7 +355,7 @@ ddi_dma_attr_t hxge_rx_dma_attr = { }; ddi_dma_lim_t hxge_dma_limits = { - (uint_t)0, /* dlim_addr_lo */ + 0, /* dlim_addr_lo */ (uint_t)0xffffffff, /* dlim_addr_hi */ (uint_t)0xffffffff, /* dlim_cntr_max */ (uint_t)0xfc00fc, /* dlim_burstsizes for 32 and 64 bit xfers */ diff --git a/kernel/drivers/net/nxge/nxge_main.c b/kernel/drivers/net/nxge/nxge_main.c index e00e30c212..21b99cfc04 100644 --- a/kernel/drivers/net/nxge/nxge_main.c +++ b/kernel/drivers/net/nxge/nxge_main.c @@ -499,7 +499,7 @@ ddi_dma_attr_t nxge_rx_dma_attr = { }; ddi_dma_lim_t nxge_dma_limits = { - (uint_t)0, /* dlim_addr_lo */ + 0, /* dlim_addr_lo */ (uint_t)0xffffffff, /* dlim_addr_hi */ (uint_t)0xffffffff, /* dlim_cntr_max */ (uint_t)0xfc00fc, /* dlim_burstsizes for 32 and 64 bit xfers */ diff --git a/kernel/fs/hsfs/hsfs_vfsops.c b/kernel/fs/hsfs/hsfs_vfsops.c index 5328ca7a0f..a3dc5a5244 100644 --- a/kernel/fs/hsfs/hsfs_vfsops.c +++ b/kernel/fs/hsfs/hsfs_vfsops.c @@ -953,7 +953,7 @@ hs_getrootvp( if (!hsfs_valid_dir(&fsp->hsfs_vol.root_dir)) { hs_log_bogus_disk_warning(fsp, HSFS_ERR_BAD_ROOT_DIR, 0); if (hs_remakenode(fsp->hsfs_vol.root_dir.ext_lbn, - (uint_t)0, vfsp, &fsp->hsfs_rootvp)) { + 0, vfsp, &fsp->hsfs_rootvp)) { hs_mounttab = hs_mounttab->hsfs_next; mutex_destroy(&fsp->hsfs_free_lock); rw_destroy(&fsp->hsfs_hash_lock); diff --git a/kernel/fs/nfs/nfs4_subr.c b/kernel/fs/nfs/nfs4_subr.c index 0c2952ee83..92f35b3ac4 100644 --- a/kernel/fs/nfs/nfs4_subr.c +++ b/kernel/fs/nfs/nfs4_subr.c @@ -2902,7 +2902,7 @@ nfs4_directio(vnode_t *vp, int cmd, cred_t *cr) if (nfs4_has_pages(vp) && ((rp->r_flags & R4DIRTY) || rp->r_awcount > 0)) { - error = fop_putpage(vp, 0, (uint_t)0, + error = fop_putpage(vp, 0, 0, B_INVAL, cr, NULL); if (error) { if (error == ENOSPC || error == EDQUOT) { diff --git a/kernel/fs/nfs/nfs_common.c b/kernel/fs/nfs/nfs_common.c index 449314062f..4844deb934 100644 --- a/kernel/fs/nfs/nfs_common.c +++ b/kernel/fs/nfs/nfs_common.c @@ -592,7 +592,7 @@ nfs_directio(vnode_t *vp, int cmd, cred_t *cr) if (vn_has_cached_data(vp) && ((rp->r_flags & RDIRTY) || rp->r_awcount > 0)) { - error = fop_putpage(vp, 0, (uint_t)0, + error = fop_putpage(vp, 0, 0, B_INVAL, cr, NULL); if (error) { if (error == ENOSPC || error == EDQUOT) { diff --git a/kernel/fs/nfs/nfs_srv.c b/kernel/fs/nfs/nfs_srv.c index 4a05fea968..b588ac4b96 100644 --- a/kernel/fs/nfs/nfs_srv.c +++ b/kernel/fs/nfs/nfs_srv.c @@ -1406,7 +1406,7 @@ rfs_write(struct nfswriteargs *wa, struct nfsattrstat *ns, */ rp = nlp->list; off = rp->wa->wa_offset; - len = (uint_t)0; + len = 0; do { if (rdonly(rp->ro, vp)) { rp->ns->ns_status = NFSERR_ROFS; diff --git a/kernel/fs/specfs/specvfsops.c b/kernel/fs/specfs/specvfsops.c index 6742a94ad8..106532e547 100644 --- a/kernel/fs/specfs/specvfsops.c +++ b/kernel/fs/specfs/specvfsops.c @@ -154,7 +154,7 @@ spec_sync(struct vfs *vfsp, for (sp = sync_list; sp != NULL; sp = spnext) { spnext = sp->s_list; vp = STOV(sp); - (void) fop_putpage(vp, 0, (uint_t)0, B_ASYNC, cr, + (void) fop_putpage(vp, 0, 0, B_ASYNC, cr, NULL); VN_RELE(vp); /* Release our hold on vnode */ } diff --git a/kernel/fs/udfs/udf_vfsops.c b/kernel/fs/udfs/udf_vfsops.c index 35c9946664..2c99f8a58f 100644 --- a/kernel/fs/udfs/udf_vfsops.c +++ b/kernel/fs/udfs/udf_vfsops.c @@ -686,7 +686,7 @@ ud_mountfs(struct vfs *vfsp, */ if (udf_vfsp->udf_flags & UDF_FL_RDONLY) { (void) dnlc_purge_vfsp(vfsp, 0); - (void) fop_putpage(devvp, 0, (uint_t)0, + (void) fop_putpage(devvp, 0, 0, B_INVAL, CRED(), NULL); (void) ud_iflush(vfsp); bflush(dev); diff --git a/kernel/os/sunddi.c b/kernel/os/sunddi.c index ca89706faa..0c065f1063 100644 --- a/kernel/os/sunddi.c +++ b/kernel/os/sunddi.c @@ -7121,7 +7121,7 @@ ddi_dma_addr_bind_handle(ddi_dma_handle_t handle, struct as *as, struct ddi_dma_req dmareq; int (*funcp)(); - if (len == (uint_t)0) { + if (len == 0) { return (DDI_DMA_NOMAPPING); } dmareq.dmar_flags = flags; diff --git a/kernel/vm/seg_vn.c b/kernel/vm/seg_vn.c index f60135e5b0..561fd03b34 100644 --- a/kernel/vm/seg_vn.c +++ b/kernel/vm/seg_vn.c @@ -7299,7 +7299,7 @@ segvn_incore(struct seg *seg, caddr_t addr, size_t len, char *vec) /* * If page is mapped and writable */ - attr = (uint_t)0; + attr = 0; if ((hat_getattr(seg->s_as->a_hat, addr, &attr) != -1) && (attr & PROT_WRITE)) { ret |= SEG_PAGE_ANON; @@ -9181,7 +9181,7 @@ segvn_pagelock(struct seg *seg, caddr_t addr, size_t len, struct page ***ppp, pplist = pl; np = ((uintptr_t)(a - addr)) >> PAGESHIFT; - while (np > (uint_t)0) { + while (np > 0) { ASSERT(PAGE_LOCKED(*pplist)); page_unlock(*pplist); np--; @@ -9250,7 +9250,7 @@ segvn_reclaim(void *ptag, caddr_t addr, size_t len, struct page **pplist, ASSERT(pl[np] == NOPCACHE_SHWLIST || pl[np] == PCACHE_SHWLIST); ASSERT(!async || pl[np] == PCACHE_SHWLIST); - while (np > (uint_t)0) { + while (np > 0) { if (rw == S_WRITE) { hat_setrefmod(*pplist); } else { @@ -9323,7 +9323,7 @@ shamp_reclaim(void *ptag, caddr_t addr, size_t len, struct page **pplist, ASSERT(pl[np] == NOPCACHE_SHWLIST || pl[np] == PCACHE_SHWLIST); ASSERT(!async || pl[np] == PCACHE_SHWLIST); - while (np > (uint_t)0) { + while (np > 0) { if (rw == S_WRITE) { hat_setrefmod(*pplist); } else { diff --git a/usr/src/cmd/truss/codes.c b/usr/src/cmd/truss/codes.c index 383eb44170..c79aa24804 100644 --- a/usr/src/cmd/truss/codes.c +++ b/usr/src/cmd/truss/codes.c @@ -1641,7 +1641,7 @@ const struct ioc { "pm_searchargs_t" }, #endif /* _SYSCALL */ - { (uint_t)0, NULL, NULL } + { 0, NULL, NULL } }; void diff --git a/usr/src/lib/libc/port/nsl/rpc_generic.c b/usr/src/lib/libc/port/nsl/rpc_generic.c index 9c9bc11dbd..2fe7f8fd49 100644 --- a/usr/src/lib/libc/port/nsl/rpc_generic.c +++ b/usr/src/lib/libc/port/nsl/rpc_generic.c @@ -123,7 +123,7 @@ __rpc_get_t_size( t_scalar_t bufsize) /* Supported by the transport */ { if (bufsize == -2) /* transfer of data unsupported */ - return ((uint_t)0); + return (0); if (size == 0) { if ((bufsize == -1) || (bufsize == 0)) { /* @@ -151,7 +151,7 @@ __rpc_get_a_size( if (size >= 0) return ((uint_t)size); if (size <= -2) - return ((uint_t)0); + return (0); /* * (size == -1) No limit on the size. we impose a limit here. */ diff --git a/usr/src/lib/libc/port/nsl/xdr.c b/usr/src/lib/libc/port/nsl/xdr.c index 005de48560..974dc6ee7a 100644 --- a/usr/src/lib/libc/port/nsl/xdr.c +++ b/usr/src/lib/libc/port/nsl/xdr.c @@ -73,9 +73,9 @@ /* * constants specific to the xdr "protocol" */ -#define XDR_FALSE ((uint_t)0) -#define XDR_TRUE ((uint_t)1) -#define LASTUNSIGNED ((uint_t)0-1) +#define XDR_FALSE (0u) +#define XDR_TRUE (1u) +#define LASTUNSIGNED (~0u) /* fragment size to use when doing an xdr_string() */ #define FRAGMENT 65536 diff --git a/usr/src/lib/libc/port/nsl/xdr_array.c b/usr/src/lib/libc/port/nsl/xdr_array.c index 80e49cff4d..720750ea7d 100644 --- a/usr/src/lib/libc/port/nsl/xdr_array.c +++ b/usr/src/lib/libc/port/nsl/xdr_array.c @@ -50,7 +50,7 @@ #include #include -#define LASTUNSIGNED ((uint_t)0-1) +#define LASTUNSIGNED (~0u) char mem_err_msg_arr[] = "xdr_array: out of memory"; diff --git a/usr/src/lib/libc/port/nsl/xdr_refer.c b/usr/src/lib/libc/port/nsl/xdr_refer.c index c20ee180af..42f0017cc1 100644 --- a/usr/src/lib/libc/port/nsl/xdr_refer.c +++ b/usr/src/lib/libc/port/nsl/xdr_refer.c @@ -48,7 +48,7 @@ #include #include -#define LASTUNSIGNED ((uint_t)0-1) +#define LASTUNSIGNED (~0u) char mem_err_msg_ref[] = "xdr_reference: out of memory"; /* diff --git a/usr/src/stand/lib/fs/nfs/mount.c b/usr/src/stand/lib/fs/nfs/mount.c index 2c394b98ab..59bf6a6800 100644 --- a/usr/src/stand/lib/fs/nfs/mount.c +++ b/usr/src/stand/lib/fs/nfs/mount.c @@ -440,7 +440,7 @@ nfs4init(char *path, uint16_t nfs_port) roothandle.version = NFS_V4; roothandle.ftype.type4 = NF4DIR; roothandle.fh.fh4.len = 0; /* Force a PUTROOTFH */ - roothandle.offset = (uint_t)0; /* it's a directory! */ + roothandle.offset = 0; /* it's a directory! */ error = lookup(path, &rootpath, TRUE); if (error) { @@ -761,7 +761,7 @@ domount: /* * Only v2 and v3 go on from here. */ - roothandle.offset = (uint_t)0; /* it's a directory! */ + roothandle.offset = 0; /* it's a directory! */ root_to.sin_port = htons(nfs_port); /* NFS is next after mount */ /* diff --git a/usr/src/uts/common/io/drm/drm_irq.c b/usr/src/uts/common/io/drm/drm_irq.c index 3d3640a3bd..bffc1c006d 100644 --- a/usr/src/uts/common/io/drm/drm_irq.c +++ b/usr/src/uts/common/io/drm/drm_irq.c @@ -202,7 +202,7 @@ drm_install_irq_handle(drm_device_t *dev) return (DDI_FAILURE); } - if (ddi_get_iblock_cookie(dip, (uint_t)0, + if (ddi_get_iblock_cookie(dip, 0, &dev->intr_block) != DDI_SUCCESS) { DRM_ERROR("drm_install_irq_handle: cannot get iblock cookie"); return (DDI_FAILURE); diff --git a/usr/src/uts/common/io/ecpp.c b/usr/src/uts/common/io/ecpp.c index d9d3c1d035..5320d0086e 100644 --- a/usr/src/uts/common/io/ecpp.c +++ b/usr/src/uts/common/io/ecpp.c @@ -731,7 +731,7 @@ fail_iob: fail_minor: ddi_remove_softintr(pp->softintr_id); fail_softintr: - ddi_remove_intr(dip, (uint_t)0, pp->ecpp_trap_cookie); + ddi_remove_intr(dip, 0, pp->ecpp_trap_cookie); fail_intr: mutex_destroy(&pp->umutex); cv_destroy(&pp->pport_cv); @@ -806,7 +806,7 @@ ecpp_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) ddi_remove_softintr(pp->softintr_id); - ddi_remove_intr(dip, (uint_t)0, pp->ecpp_trap_cookie); + ddi_remove_intr(dip, 0, pp->ecpp_trap_cookie); if (pp->ksp) { kstat_delete(pp->ksp); diff --git a/usr/src/uts/common/io/fdc.c b/usr/src/uts/common/io/fdc.c index cd4d3a4145..a0816d2dc1 100644 --- a/usr/src/uts/common/io/fdc.c +++ b/usr/src/uts/common/io/fdc.c @@ -531,7 +531,7 @@ fdc_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) goto no_attach; /* get iblock cookie to initialize mutex used in the ISR */ - if (ddi_get_iblock_cookie(dip, (uint_t)0, &fcp->c_iblock) != + if (ddi_get_iblock_cookie(dip, 0, &fcp->c_iblock) != DDI_SUCCESS) { cmn_err(CE_WARN, "fdc_attach: cannot get iblock cookie"); @@ -541,7 +541,7 @@ fdc_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) intr_set = 1; /* setup interrupt handler */ - if (ddi_add_intr(dip, (uint_t)0, NULL, + if (ddi_add_intr(dip, 0, NULL, (ddi_idevice_cookie_t *)0, fdc_intr, (caddr_t)fcp) != DDI_SUCCESS) { cmn_err(CE_WARN, "fdc: cannot add intr"); diff --git a/usr/src/uts/common/io/fibre-channel/fca/qlc/ql_api.c b/usr/src/uts/common/io/fibre-channel/fca/qlc/ql_api.c index df7ee802b0..d3b03051fc 100644 --- a/usr/src/uts/common/io/fibre-channel/fca/qlc/ql_api.c +++ b/usr/src/uts/common/io/fibre-channel/fca/qlc/ql_api.c @@ -16805,7 +16805,7 @@ ql_legacy_intr(ql_adapter_state_t *ha) } /* Setup standard/legacy interrupt handler */ - if (ddi_add_intr(ha->dip, (uint_t)0, &ha->iblock_cookie, + if (ddi_add_intr(ha->dip, 0, &ha->iblock_cookie, (ddi_idevice_cookie_t *)0, ql_isr, (caddr_t)ha) != DDI_SUCCESS) { cmn_err(CE_WARN, "%s(%d): Failed to add legacy interrupt", QL_NAME, ha->instance); diff --git a/usr/src/uts/common/io/i8237A.c b/usr/src/uts/common/io/i8237A.c index 1f8c6181eb..c7e53e0093 100644 --- a/usr/src/uts/common/io/i8237A.c +++ b/usr/src/uts/common/io/i8237A.c @@ -130,7 +130,7 @@ d37A_init(dev_info_t *dip) ddi_iblock_cookie_t iblk_cookie = 0; int error; - if ((error = ddi_add_intr(dip, (uint_t)0, &iblk_cookie, + if ((error = ddi_add_intr(dip, 0, &iblk_cookie, (ddi_idevice_cookie_t *)0, d37A_intr, NULL)) != DDI_SUCCESS) { if (error != DDI_INTR_NOTFOUND) diff --git a/usr/src/uts/common/rpc/xdr.c b/usr/src/uts/common/rpc/xdr.c index 43817d1d2b..4d355f5530 100644 --- a/usr/src/uts/common/rpc/xdr.c +++ b/usr/src/uts/common/rpc/xdr.c @@ -63,7 +63,7 @@ */ #define XDR_FALSE ((int32_t)0) #define XDR_TRUE ((int32_t)1) -#define LASTUNSIGNED ((uint_t)0-1) +#define LASTUNSIGNED (~0u) /* * for unit alignment diff --git a/usr/src/uts/common/rpc/xdr_array.c b/usr/src/uts/common/rpc/xdr_array.c index d37dda6921..0036c63ff5 100644 --- a/usr/src/uts/common/rpc/xdr_array.c +++ b/usr/src/uts/common/rpc/xdr_array.c @@ -45,7 +45,7 @@ #include #include -#define LASTUNSIGNED ((uint_t)0-1) +#define LASTUNSIGNED (~0u) /* * XDR an array of arbitrary elements diff --git a/usr/src/uts/common/rpc/xdr_refer.c b/usr/src/uts/common/rpc/xdr_refer.c index a9ccadc865..cee39c2314 100644 --- a/usr/src/uts/common/rpc/xdr_refer.c +++ b/usr/src/uts/common/rpc/xdr_refer.c @@ -47,7 +47,7 @@ #include #include -#define LASTUNSIGNED ((uint_t)0-1) +#define LASTUNSIGNED (~0u) /* * XDR an indirect pointer diff --git a/usr/src/uts/intel/io/amd8111s/amd8111s_main.c b/usr/src/uts/intel/io/amd8111s/amd8111s_main.c index b2c3924c25..d4097e3f51 100644 --- a/usr/src/uts/intel/io/amd8111s/amd8111s_main.c +++ b/usr/src/uts/intel/io/amd8111s/amd8111s_main.c @@ -161,7 +161,7 @@ static ddi_dma_attr_t pcn_buff_dma_attr_t = { (uint64_t)0xFFFFFFFF, /* dma_attr_seg */ (int)1, /* dma_attr_sgllen */ (uint32_t)1, /* granularity */ - (uint_t)0 /* dma_attr_flags */ + 0 /* dma_attr_flags */ }; static ddi_dma_attr_t pcn_desc_dma_attr_t = { @@ -176,7 +176,7 @@ static ddi_dma_attr_t pcn_desc_dma_attr_t = { (uint64_t)0xFFFFFFFF, /* dma_attr_seg */ (int)1, /* dma_attr_sgllen */ (uint32_t)1, /* granularity */ - (uint_t)0 /* dma_attr_flags */ + 0 /* dma_attr_flags */ }; /* PIO access attributes for registers */ -- 2.11.4.GIT