diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2020-05-11 12:01:31 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2020-05-11 12:01:31 +0000 |
commit | 063fdf36a6e93abc3012115f9f680ba0f81bec14 (patch) | |
tree | feae45b64d22e2988395aea0a6de86789e937c23 /usr/src/uts | |
parent | 758901a3d01e7cc303843dc190e4bfa28b76f97c (diff) | |
parent | e7d144c90b0aab78554a319cc0a94cafe23a72a2 (diff) | |
download | illumos-joyent-063fdf36a6e93abc3012115f9f680ba0f81bec14.tar.gz |
[illumos-gate merge]
commit e7d144c90b0aab78554a319cc0a94cafe23a72a2
12544 e1000g: NULL pointer errors
commit 4e2c3273e98e347b3b0d6ea03be57eda0b8def7b
12543 chxge: NULL pointer errors
commit 4f82e07802416dd88f61770ddd96e9c040095895
12538 ldmad: NULL pointer errors
commit 38ff79119b4ef2a8e52068a5d95129909aadf342
12655 niagara: NULL pointer errors
commit cee39f3ff96ecf06e603339642e5393b7c1738e8
12710 loader: vdev_read() can corrupt memory
commit ec71f88e58593e3077f03588d3c38e6cbd4e8c1a
12671 hcksum routines are too verbose
12672 want mac_hcksum_clone function
commit bf21cd9318e0a3a51b7f02c14a7c1b1aef2dc861
12612 import Pluribus bhyve port
commit 4c7b9a81057545d490dd52cf823de529d8137a5b
12718 LDT overlap with TSS reintroduced in 12608
commit 5254d4fa5763710c9674cbc8308362326643d386
12715 Update tzdata to 2020a
commit b17aa18c453380499cb628ad8e7f7536bfd9d483
12653 vnet: smatch and NULL pointer errors
commit a5efd12c64532eac05eb5a4b6901396be06125bf
12652 platsvc: smatch and NULL pointer errors
commit 6e472272d020cb1e83ec4964e2a2f5761a354bcb
12651 vsw: NULL pointer errors
commit 90c84b2b51065d8ba19244aa8e420ccfc3fb3e45
12616 cpr: NULL pointer errors
commit 7e7bf7f54a5544e467fcb1eaf3f5f47129d83d70
12617 pcie: NULL pointer errors
commit 3dddd038560f12863d73bf754e6534d071a45610
12615 todds1337: NULL pointer errors
commit 1577b7ba682b7fdc8ef49b98f2147ec01b11e568
12634 niumx: NULL pointer errors
commit 47a041a028740925012faeaf8aa122cb53545a4a
12614 todds1287: NULL pointer errors
commit fccee7da6a96828fd0fd19c6b32fe901e6b31549
12633 glvc: NULL pointer errors
commit 9d86952736be4a2132ea65d76b3dde43dc999f9e
12630 excalibur: NULL pointer errors
commit 50ed1c1e61e07032076ff0041b06b604754d190c
12631 sunfire: smatch and NULL pointer errors
commit baa111a1f46457da764bd7a40234b4f9a2de1885
12629 daktari: smatch and NULL pointer errors
commit c5fab18ea427d8368421383466fe138ed00ed68d
12628 chicago: smatch and NULL pointer errors
commit 44da0df0d621255604c6a72b29e72219d50a76d6
12627 seattle: NULL pointer errors
commit 0d41b2d927be6023812b1b3035b9c5cf84f700b6
12618 cheetah: NULL pointer errors
commit 1e901b654aeabd2bde7c1b05a0d83071d41ca493
12619 mpxu: NULL pointer errors
commit 1e1331ff02be014b4a75626f3a9ab9237f405b35
12626 boston: NULL pointer errors
commit f23a396b6eea5efd75ad61ab78e31f55a36732a8
12620 littleneck: NULL pointer errors
commit 8adb60c2f39cd295bca28a5a44fa9c4934109e61
12607 db21554: NULL pointer errors
commit 35420702b93f71061940bdddcc5401bcb0337e76
12611 rmclomv: NULL pointer errors
commit ada2da53edc6b7d3afbdff4975c5c32c01a7c72d
12536 picl: NULL pointer errors
commit 9ddb26a06d595789532ca2be60f2625a035e5baa
12603 gpio_87317: smatch and NULL pointer errors
commit 424a9dabffff3ee7b75ad66819578b015c7e72d0
12638 ntwdt: NULL pointer errors
commit fd2e3606878080ff9881c6a5d17c0dc41a944a9a
12639 n2piupc: smatch and NULL pointer errors
commit 4b2e399d2387adc4f0af512ea0e3f84da0988e76
12646 vlds: NULL pointer errors
commit eb6b10e69fa5ba733da194d3ad71a0e63338be29
12621 tazmo: smatch and NULL pointer errors
commit 12042ab213b3af68474f48555504db816a449211
12622 grover: smatch and NULL pointer errors
commit 5f94959e45722ce4c5b397c781bd33bdc12bc35f
12602 pic16f747: NULL pointer errors
commit 54b3584e66419f0f60689044f13d702660b4233f
12681 Excess service times for NFS(v3) locking calls
commit f7c6b0310a1b1045e3e955e113031eb3c485707b
12601 adm1026: NULL pointer errors
commit 111d63ac89d5f46c27a3de884ceaf358c6b4f3c7
12599 pic16f819: NULL pointer errors
commit b10a7a5c84767eaa0c2fd6cda5f456fccd17aaff
12600 ssc100: NULL pointer errors
commit 67c3b220bd061b0e5e7bed36a8deff9f85b06440
12598 ssc050: smatch and NULL pointer errors
commit 2e6bb8e703b27f1b2e066859acdc04f2f8a745f9
12613 rmc_comm: NULL pointer errors
commit 78d71c09ff583b38d95e01afefe0faf5a10b8e36
12556 sbusmem: NULL pointer errors
commit 033fe5502e8d73564183eeb70cde2e5fb6bf7f9f
12550 dad: NULL pointer errors
commit d34120274c30795a501f8eb0fca6b33dd4d49e63
12548 fcode: NULL pointer errors
commit afcb81194ea4372157c39b75a016574dcd6a81ee
12660 ontario: NULL pointer errors
commit 8b92a81b8f3ff3d4fe904caad0969cfd13b7efa6
12659 iospc: NULL pointer errors
commit 5d2f9f1aa99a42e638400d4e11f5d87ff95ce0db
12643 trapstat: NULL pointer errors
commit 7d94095ba5c8bcde15ac831ede6826ea9453ddd4
12623 cherrystone: NULL pointer errors
commit a704fb2d43b34f92d7dcac9c06204ea48237612d
12649 ldc: smatch and NULL pointer errors
commit 7331beb48fd554088b3de38ef30491d59e0d61f7
12647 dr_mem: smatch and NULL pointer errors
commit a6c18717f209deaa8516b38f5d43c0bb5855e876
12648 dr_cpu: NULL pointer errors
commit c3937c08b16d32677a7dc955a81325f2e7a61b5d
12656 ngdr: NULL pointer errors
commit 04909c8c9ef61a86dd44bdaf341a1d9a2f0206e5
12608 want memory arena for vmm applications
12609 x86 memory DR should be disabled
commit bbe1232ef8d8a5a776f6afde8466f315c8143dd4
12657 opl: NULL pointer errors
Conflicts:
usr/contrib/freebsd/sys/ata.h
usr/contrib/freebsd/x86/specialreg.h
usr/src/cmd/bhyve/Makefile
usr/src/cmd/bhyve/acpi.h
usr/src/cmd/bhyve/ahci.h
usr/src/cmd/bhyve/atkbdc.c
usr/src/cmd/bhyve/atkbdc.h
usr/src/cmd/bhyve/bhyve_sol_glue.c
usr/src/cmd/bhyve/bhyvegc.c
usr/src/cmd/bhyve/bhyvegc.h
usr/src/cmd/bhyve/bhyverun.c
usr/src/cmd/bhyve/bhyverun.h
usr/src/cmd/bhyve/block_if.c
usr/src/cmd/bhyve/block_if.h
usr/src/cmd/bhyve/console.c
usr/src/cmd/bhyve/console.h
usr/src/cmd/bhyve/consport.c
usr/src/cmd/bhyve/dbgport.h
usr/src/cmd/bhyve/inout.c
usr/src/cmd/bhyve/inout.h
usr/src/cmd/bhyve/ioapic.c
usr/src/cmd/bhyve/ioapic.h
usr/src/cmd/bhyve/mem.c
usr/src/cmd/bhyve/mem.h
usr/src/cmd/bhyve/mptbl.c
usr/src/cmd/bhyve/mptbl.h
usr/src/cmd/bhyve/pci_ahci.c
usr/src/cmd/bhyve/pci_emul.c
usr/src/cmd/bhyve/pci_emul.h
usr/src/cmd/bhyve/pci_hostbridge.c
usr/src/cmd/bhyve/pci_irq.c
usr/src/cmd/bhyve/pci_irq.h
usr/src/cmd/bhyve/pci_lpc.c
usr/src/cmd/bhyve/pci_lpc.h
usr/src/cmd/bhyve/pci_virtio_block.c
usr/src/cmd/bhyve/pci_virtio_net.c
usr/src/cmd/bhyve/pci_virtio_viona.c
usr/src/cmd/bhyve/pm.c
usr/src/cmd/bhyve/post.c
usr/src/cmd/bhyve/ps2kbd.c
usr/src/cmd/bhyve/ps2kbd.h
usr/src/cmd/bhyve/ps2mouse.c
usr/src/cmd/bhyve/ps2mouse.h
usr/src/cmd/bhyve/rfb.c
usr/src/cmd/bhyve/rfb.h
usr/src/cmd/bhyve/rtc.c
usr/src/cmd/bhyve/rtc.h
usr/src/cmd/bhyve/smbiostbl.c
usr/src/cmd/bhyve/smbiostbl.h
usr/src/cmd/bhyve/spinup_ap.c
usr/src/cmd/bhyve/spinup_ap.h
usr/src/cmd/bhyve/uart_emul.c
usr/src/cmd/bhyve/uart_emul.h
usr/src/cmd/bhyve/vga.c
usr/src/cmd/bhyve/vga.h
usr/src/cmd/bhyve/virtio.c
usr/src/cmd/bhyve/virtio.h
usr/src/cmd/bhyve/xmsr.c
usr/src/cmd/bhyve/xmsr.h
usr/src/cmd/bhyvectl/Makefile
usr/src/cmd/bhyvectl/bhyvectl.c
usr/src/compat/freebsd/amd64/machine/asmacros.h
usr/src/compat/freebsd/amd64/machine/atomic.h
usr/src/compat/freebsd/amd64/machine/cpufunc.h
usr/src/compat/freebsd/amd64/machine/fpu.h
usr/src/compat/freebsd/amd64/machine/md_var.h
usr/src/compat/freebsd/amd64/machine/param.h
usr/src/compat/freebsd/amd64/machine/pmap.h
usr/src/compat/freebsd/amd64/machine/smp.h
usr/src/compat/freebsd/amd64/machine/vmm.h
usr/src/compat/freebsd/amd64/machine/vmparam.h
usr/src/compat/freebsd/libutil.h
usr/src/compat/freebsd/net/ethernet.h
usr/src/compat/freebsd/pthread_np.h
usr/src/compat/freebsd/sys/callout.h
usr/src/compat/freebsd/sys/cdefs.h
usr/src/compat/freebsd/sys/cpuset.h
usr/src/compat/freebsd/sys/endian.h
usr/src/compat/freebsd/sys/ioctl.h
usr/src/compat/freebsd/sys/kernel.h
usr/src/compat/freebsd/sys/limits.h
usr/src/compat/freebsd/sys/malloc.h
usr/src/compat/freebsd/sys/mutex.h
usr/src/compat/freebsd/sys/param.h
usr/src/compat/freebsd/sys/pcpu.h
usr/src/compat/freebsd/sys/smp.h
usr/src/compat/freebsd/sys/systm.h
usr/src/compat/freebsd/sys/time.h
usr/src/compat/freebsd/sys/types.h
usr/src/compat/freebsd/vm/vm.h
usr/src/compat/freebsd/x86/_types.h
usr/src/compat/freebsd/x86/segments.h
usr/src/lib/libvmmapi/Makefile
usr/src/lib/libvmmapi/Makefile.com
usr/src/lib/libvmmapi/common/mapfile-vers
usr/src/lib/libvmmapi/common/vmmapi.c
usr/src/lib/libvmmapi/common/vmmapi.h
usr/src/uts/common/inet/ipf/ip_fil_solaris.c
usr/src/uts/common/io/mac/mac_provider.c
usr/src/uts/common/io/mac/mac_util.c
usr/src/uts/i86pc/dboot/dboot_startkern.c
usr/src/uts/i86pc/io/vmm/amd/amdv.c
usr/src/uts/i86pc/io/vmm/intel/ept.c
usr/src/uts/i86pc/io/vmm/intel/ept.h
usr/src/uts/i86pc/io/vmm/intel/vmcs.c
usr/src/uts/i86pc/io/vmm/intel/vmcs.h
usr/src/uts/i86pc/io/vmm/intel/vmx.c
usr/src/uts/i86pc/io/vmm/intel/vmx.h
usr/src/uts/i86pc/io/vmm/intel/vmx_controls.h
usr/src/uts/i86pc/io/vmm/intel/vmx_cpufunc.h
usr/src/uts/i86pc/io/vmm/intel/vmx_msr.c
usr/src/uts/i86pc/io/vmm/intel/vmx_msr.h
usr/src/uts/i86pc/io/vmm/intel/vmx_support.s
usr/src/uts/i86pc/io/vmm/io/vatpic.c
usr/src/uts/i86pc/io/vmm/io/vatpic.h
usr/src/uts/i86pc/io/vmm/io/vatpit.c
usr/src/uts/i86pc/io/vmm/io/vatpit.h
usr/src/uts/i86pc/io/vmm/io/vhpet.c
usr/src/uts/i86pc/io/vmm/io/vhpet.h
usr/src/uts/i86pc/io/vmm/io/vioapic.c
usr/src/uts/i86pc/io/vmm/io/vioapic.h
usr/src/uts/i86pc/io/vmm/io/vlapic.c
usr/src/uts/i86pc/io/vmm/io/vlapic.h
usr/src/uts/i86pc/io/vmm/io/vlapic_priv.h
usr/src/uts/i86pc/io/vmm/vmm.c
usr/src/uts/i86pc/io/vmm/vmm_host.c
usr/src/uts/i86pc/io/vmm/vmm_host.h
usr/src/uts/i86pc/io/vmm/vmm_instruction_emul.c
usr/src/uts/i86pc/io/vmm/vmm_ioport.c
usr/src/uts/i86pc/io/vmm/vmm_ioport.h
usr/src/uts/i86pc/io/vmm/vmm_ktr.h
usr/src/uts/i86pc/io/vmm/vmm_lapic.c
usr/src/uts/i86pc/io/vmm/vmm_lapic.h
usr/src/uts/i86pc/io/vmm/vmm_mem.h
usr/src/uts/i86pc/io/vmm/vmm_sol_dev.c
usr/src/uts/i86pc/io/vmm/vmm_sol_glue.c
usr/src/uts/i86pc/io/vmm/vmm_stat.h
usr/src/uts/i86pc/io/vmm/vmm_util.c
usr/src/uts/i86pc/io/vmm/vmm_util.h
usr/src/uts/i86pc/io/vmm/x86.c
usr/src/uts/i86pc/io/vmm/x86.h
usr/src/uts/i86pc/sys/viona_io.h
usr/src/uts/i86pc/sys/vmm.h
usr/src/uts/i86pc/sys/vmm_dev.h
usr/src/uts/i86pc/sys/vmm_impl.h
usr/src/uts/i86pc/sys/vmm_instruction_emul.h
usr/src/uts/i86pc/viona/Makefile
usr/src/uts/i86pc/vmm/Makefile
usr/src/uts/intel/ipf/Makefile
Diffstat (limited to 'usr/src/uts')
122 files changed, 2448 insertions, 1546 deletions
diff --git a/usr/src/uts/common/io/bnx/bnx.h b/usr/src/uts/common/io/bnx/bnx.h index e1d53fa9d7..9ef282678e 100644 --- a/usr/src/uts/common/io/bnx/bnx.h +++ b/usr/src/uts/common/io/bnx/bnx.h @@ -55,12 +55,6 @@ extern "C" { -/* - */ -#pragma weak hcksum_retrieve -#pragma weak hcksum_assoc - - #include "listq.h" #include "lm5706.h" #include "54xx_reg.h" diff --git a/usr/src/uts/common/io/bnx/bnxsnd.c b/usr/src/uts/common/io/bnx/bnxsnd.c index 16f1b03c10..f6e154c056 100644 --- a/usr/src/uts/common/io/bnx/bnxsnd.c +++ b/usr/src/uts/common/io/bnx/bnxsnd.c @@ -611,7 +611,7 @@ bnx_xmit_ring_xmit_mblk(um_device_t * const umdevice, umpacket->frag_list.cnt = 0; umpacket->mp = mp; - hcksum_retrieve(mp, NULL, NULL, NULL, NULL, NULL, NULL, &pflags); + mac_hcksum_get(mp, NULL, NULL, NULL, NULL, &pflags); bnx_xmit_pkt_cpy(umdevice, umpacket); diff --git a/usr/src/uts/common/io/chxge/pe.c b/usr/src/uts/common/io/chxge/pe.c index 652edba984..48a796470a 100644 --- a/usr/src/uts/common/io/chxge/pe.c +++ b/usr/src/uts/common/io/chxge/pe.c @@ -414,12 +414,12 @@ pe_start(ch_t *sa, mblk_t *mp, uint32_t flg) lseg = ch_bind_dvma_handle(sa, len, (void *)mp->b_rptr, &hmp[nseg], mseg - nseg); - if (lseg == NULL) { + if (lseg == 0) { sa->sge->intr_cnt.tx_no_dvma1++; if ((lseg = ch_bind_dma_handle(sa, len, (void *)mp->b_rptr, &hmp[nseg], - mseg - nseg)) == NULL) { + mseg - nseg)) == 0) { sa->sge->intr_cnt.tx_no_dma1++; /* @@ -444,7 +444,7 @@ pe_start(ch_t *sa, mblk_t *mp, uint32_t flg) lseg = ch_bind_dma_handle(sa, len, (void *)mp->b_rptr, &hmp[nseg], mseg - nseg); - if (lseg == NULL) { + if (lseg == 0) { sa->sge->intr_cnt.tx_no_dma1++; /* @@ -512,12 +512,12 @@ pe_start(ch_t *sa, mblk_t *mp, uint32_t flg) nseg = ch_bind_dvma_handle(sa, len, (void *)mp->b_rptr, &hmp[0], 16); - if (nseg == NULL) { + if (nseg == 0) { sa->sge->intr_cnt.tx_no_dvma2++; nseg = ch_bind_dma_handle(sa, len, (void *)mp->b_rptr, &hmp[0], 16); - if (nseg == NULL) { + if (nseg == 0) { sa->sge->intr_cnt.tx_no_dma2++; /* @@ -530,7 +530,7 @@ pe_start(ch_t *sa, mblk_t *mp, uint32_t flg) } else { nseg = ch_bind_dma_handle(sa, len, (void *)mp->b_rptr, &hmp[0], 16); - if (nseg == NULL) { + if (nseg == 0) { sa->sge->intr_cnt.tx_no_dma2++; /* diff --git a/usr/src/uts/common/io/e1000g/e1000g_alloc.c b/usr/src/uts/common/io/e1000g/e1000g_alloc.c index c7496cd164..8a460fd45a 100644 --- a/usr/src/uts/common/io/e1000g/e1000g_alloc.c +++ b/usr/src/uts/common/io/e1000g/e1000g_alloc.c @@ -830,7 +830,7 @@ e1000g_free_dvma_buffer(dma_buffer_t *buf) return; } - buf->dma_address = NULL; + buf->dma_address = 0; if (buf->address != NULL) { kmem_free(buf->address, buf->size); diff --git a/usr/src/uts/common/klm/nlm_impl.h b/usr/src/uts/common/klm/nlm_impl.h index 68604309a2..9caae1a8c7 100644 --- a/usr/src/uts/common/klm/nlm_impl.h +++ b/usr/src/uts/common/klm/nlm_impl.h @@ -28,7 +28,7 @@ */ /* - * Copyright 2012 Nexenta Systems, Inc. All rights reserved. + * Copyright 2019 Nexenta by DDN, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright 2016 Joyent, Inc. */ @@ -112,7 +112,7 @@ struct _kthread; * We pass three callback functions to nlm_do_lock: * nlm_reply_cb: send a normal RPC reply * nlm_res_cb: do a _res (message style) RPC (call) - * nlm_testargs_cb: do a "granted" RPC call (after blocking) + * nlm_granted_cb: do a "granted" RPC call (after blocking) * Only one of the 1st or 2nd is used. * The 3rd is used only for blocking * @@ -123,7 +123,7 @@ struct _kthread; */ typedef bool_t (*nlm_reply_cb)(SVCXPRT *, nlm4_res *); typedef enum clnt_stat (*nlm_res_cb)(nlm4_res *, void *, CLIENT *); -typedef enum clnt_stat (*nlm_testargs_cb)(nlm4_testargs *, void *, CLIENT *); +typedef enum clnt_stat (*nlm_granted_cb)(nlm4_testargs *, nlm4_res *, CLIENT *); typedef enum clnt_stat (*nlm_testres_cb)(nlm4_testres *, void *, CLIENT *); /* @@ -624,7 +624,7 @@ void nlm_do_notify2(nlm_sm_status *, void *, struct svc_req *); void nlm_do_test(nlm4_testargs *, nlm4_testres *, struct svc_req *, nlm_testres_cb); void nlm_do_lock(nlm4_lockargs *, nlm4_res *, struct svc_req *, - nlm_reply_cb, nlm_res_cb, nlm_testargs_cb); + nlm_reply_cb, nlm_res_cb, nlm_granted_cb); void nlm_do_cancel(nlm4_cancargs *, nlm4_res *, struct svc_req *, nlm_res_cb); void nlm_do_unlock(nlm4_unlockargs *, nlm4_res *, diff --git a/usr/src/uts/common/klm/nlm_rpc_handle.c b/usr/src/uts/common/klm/nlm_rpc_handle.c index 9ddf56856c..b022acc380 100644 --- a/usr/src/uts/common/klm/nlm_rpc_handle.c +++ b/usr/src/uts/common/klm/nlm_rpc_handle.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2019 Nexenta by DDN, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -130,6 +130,7 @@ update_host_rpcbinding(struct nlm_host *hostp, int vers) static int refresh_nlm_rpc(struct nlm_host *hostp, nlm_rpc_t *rpcp) { + uint32_t zero = 0; int ret; if (rpcp->nr_handle == NULL) { @@ -175,6 +176,12 @@ refresh_nlm_rpc(struct nlm_host *hostp, nlm_rpc_t *rpcp) if (NLM_STALE_CLNT(stat)) { ret = ESTALE; } + /* + * Need to reset the XID after the null call above, + * otherwise we'll reuse the XID from that call. + */ + (void) CLNT_CONTROL(rpcp->nr_handle, CLSET_XID, + (char *)&zero); } } @@ -209,7 +216,8 @@ again: rc = cv_wait_sig(&hostp->nh_rpcb_cv, &hostp->nh_lock); if (rc == 0) { mutex_exit(&hostp->nh_lock); - return (EINTR); + rc = EINTR; + goto errout; } } @@ -229,7 +237,8 @@ again: */ if (hostp->nh_rpcb_ustat != RPC_SUCCESS) { mutex_exit(&hostp->nh_lock); - return (ENOENT); + rc = ENOENT; + goto errout; } } @@ -263,7 +272,7 @@ again: } destroy_rpch(rpcp); - return (rc); + goto errout; } DTRACE_PROBE2(end, struct nlm_host *, hostp, @@ -271,6 +280,10 @@ again: *rpcpp = rpcp; return (0); + +errout: + NLM_ERR("Can't get RPC client handle for: %s", hostp->nh_name); + return (rc); } void diff --git a/usr/src/uts/common/klm/nlm_rpc_svc.c b/usr/src/uts/common/klm/nlm_rpc_svc.c index 2911b31877..1f04e3f036 100644 --- a/usr/src/uts/common/klm/nlm_rpc_svc.c +++ b/usr/src/uts/common/klm/nlm_rpc_svc.c @@ -26,7 +26,7 @@ */ /* - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright 2019 Nexenta by DDN, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -63,7 +63,7 @@ * 32-bit lock ranges. */ static void -nlm_convert_to_nlm_lock(struct nlm_lock *dst, struct nlm4_lock *src) +nlm_convert_to_nlm_lock(struct nlm_lock *dst, const struct nlm4_lock *src) { dst->caller_name = src->caller_name; dst->fh = src->fh; @@ -76,12 +76,22 @@ nlm_convert_to_nlm_lock(struct nlm_lock *dst, struct nlm4_lock *src) } /* + * Up-convert for v1 granted response + */ +static void +nlm_convert_to_nlm4_res(struct nlm4_res *dst, const struct nlm_res *src) +{ + dst->cookie = src->cookie; + dst->stat.stat = (nlm4_stats) src->stat.stat; +} + +/* * Up-convert for v1 svc functions with a 32-bit lock range arg. * Note that lock range checks (like overflow) are done later, * in nlm_init_flock(). */ static void -nlm_convert_to_nlm4_lock(struct nlm4_lock *dst, struct nlm_lock *src) +nlm_convert_to_nlm4_lock(struct nlm4_lock *dst, const struct nlm_lock *src) { dst->caller_name = src->caller_name; @@ -93,7 +103,7 @@ nlm_convert_to_nlm4_lock(struct nlm4_lock *dst, struct nlm_lock *src) } static void -nlm_convert_to_nlm4_share(struct nlm4_share *dst, struct nlm_share *src) +nlm_convert_to_nlm4_share(struct nlm4_share *dst, const struct nlm_share *src) { dst->caller_name = src->caller_name; @@ -113,7 +123,7 @@ nlm_convert_to_nlm4_share(struct nlm4_share *dst, struct nlm_share *src) * valid 32-bit lock range. */ static void -nlm_convert_to_nlm_holder(struct nlm_holder *dst, struct nlm4_holder *src) +nlm_convert_to_nlm_holder(struct nlm_holder *dst, const struct nlm4_holder *src) { dst->exclusive = src->exclusive; dst->svid = src->svid; @@ -133,7 +143,7 @@ nlm_convert_to_nlm_stats(enum nlm4_stats src) } static void -nlm_convert_to_nlm_res(struct nlm_res *dst, struct nlm4_res *src) +nlm_convert_to_nlm_res(struct nlm_res *dst, const struct nlm4_res *src) { dst->cookie = src->cookie; dst->stat.stat = nlm_convert_to_nlm_stats(src->stat.stat); @@ -175,7 +185,7 @@ nlm_test_1_svc(struct nlm_testargs *argp, nlm_testres *resp, * Callback functions for nlm_lock_1_svc */ static bool_t nlm_lock_1_reply(SVCXPRT *, nlm4_res *); -static enum clnt_stat nlm_granted_1_cb(nlm4_testargs *, void *, CLIENT *); +static enum clnt_stat nlm_granted_1_cb(nlm4_testargs *, nlm4_res *, CLIENT *); bool_t nlm_lock_1_svc(nlm_lockargs *argp, nlm_res *resp, @@ -215,7 +225,7 @@ nlm_lock_1_reply(SVCXPRT *transp, nlm4_res *resp) } static enum clnt_stat -nlm_granted_1_cb(nlm4_testargs *argp, void *resp, CLIENT *clnt) +nlm_granted_1_cb(nlm4_testargs *argp, nlm4_res *resp, CLIENT *clnt) { nlm_testargs args1; nlm_res res1; @@ -229,9 +239,7 @@ nlm_granted_1_cb(nlm4_testargs *argp, void *resp, CLIENT *clnt) rv = nlm_granted_1(&args1, &res1, clnt); - /* NB: We have a result our caller will not free. */ - xdr_free((xdrproc_t)xdr_nlm_res, (void *)&res1); - (void) resp; + nlm_convert_to_nlm4_res(resp, &res1); return (rv); } @@ -355,7 +363,8 @@ nlm_test_res_1_cb(nlm4_testres *res4, void *null, CLIENT *clnt) * Callback functions for nlm_lock_msg_1_svc */ static enum clnt_stat nlm_lock_res_1_cb(nlm4_res *, void *, CLIENT *); -static enum clnt_stat nlm_granted_msg_1_cb(nlm4_testargs *, void *, CLIENT *); +static enum clnt_stat nlm_granted_msg_1_cb(nlm4_testargs *, nlm4_res *, + CLIENT *); bool_t nlm_lock_msg_1_svc(nlm_lockargs *argp, void *resp, @@ -396,16 +405,22 @@ nlm_lock_res_1_cb(nlm4_res *resp, void *null, CLIENT *clnt) } static enum clnt_stat -nlm_granted_msg_1_cb(nlm4_testargs *argp, void *null, CLIENT *clnt) +nlm_granted_msg_1_cb(nlm4_testargs *argp, nlm4_res *resp, CLIENT *clnt) { nlm_testargs args1; + int rv; args1.cookie = argp->cookie; args1.exclusive = argp->exclusive; nlm_convert_to_nlm_lock(&args1.alock, &argp->alock); - return (nlm_granted_msg_1(&args1, null, clnt)); + rv = nlm_granted_msg_1(&args1, NULL, clnt); + + /* MSG call doesn't fill in *resp, so do it here. */ + if (rv != RPC_SUCCESS) + resp->stat.stat = nlm4_failed; + return (rv); } @@ -693,7 +708,6 @@ nlm4_test_4_svc(nlm4_testargs *argp, nlm4_testres *resp, struct svc_req *sr) * Callback functions for nlm4_lock_4_svc */ static bool_t nlm4_lock_4_reply(SVCXPRT *, nlm4_res *); -static enum clnt_stat nlm4_granted_4_cb(nlm4_testargs *, void *, CLIENT *); bool_t nlm4_lock_4_svc(nlm4_lockargs *argp, nlm4_res *resp, @@ -703,7 +717,7 @@ nlm4_lock_4_svc(nlm4_lockargs *argp, nlm4_res *resp, /* NLM4_LOCK */ nlm_do_lock(argp, resp, sr, nlm4_lock_4_reply, NULL, - nlm4_granted_4_cb); + nlm4_granted_4); /* above does its own reply */ return (FALSE); @@ -715,22 +729,6 @@ nlm4_lock_4_reply(SVCXPRT *transp, nlm4_res *resp) return (svc_sendreply(transp, xdr_nlm4_res, (char *)resp)); } -static enum clnt_stat -nlm4_granted_4_cb(nlm4_testargs *argp, void *resp, CLIENT *clnt) -{ - nlm4_res res4; - int rv; - - bzero(&res4, sizeof (res4)); - rv = nlm4_granted_4(argp, &res4, clnt); - - /* NB: We have a result our caller will not free. */ - xdr_free((xdrproc_t)xdr_nlm4_res, (void *)&res4); - (void) resp; - - return (rv); -} - bool_t nlm4_cancel_4_svc(nlm4_cancargs *argp, nlm4_res *resp, struct svc_req *sr) { @@ -773,6 +771,8 @@ nlm4_test_msg_4_svc(nlm4_testargs *argp, void *resp, struct svc_req *sr) * Callback functions for nlm4_lock_msg_4_svc * (using the RPC client stubs directly) */ +static enum clnt_stat nlm4_granted_msg_4_cb(nlm4_testargs *, nlm4_res *, + CLIENT *); bool_t nlm4_lock_msg_4_svc(nlm4_lockargs *argp, void *resp, @@ -784,7 +784,7 @@ nlm4_lock_msg_4_svc(nlm4_lockargs *argp, void *resp, bzero(&res4, sizeof (res4)); nlm_do_lock(argp, &res4, sr, NULL, nlm4_lock_res_4, - nlm4_granted_msg_4); + nlm4_granted_msg_4_cb); /* NB: We have a result our caller will not free. */ xdr_free((xdrproc_t)xdr_nlm4_res, (void *)&res4); @@ -794,6 +794,20 @@ nlm4_lock_msg_4_svc(nlm4_lockargs *argp, void *resp, return (FALSE); } +static enum clnt_stat +nlm4_granted_msg_4_cb(nlm4_testargs *argp, nlm4_res *resp, CLIENT *clnt) +{ + int rv; + + rv = nlm4_granted_msg_4(argp, NULL, clnt); + + /* MSG call doesn't fill in *resp, so do it here. */ + if (rv != RPC_SUCCESS) + resp->stat.stat = nlm4_failed; + + return (rv); +} + bool_t nlm4_cancel_msg_4_svc(nlm4_cancargs *argp, void *resp, struct svc_req *sr) { diff --git a/usr/src/uts/common/klm/nlm_service.c b/usr/src/uts/common/klm/nlm_service.c index dceabaf53f..f4f733443e 100644 --- a/usr/src/uts/common/klm/nlm_service.c +++ b/usr/src/uts/common/klm/nlm_service.c @@ -27,7 +27,7 @@ /* * Copyright (c) 2012, 2016 by Delphix. All rights reserved. - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright 2019 Nexenta by DDN, Inc. All rights reserved. * Copyright 2014 Joyent, Inc. All rights reserved. */ @@ -81,6 +81,7 @@ struct nlm_block_cb_data { struct nlm_host *hostp; struct nlm_vhold *nvp; struct flock64 *flp; + bool_t registered; }; /* @@ -107,9 +108,9 @@ static void nlm_block( nlm4_lockargs *lockargs, struct nlm_host *host, struct nlm_vhold *nvp, - nlm_rpc_t *rpcp, struct flock64 *fl, - nlm_testargs_cb grant_cb); + nlm_granted_cb grant_cb, + rpcvers_t); static vnode_t *nlm_fh_to_vp(struct netobj *); static struct nlm_vhold *nlm_fh_to_vhold(struct nlm_host *, struct netobj *); @@ -314,6 +315,11 @@ nlm_do_notify2(nlm_sm_status *argp, void *res, struct svc_req *sr) * NLM_TEST, NLM_TEST_MSG, * NLM4_TEST, NLM4_TEST_MSG, * Client inquiry about locks, non-blocking. + * + * Arg cb is NULL for NLM_TEST, NLM4_TEST, and + * non-NULL for NLM_TEST_MSG, NLM4_TEST_MSG + * The MSG forms use the cb to send the reply, + * and don't return a reply for this call. */ void nlm_do_test(nlm4_testargs *argp, nlm4_testres *resp, @@ -455,10 +461,19 @@ out: * We also have to keep a list of locks (pending + granted) * both to handle retransmitted requests, and to keep the * vnodes for those locks active. + * + * Callback arguments: + * reply_cb Used to send a normal RPC reply just as if + * we had filled in a response for our caller. + * Needed because we do work after the reply. + * res_cb Used for the MSG calls, where there's no + * regular RPC response. + * grant_cb Used to CALL the client informing them of a + * granted lock after a "blocked" reply. */ void nlm_do_lock(nlm4_lockargs *argp, nlm4_res *resp, struct svc_req *sr, - nlm_reply_cb reply_cb, nlm_res_cb res_cb, nlm_testargs_cb grant_cb) + nlm_reply_cb reply_cb, nlm_res_cb res_cb, nlm_granted_cb grant_cb) { struct nlm_globals *g; struct flock64 fl; @@ -492,20 +507,18 @@ nlm_do_lock(nlm4_lockargs *argp, nlm4_res *resp, struct svc_req *sr, struct nlm_host *, host, nlm4_lockargs *, argp); /* - * If we may need to do _msg_ call needing an RPC - * callback, get the RPC client handle now, - * so we know if we can bind to the NLM service on - * this client. - * - * Note: host object carries transport type. - * One client using multiple transports gets - * separate sysids for each of its transports. + * If this is a MSG call (NLM_LOCK_MSG, NLM4_LOCK_MSG) + * we'll have res_cb != NULL, and we know we'll need an + * RPC client handle _now_ so we can send the response. + * If we can't get an rpc handle (rpcp) then we have + * no way to respond, and the client will time out. */ - if (res_cb != NULL || (grant_cb != NULL && argp->block == TRUE)) { + if (res_cb != NULL) { error = nlm_host_get_rpc(host, sr->rq_vers, &rpcp); if (error != 0) { + ASSERT(rpcp == NULL); status = nlm4_denied_nolocks; - goto doreply; + goto out; } } @@ -584,6 +597,8 @@ nlm_do_lock(nlm4_lockargs *argp, nlm4_res *resp, struct svc_req *sr, /* * OK, can detach this thread, so this call * will block below (after we reply). + * The "blocked" reply tells the client to + * expect a "granted" call-back later. */ status = nlm4_blocked; do_blocking = TRUE; @@ -655,11 +670,12 @@ doreply: * "detach" it from the RPC SVC pool, allowing it * to block indefinitely if needed. */ - ASSERT(rpcp != NULL); + ASSERT(grant_cb != NULL); (void) svc_detach_thread(sr->rq_xprt); - nlm_block(argp, host, nvp, rpcp, &fl, grant_cb); + nlm_block(argp, host, nvp, &fl, grant_cb, sr->rq_vers); } +out: DTRACE_PROBE3(lock__end, struct nlm_globals *, g, struct nlm_host *, host, nlm4_res *, resp); @@ -679,25 +695,26 @@ static void nlm_block(nlm4_lockargs *lockargs, struct nlm_host *host, struct nlm_vhold *nvp, - nlm_rpc_t *rpcp, struct flock64 *flp, - nlm_testargs_cb grant_cb) + nlm_granted_cb grant_cb, + rpcvers_t vers) { nlm4_testargs args; + nlm4_res res; int error; flk_callback_t flk_cb; struct nlm_block_cb_data cb_data; + nlm_rpc_t *rpcp = NULL; + enum clnt_stat status; /* * Keep a list of blocked locks on nh_pending, and use it * to cancel these threads in nlm_destroy_client_pending. * - * Check to see if this lock is already in the list - * and if not, add an entry for it. Allocate first, - * then if we don't insert, free the new one. - * Caller already has vp held. + * Check to see if this lock is already in the list. If so, + * some earlier call is already blocked getting this lock, + * so there's nothing more this call needs to do. */ - error = nlm_slreq_register(host, nvp, flp); if (error != 0) { /* @@ -710,9 +727,22 @@ nlm_block(nlm4_lockargs *lockargs, return; } + /* + * Make sure we can get an RPC client handle we can use to + * deliver the "granted" callback if/when we get the lock. + * If we can't, there's no point blocking to get the lock + * for them because they'll never find out about it. + */ + error = nlm_host_get_rpc(host, vers, &rpcp); + if (error != 0) { + (void) nlm_slreq_unregister(host, nvp, flp); + return; + } + cb_data.hostp = host; cb_data.nvp = nvp; cb_data.flp = flp; + cb_data.registered = TRUE; flk_init_callback(&flk_cb, nlm_block_callback, &cb_data); /* BSD: VOP_ADVLOCK(vp, NULL, F_SETLK, fl, F_REMOTE); */ @@ -720,23 +750,60 @@ nlm_block(nlm4_lockargs *lockargs, F_REMOTELOCK | FREAD | FWRITE, (u_offset_t)0, &flk_cb, CRED(), NULL); + /* + * If the nlm_block_callback didn't already do it... + */ + if (cb_data.registered) + (void) nlm_slreq_unregister(host, nvp, flp); + if (error != 0) { /* * We failed getting the lock, but have no way to * tell the client about that. Let 'em time out. */ - (void) nlm_slreq_unregister(host, nvp, flp); return; } - /* + * ... else we got the lock on behalf of this client. + * + * We MUST either tell the client about this lock + * (via the "granted" callback RPC) or unlock. + * * Do the "granted" call-back to the client. */ + bzero(&args, sizeof (args)); args.cookie = lockargs->cookie; args.exclusive = lockargs->exclusive; args.alock = lockargs->alock; + bzero(&res, sizeof (res)); + + /* + * Not using the NLM_INVOKE_CALLBACK() macro because + * we need to take actions on errors. + */ + status = (*grant_cb)(&args, &res, (rpcp)->nr_handle); + if (status != RPC_SUCCESS) { + struct rpc_err err; + + CLNT_GETERR((rpcp)->nr_handle, &err); + NLM_ERR("NLM: %s callback failed: " + "stat %d, err %d\n", "grant", status, + err.re_errno); + res.stat.stat = nlm4_failed; + } + if (res.stat.stat != nlm4_granted) { + /* + * Failed to deliver the granted callback, so + * the client doesn't know about this lock. + * Unlock the lock. The client will time out. + */ + (void) nlm_vop_frlock(nvp->nv_vp, F_UNLCK, flp, + F_REMOTELOCK | FREAD | FWRITE, + (u_offset_t)0, NULL, CRED(), NULL); + } + xdr_free((xdrproc_t)xdr_nlm4_res, (void *)&res); - NLM_INVOKE_CALLBACK("grant", rpcp, &args, grant_cb); + nlm_host_rele_rpc(host, rpcp); } /* @@ -756,6 +823,7 @@ nlm_block_callback(flk_cb_when_t when, void *data) if (when == FLK_AFTER_SLEEP) { (void) nlm_slreq_unregister(cb_data->hostp, cb_data->nvp, cb_data->flp); + cb_data->registered = FALSE; } return (0); diff --git a/usr/src/uts/common/os/strsubr.c b/usr/src/uts/common/os/strsubr.c index ac1ee2d1ce..1e18a0ce9e 100644 --- a/usr/src/uts/common/os/strsubr.c +++ b/usr/src/uts/common/os/strsubr.c @@ -28,6 +28,7 @@ * Copyright (c) 2016 by Delphix. All rights reserved. * Copyright 2018 Joyent, Inc. * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. + * Copyright 2018 Joyent, Inc. */ #include <sys/types.h> diff --git a/usr/src/uts/i86pc/io/viona/viona.c b/usr/src/uts/i86pc/io/viona/viona.c new file mode 100644 index 0000000000..40bdd80a6e --- /dev/null +++ b/usr/src/uts/i86pc/io/viona/viona.c @@ -0,0 +1,1404 @@ +/* + * Copyright (c) 2013 Chris Torek <torek @ torek net> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * Copyright 2015 Pluribus Networks Inc. + */ + +#include <sys/conf.h> +#include <sys/file.h> +#include <sys/stat.h> +#include <sys/ddi.h> +#include <sys/sunddi.h> +#include <sys/sunndi.h> +#include <sys/sysmacros.h> +#include <sys/strsubr.h> +#include <sys/strsun.h> +#include <vm/seg_kmem.h> + +#include <sys/dls.h> +#include <sys/mac_client.h> + +#include <sys/viona_io.h> + +#define MB (1024UL * 1024) +#define GB (1024UL * MB) + +/* + * Min. octets in an ethernet frame minus FCS + */ +#define MIN_BUF_SIZE 60 + +#define VIONA_NAME "Virtio Network Accelerator" + +#define VIONA_CTL_MINOR 0 +#define VIONA_CTL_NODE_NAME "ctl" + +#define VIONA_CLI_NAME "viona" + +#define VTNET_MAXSEGS 32 + +#define VRING_ALIGN 4096 + +#define VRING_DESC_F_NEXT (1 << 0) +#define VRING_DESC_F_WRITE (1 << 1) +#define VRING_DESC_F_INDIRECT (1 << 2) + +#define VRING_AVAIL_F_NO_INTERRUPT 1 + +#define VRING_USED_F_NO_NOTIFY 1 + +#define BCM_NIC_DRIVER "bnxe" +/* + * Host capabilities + */ +#define VIRTIO_NET_F_MAC (1 << 5) /* host supplies MAC */ +#define VIRTIO_NET_F_MRG_RXBUF (1 << 15) /* host can merge RX buffers */ +#define VIRTIO_NET_F_STATUS (1 << 16) /* config status field available */ + +#define VIONA_S_HOSTCAPS \ + (VIRTIO_NET_F_MAC | VIRTIO_NET_F_MRG_RXBUF | \ + VIRTIO_NET_F_STATUS) + +#pragma pack(1) +struct virtio_desc { + uint64_t vd_addr; + uint32_t vd_len; + uint16_t vd_flags; + uint16_t vd_next; +}; +#pragma pack() + +#pragma pack(1) +struct virtio_used { + uint32_t vu_idx; + uint32_t vu_tlen; +}; +#pragma pack() + +#pragma pack(1) +struct virtio_net_mrgrxhdr { + uint8_t vrh_flags; + uint8_t vrh_gso_type; + uint16_t vrh_hdr_len; + uint16_t vrh_gso_size; + uint16_t vrh_csum_start; + uint16_t vrh_csum_offset; + uint16_t vrh_bufs; +}; +struct virtio_net_hdr { + uint8_t vrh_flags; + uint8_t vrh_gso_type; + uint16_t vrh_hdr_len; + uint16_t vrh_gso_size; + uint16_t vrh_csum_start; + uint16_t vrh_csum_offset; +}; +#pragma pack() + +typedef struct viona_vring_hqueue { + /* Internal state */ + uint16_t hq_size; + kmutex_t hq_a_mutex; + kmutex_t hq_u_mutex; + uint16_t hq_cur_aidx; /* trails behind 'avail_idx' */ + + /* Host-context pointers to the queue */ + caddr_t hq_baseaddr; + uint16_t *hq_avail_flags; + uint16_t *hq_avail_idx; /* monotonically increasing */ + uint16_t *hq_avail_ring; + + uint16_t *hq_used_flags; + uint16_t *hq_used_idx; /* monotonically increasing */ + struct virtio_used *hq_used_ring; +} viona_vring_hqueue_t; + + +typedef struct viona_link { + datalink_id_t l_linkid; + + struct vm *l_vm; + size_t l_vm_lomemsize; + caddr_t l_vm_lomemaddr; + size_t l_vm_himemsize; + caddr_t l_vm_himemaddr; + + mac_handle_t l_mh; + mac_client_handle_t l_mch; + + kmem_cache_t *l_desb_kmc; + + pollhead_t l_pollhead; + + viona_vring_hqueue_t l_rx_vring; + uint_t l_rx_intr; + + viona_vring_hqueue_t l_tx_vring; + kcondvar_t l_tx_cv; + uint_t l_tx_intr; + kmutex_t l_tx_mutex; + int l_tx_outstanding; + uint32_t l_features; +} viona_link_t; + +typedef struct { + frtn_t d_frtn; + viona_link_t *d_link; + uint_t d_ref; + uint16_t d_cookie; + int d_len; +} viona_desb_t; + +typedef struct viona_soft_state { + viona_link_t *ss_link; +} viona_soft_state_t; + +typedef struct used_elem { + uint16_t id; + uint32_t len; +} used_elem_t; + +static void *viona_state; +static dev_info_t *viona_dip; +static id_space_t *viona_minor_ids; +/* + * copy tx mbufs from virtio ring to avoid necessitating a wait + * for packet transmission to free resources. + */ +static boolean_t copy_tx_mblks = B_TRUE; + +extern struct vm *vm_lookup_by_name(char *name); +extern uint64_t vm_gpa2hpa(struct vm *vm, uint64_t gpa, size_t len); + +static int viona_attach(dev_info_t *dip, ddi_attach_cmd_t cmd); +static int viona_detach(dev_info_t *dip, ddi_detach_cmd_t cmd); +static int viona_open(dev_t *devp, int flag, int otype, cred_t *credp); +static int viona_close(dev_t dev, int flag, int otype, cred_t *credp); +static int viona_ioctl(dev_t dev, int cmd, intptr_t data, int mode, + cred_t *credp, int *rval); +static int viona_chpoll(dev_t dev, short events, int anyyet, short *reventsp, + struct pollhead **phpp); + +static int viona_ioc_create(viona_soft_state_t *ss, vioc_create_t *u_create); +static int viona_ioc_delete(viona_soft_state_t *ss); + +static int viona_vm_map(viona_link_t *link); +static caddr_t viona_gpa2kva(viona_link_t *link, uint64_t gpa); +static void viona_vm_unmap(viona_link_t *link); + +static int viona_ioc_rx_ring_init(viona_link_t *link, + vioc_ring_init_t *u_ri); +static int viona_ioc_tx_ring_init(viona_link_t *link, + vioc_ring_init_t *u_ri); +static int viona_ioc_rx_ring_reset(viona_link_t *link); +static int viona_ioc_tx_ring_reset(viona_link_t *link); +static void viona_ioc_rx_ring_kick(viona_link_t *link); +static void viona_ioc_tx_ring_kick(viona_link_t *link); +static int viona_ioc_rx_intr_clear(viona_link_t *link); +static int viona_ioc_tx_intr_clear(viona_link_t *link); + +static void viona_rx(void *arg, mac_resource_handle_t mrh, mblk_t *mp, + boolean_t loopback); +static void viona_tx(viona_link_t *link, viona_vring_hqueue_t *hq); + +static struct cb_ops viona_cb_ops = { + viona_open, + viona_close, + nodev, + nodev, + nodev, + nodev, + nodev, + viona_ioctl, + nodev, + nodev, + nodev, + viona_chpoll, + ddi_prop_op, + 0, + D_MP | D_NEW | D_HOTPLUG, + CB_REV, + nodev, + nodev +}; + +static struct dev_ops viona_ops = { + DEVO_REV, + 0, + nodev, + nulldev, + nulldev, + viona_attach, + viona_detach, + nodev, + &viona_cb_ops, + NULL, + ddi_power, + ddi_quiesce_not_needed +}; + +static struct modldrv modldrv = { + &mod_driverops, + VIONA_NAME, + &viona_ops, +}; + +static struct modlinkage modlinkage = { + MODREV_1, &modldrv, NULL +}; + +int +_init(void) +{ + int ret; + + ret = ddi_soft_state_init(&viona_state, + sizeof (viona_soft_state_t), 0); + if (ret == 0) { + ret = mod_install(&modlinkage); + if (ret != 0) { + ddi_soft_state_fini(&viona_state); + return (ret); + } + } + + return (ret); +} + +int +_fini(void) +{ + int ret; + + ret = mod_remove(&modlinkage); + if (ret == 0) { + ddi_soft_state_fini(&viona_state); + } + + return (ret); +} + +int +_info(struct modinfo *modinfop) +{ + return (mod_info(&modlinkage, modinfop)); +} + +static void +set_viona_tx_mode() +{ + major_t bcm_nic_major; + if ((bcm_nic_major = ddi_name_to_major(BCM_NIC_DRIVER)) + != DDI_MAJOR_T_NONE) { + if (ddi_hold_installed_driver(bcm_nic_major) != NULL) { + copy_tx_mblks = B_FALSE; + ddi_rele_driver(bcm_nic_major); + } + } +} + +static int +viona_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) +{ + if (cmd != DDI_ATTACH) { + return (DDI_FAILURE); + } + + viona_minor_ids = id_space_create("viona_minor_id", + VIONA_CTL_MINOR + 1, UINT16_MAX); + + if (ddi_create_minor_node(dip, VIONA_CTL_NODE_NAME, + S_IFCHR, VIONA_CTL_MINOR, DDI_PSEUDO, 0) != DDI_SUCCESS) { + return (DDI_FAILURE); + } + + viona_dip = dip; + + set_viona_tx_mode(); + ddi_report_dev(viona_dip); + + return (DDI_SUCCESS); +} + +static int +viona_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) +{ + if (cmd != DDI_DETACH) { + return (DDI_FAILURE); + } + + id_space_destroy(viona_minor_ids); + + ddi_remove_minor_node(viona_dip, NULL); + + viona_dip = NULL; + + return (DDI_SUCCESS); +} + +static int +viona_open(dev_t *devp, int flag, int otype, cred_t *credp) +{ + int minor; + + if (otype != OTYP_CHR) { + return (EINVAL); + } + + if (drv_priv(credp) != 0) { + return (EPERM); + } + + if (getminor(*devp) != VIONA_CTL_MINOR) { + return (ENXIO); + } + + minor = id_alloc(viona_minor_ids); + if (minor == 0) { + /* All minors are busy */ + return (EBUSY); + } + + if (ddi_soft_state_zalloc(viona_state, minor) != DDI_SUCCESS) { + id_free(viona_minor_ids, minor); + } + + *devp = makedevice(getmajor(*devp), minor); + + return (0); +} + +static int +viona_close(dev_t dev, int flag, int otype, cred_t *credp) +{ + int minor; + viona_soft_state_t *ss; + + if (otype != OTYP_CHR) { + return (EINVAL); + } + + if (drv_priv(credp) != 0) { + return (EPERM); + } + + minor = getminor(dev); + + ss = ddi_get_soft_state(viona_state, minor); + if (ss == NULL) { + return (ENXIO); + } + + viona_ioc_delete(ss); + + ddi_soft_state_free(viona_state, minor); + + id_free(viona_minor_ids, minor); + + return (0); +} + +static int +viona_ioctl(dev_t dev, int cmd, intptr_t data, int mode, + cred_t *credp, int *rval) +{ + viona_soft_state_t *ss; + int err = 0; + + ss = ddi_get_soft_state(viona_state, getminor(dev)); + if (ss == NULL) { + return (ENXIO); + } + + switch (cmd) { + case VNA_IOC_CREATE: + err = viona_ioc_create(ss, (vioc_create_t *)data); + break; + case VNA_IOC_DELETE: + err = viona_ioc_delete(ss); + break; + case VNA_IOC_SET_FEATURES: + if (ss->ss_link == NULL) { + return (ENOSYS); + } + ss->ss_link->l_features = *(int *)data & VIONA_S_HOSTCAPS; + break; + case VNA_IOC_GET_FEATURES: + if (ss->ss_link == NULL) { + return (ENOSYS); + } + *(int *)data = VIONA_S_HOSTCAPS; + break; + case VNA_IOC_RX_RING_INIT: + if (ss->ss_link == NULL) { + return (ENOSYS); + } + err = viona_ioc_rx_ring_init(ss->ss_link, + (vioc_ring_init_t *)data); + break; + case VNA_IOC_RX_RING_RESET: + if (ss->ss_link == NULL) { + return (ENOSYS); + } + err = viona_ioc_rx_ring_reset(ss->ss_link); + break; + case VNA_IOC_RX_RING_KICK: + if (ss->ss_link == NULL) { + return (ENOSYS); + } + viona_ioc_rx_ring_kick(ss->ss_link); + err = 0; + break; + case VNA_IOC_TX_RING_INIT: + if (ss->ss_link == NULL) { + return (ENOSYS); + } + err = viona_ioc_tx_ring_init(ss->ss_link, + (vioc_ring_init_t *)data); + break; + case VNA_IOC_TX_RING_RESET: + if (ss->ss_link == NULL) { + return (ENOSYS); + } + err = viona_ioc_tx_ring_reset(ss->ss_link); + break; + case VNA_IOC_TX_RING_KICK: + if (ss->ss_link == NULL) { + return (ENOSYS); + } + viona_ioc_tx_ring_kick(ss->ss_link); + err = 0; + break; + case VNA_IOC_RX_INTR_CLR: + if (ss->ss_link == NULL) { + return (ENOSYS); + } + err = viona_ioc_rx_intr_clear(ss->ss_link); + break; + case VNA_IOC_TX_INTR_CLR: + if (ss->ss_link == NULL) { + return (ENOSYS); + } + err = viona_ioc_tx_intr_clear(ss->ss_link); + break; + default: + err = ENOTTY; + break; + } + + return (err); +} + +static int +viona_chpoll(dev_t dev, short events, int anyyet, short *reventsp, + struct pollhead **phpp) +{ + viona_soft_state_t *ss; + + ss = ddi_get_soft_state(viona_state, getminor(dev)); + if (ss == NULL || ss->ss_link == NULL) { + return (ENXIO); + } + + *reventsp = 0; + + if (ss->ss_link->l_rx_intr && (events & POLLIN)) { + *reventsp |= POLLIN; + } + + if (ss->ss_link->l_tx_intr && (events & POLLOUT)) { + *reventsp |= POLLOUT; + } + + if (*reventsp == 0 && !anyyet) { + *phpp = &ss->ss_link->l_pollhead; + } + + return (0); +} + +static int +viona_ioc_create(viona_soft_state_t *ss, vioc_create_t *u_create) +{ + vioc_create_t k_create; + viona_link_t *link; + char cli_name[MAXNAMELEN]; + int err; + + if (ss->ss_link != NULL) { + return (ENOSYS); + } + if (copyin(u_create, &k_create, sizeof (k_create)) != 0) { + return (EFAULT); + } + + link = kmem_zalloc(sizeof (viona_link_t), KM_SLEEP); + + link->l_linkid = k_create.c_linkid; + link->l_vm = vm_lookup_by_name(k_create.c_vmname); + if (link->l_vm == NULL) { + err = ENXIO; + goto bail; + } + + link->l_vm_lomemsize = k_create.c_lomem_size; + link->l_vm_himemsize = k_create.c_himem_size; + err = viona_vm_map(link); + if (err != 0) { + goto bail; + } + + err = mac_open_by_linkid(link->l_linkid, &link->l_mh); + if (err != 0) { + cmn_err(CE_WARN, "viona create mac_open_by_linkid" + " returned %d\n", err); + goto bail; + } + + snprintf(cli_name, sizeof (cli_name), "%s-%d", + VIONA_CLI_NAME, link->l_linkid); + err = mac_client_open(link->l_mh, &link->l_mch, cli_name, 0); + if (err != 0) { + cmn_err(CE_WARN, "viona create mac_client_open" + " returned %d\n", err); + goto bail; + } + + link->l_features = VIONA_S_HOSTCAPS; + link->l_desb_kmc = kmem_cache_create(cli_name, + sizeof (viona_desb_t), 0, NULL, NULL, NULL, NULL, NULL, 0); + + mutex_init(&link->l_rx_vring.hq_a_mutex, NULL, MUTEX_DRIVER, NULL); + mutex_init(&link->l_rx_vring.hq_u_mutex, NULL, MUTEX_DRIVER, NULL); + mutex_init(&link->l_rx_vring.hq_a_mutex, NULL, MUTEX_DRIVER, NULL); + mutex_init(&link->l_tx_vring.hq_u_mutex, NULL, MUTEX_DRIVER, NULL); + if (copy_tx_mblks) { + mutex_init(&link->l_tx_mutex, NULL, MUTEX_DRIVER, NULL); + cv_init(&link->l_tx_cv, NULL, CV_DRIVER, NULL); + } + ss->ss_link = link; + + return (0); + +bail: + if (link->l_mch != NULL) { + mac_client_close(link->l_mch, 0); + } + if (link->l_mh != NULL) { + mac_close(link->l_mh); + } + + kmem_free(link, sizeof (viona_link_t)); + + return (err); +} + +static int +viona_ioc_delete(viona_soft_state_t *ss) +{ + viona_link_t *link; + + link = ss->ss_link; + if (link == NULL) { + return (ENOSYS); + } + if (copy_tx_mblks) { + mutex_enter(&link->l_tx_mutex); + while (link->l_tx_outstanding != 0) { + cv_wait(&link->l_tx_cv, &link->l_tx_mutex); + } + mutex_exit(&link->l_tx_mutex); + } + if (link->l_mch != NULL) { + mac_rx_clear(link->l_mch); + mac_client_close(link->l_mch, 0); + } + if (link->l_mh != NULL) { + mac_close(link->l_mh); + } + + viona_vm_unmap(link); + mutex_destroy(&link->l_tx_vring.hq_a_mutex); + mutex_destroy(&link->l_tx_vring.hq_u_mutex); + mutex_destroy(&link->l_rx_vring.hq_a_mutex); + mutex_destroy(&link->l_rx_vring.hq_u_mutex); + if (copy_tx_mblks) { + mutex_destroy(&link->l_tx_mutex); + cv_destroy(&link->l_tx_cv); + } + + kmem_cache_destroy(link->l_desb_kmc); + + kmem_free(link, sizeof (viona_link_t)); + + ss->ss_link = NULL; + + return (0); +} + +static caddr_t +viona_mapin_vm_chunk(viona_link_t *link, uint64_t gpa, size_t len) +{ + caddr_t addr; + size_t offset; + pfn_t pfnum; + + if (len == 0) + return (NULL); + + addr = vmem_alloc(heap_arena, len, VM_SLEEP); + if (addr == NULL) + return (NULL); + + for (offset = 0; offset < len; offset += PAGESIZE) { + pfnum = btop(vm_gpa2hpa(link->l_vm, gpa + offset, PAGESIZE)); + ASSERT(pfnum); + hat_devload(kas.a_hat, addr + offset, PAGESIZE, pfnum, + PROT_READ | PROT_WRITE, HAT_LOAD_LOCK); + } + + return (addr); +} + +/* + * Map the guest physical address space into the kernel virtual address space. + */ +static int +viona_vm_map(viona_link_t *link) +{ + link->l_vm_lomemaddr = viona_mapin_vm_chunk(link, + 0, link->l_vm_lomemsize); + if (link->l_vm_lomemaddr == NULL) + return (-1); + link->l_vm_himemaddr = viona_mapin_vm_chunk(link, + 4 * (1024 * 1024 * 1024UL), link->l_vm_himemsize); + if (link->l_vm_himemsize && link->l_vm_himemaddr == NULL) + return (-1); + + return (0); +} + +/* + * Translate a guest physical address into a kernel virtual address. + */ +static caddr_t +viona_gpa2kva(viona_link_t *link, uint64_t gpa) +{ + if (gpa < link->l_vm_lomemsize) + return (link->l_vm_lomemaddr + gpa); + + gpa -= (4 * GB); + if (gpa < link->l_vm_himemsize) + return (link->l_vm_himemaddr + gpa); + + return (NULL); +} + +static void +viona_vm_unmap(viona_link_t *link) +{ + if (link->l_vm_lomemaddr) { + hat_unload(kas.a_hat, link->l_vm_lomemaddr, + link->l_vm_lomemsize, HAT_UNLOAD_UNLOCK); + vmem_free(heap_arena, link->l_vm_lomemaddr, + link->l_vm_lomemsize); + } + if (link->l_vm_himemaddr) { + hat_unload(kas.a_hat, link->l_vm_himemaddr, + link->l_vm_himemsize, HAT_UNLOAD_UNLOCK); + vmem_free(heap_arena, link->l_vm_himemaddr, + link->l_vm_himemsize); + } +} + +static int +viona_ioc_ring_init_common(viona_link_t *link, viona_vring_hqueue_t *hq, + vioc_ring_init_t *u_ri) +{ + vioc_ring_init_t k_ri; + + if (copyin(u_ri, &k_ri, sizeof (k_ri)) != 0) { + return (EFAULT); + } + + hq->hq_size = k_ri.ri_qsize; + hq->hq_baseaddr = viona_gpa2kva(link, k_ri.ri_qaddr); + if (hq->hq_baseaddr == NULL) + return (EINVAL); + + hq->hq_avail_flags = (uint16_t *)(viona_gpa2kva(link, + k_ri.ri_qaddr + hq->hq_size * sizeof (struct virtio_desc))); + if (hq->hq_avail_flags == NULL) + return (EINVAL); + hq->hq_avail_idx = hq->hq_avail_flags + 1; + hq->hq_avail_ring = hq->hq_avail_flags + 2; + + hq->hq_used_flags = (uint16_t *)(viona_gpa2kva(link, + P2ROUNDUP(k_ri.ri_qaddr + + hq->hq_size * sizeof (struct virtio_desc) + 2, VRING_ALIGN))); + if (hq->hq_used_flags == NULL) + return (EINVAL); + hq->hq_used_idx = hq->hq_used_flags + 1; + hq->hq_used_ring = (struct virtio_used *)(hq->hq_used_flags + 2); + + /* + * Initialize queue indexes + */ + hq->hq_cur_aidx = 0; + + return (0); +} + +static int +viona_ioc_rx_ring_init(viona_link_t *link, vioc_ring_init_t *u_ri) +{ + viona_vring_hqueue_t *hq; + int rval; + + hq = &link->l_rx_vring; + + rval = viona_ioc_ring_init_common(link, hq, u_ri); + if (rval != 0) { + return (rval); + } + + return (0); +} + +static int +viona_ioc_tx_ring_init(viona_link_t *link, vioc_ring_init_t *u_ri) +{ + viona_vring_hqueue_t *hq; + + hq = &link->l_tx_vring; + + return (viona_ioc_ring_init_common(link, hq, u_ri)); +} + +static int +viona_ioc_ring_reset_common(viona_vring_hqueue_t *hq) +{ + /* + * Reset all soft state + */ + hq->hq_cur_aidx = 0; + + return (0); +} + +static int +viona_ioc_rx_ring_reset(viona_link_t *link) +{ + viona_vring_hqueue_t *hq; + + mac_rx_clear(link->l_mch); + + hq = &link->l_rx_vring; + + return (viona_ioc_ring_reset_common(hq)); +} + +static int +viona_ioc_tx_ring_reset(viona_link_t *link) +{ + viona_vring_hqueue_t *hq; + + hq = &link->l_tx_vring; + + return (viona_ioc_ring_reset_common(hq)); +} + +static void +viona_ioc_rx_ring_kick(viona_link_t *link) +{ + viona_vring_hqueue_t *hq = &link->l_rx_vring; + + atomic_or_16(hq->hq_used_flags, VRING_USED_F_NO_NOTIFY); + + mac_rx_set(link->l_mch, viona_rx, link); +} + +/* + * Return the number of available descriptors in the vring taking care + * of the 16-bit index wraparound. + */ +static inline int +viona_hq_num_avail(viona_vring_hqueue_t *hq) +{ + uint16_t ndesc; + + /* + * We're just computing (a-b) in GF(216). + * + * The only glitch here is that in standard C, + * uint16_t promotes to (signed) int when int has + * more than 16 bits (pretty much always now), so + * we have to force it back to unsigned. + */ + ndesc = (unsigned)*hq->hq_avail_idx - (unsigned)hq->hq_cur_aidx; + + ASSERT(ndesc <= hq->hq_size); + + return (ndesc); +} + +static void +viona_ioc_tx_ring_kick(viona_link_t *link) +{ + viona_vring_hqueue_t *hq = &link->l_tx_vring; + + do { + atomic_or_16(hq->hq_used_flags, VRING_USED_F_NO_NOTIFY); + while (viona_hq_num_avail(hq)) { + viona_tx(link, hq); + } + if (copy_tx_mblks) { + mutex_enter(&link->l_tx_mutex); + if (link->l_tx_outstanding != 0) { + cv_wait_sig(&link->l_tx_cv, &link->l_tx_mutex); + } + mutex_exit(&link->l_tx_mutex); + } + atomic_and_16(hq->hq_used_flags, ~VRING_USED_F_NO_NOTIFY); + } while (viona_hq_num_avail(hq)); +} + +static int +viona_ioc_rx_intr_clear(viona_link_t *link) +{ + link->l_rx_intr = 0; + + return (0); +} + +static int +viona_ioc_tx_intr_clear(viona_link_t *link) +{ + link->l_tx_intr = 0; + + return (0); +} +#define VQ_MAX_DESCRIPTORS 512 + +static int +vq_popchain(viona_link_t *link, viona_vring_hqueue_t *hq, struct iovec *iov, +int n_iov, uint16_t *cookie) +{ + int i; + int ndesc, nindir; + int idx, head, next; + struct virtio_desc *vdir, *vindir, *vp; + + idx = hq->hq_cur_aidx; + ndesc = (uint16_t)((unsigned)*hq->hq_avail_idx - (unsigned)idx); + + if (ndesc == 0) + return (0); + if (ndesc > hq->hq_size) { + cmn_err(CE_NOTE, "ndesc (%d) out of range\n", ndesc); + return (-1); + } + + head = hq->hq_avail_ring[idx & (hq->hq_size - 1)]; + next = head; + + for (i = 0; i < VQ_MAX_DESCRIPTORS; next = vdir->vd_next) { + if (next >= hq->hq_size) { + cmn_err(CE_NOTE, "descriptor index (%d)" + "out of range\n", next); + return (-1); + } + + vdir = (struct virtio_desc *)(hq->hq_baseaddr + + next * sizeof (struct virtio_desc)); + if ((vdir->vd_flags & VRING_DESC_F_INDIRECT) == 0) { + if (i > n_iov) + return (-1); + iov[i].iov_base = viona_gpa2kva(link, vdir->vd_addr); + if (iov[i].iov_base == NULL) { + cmn_err(CE_NOTE, "invalid guest physical" + " address 0x%"PRIx64"\n", vdir->vd_addr); + return (-1); + } + iov[i++].iov_len = vdir->vd_len; + } else { + nindir = vdir->vd_len / 16; + if ((vdir->vd_len & 0xf) || nindir == 0) { + cmn_err(CE_NOTE, "invalid indir len 0x%x\n", + vdir->vd_len); + return (-1); + } + vindir = (struct virtio_desc *) + viona_gpa2kva(link, vdir->vd_addr); + if (vindir == NULL) { + cmn_err(CE_NOTE, "invalid guest physical" + " address 0x%"PRIx64"\n", vdir->vd_addr); + return (-1); + } + next = 0; + for (;;) { + vp = &vindir[next]; + if (vp->vd_flags & VRING_DESC_F_INDIRECT) { + cmn_err(CE_NOTE, "indirect desc" + " has INDIR flag\n"); + return (-1); + } + if (i > n_iov) + return (-1); + iov[i].iov_base = + viona_gpa2kva(link, vp->vd_addr); + if (iov[i].iov_base == NULL) { + cmn_err(CE_NOTE, "invalid guest" + " physical address 0x%"PRIx64"\n", + vp->vd_addr); + return (-1); + } + iov[i++].iov_len = vp->vd_len; + + if (i > VQ_MAX_DESCRIPTORS) + goto loopy; + if ((vp->vd_flags & VRING_DESC_F_NEXT) == 0) + break; + + next = vp->vd_next; + if (next >= nindir) { + cmn_err(CE_NOTE, "invalid next" + " %d > %d\n", next, nindir); + return (-1); + } + } + } + if ((vdir->vd_flags & VRING_DESC_F_NEXT) == 0) { + *cookie = head; + hq->hq_cur_aidx++; + return (i); + } + } + +loopy: + cmn_err(CE_NOTE, "%d > descriptor loop count\n", i); + + return (-1); +} + +static void +vq_pushchain(viona_vring_hqueue_t *hq, uint32_t len, uint16_t cookie) +{ + struct virtio_used *vu; + int uidx; + + uidx = *hq->hq_used_idx; + vu = &hq->hq_used_ring[uidx++ & (hq->hq_size - 1)]; + vu->vu_idx = cookie; + vu->vu_tlen = len; + membar_producer(); + *hq->hq_used_idx = uidx; +} + +static void +vq_pushchain_mrgrx(viona_vring_hqueue_t *hq, int num_bufs, used_elem_t *elem) +{ + struct virtio_used *vu; + int uidx; + int i; + + uidx = *hq->hq_used_idx; + if (num_bufs == 1) { + vu = &hq->hq_used_ring[uidx++ & (hq->hq_size - 1)]; + vu->vu_idx = elem[0].id; + vu->vu_tlen = elem[0].len; + } else { + for (i = 0; i < num_bufs; i++) { + vu = &hq->hq_used_ring[(uidx + i) & (hq->hq_size - 1)]; + vu->vu_idx = elem[i].id; + vu->vu_tlen = elem[i].len; + } + uidx = uidx + num_bufs; + } + membar_producer(); + *hq->hq_used_idx = uidx; +} + +/* + * Copy bytes from mp to iov. + * copied_buf: Total num_bytes copied from mblk to iov array. + * buf: pointer to iov_base. + * i: index of iov array. Mainly used to identify if we are + * dealing with first iov array element. + * rxhdr_size: Virtio header size. Two possibilities in case + * of MRGRX buf, header has 2 additional bytes. + * In case of mrgrx, virtio header should be part of iov[0]. + * In case of non-mrgrx, virtio header may or may not be part + * of iov[0]. + */ +static int +copy_in_mblk(mblk_t *mp, int copied_buf, caddr_t buf, struct iovec *iov, + int i, int rxhdr_size) +{ + int copied_chunk = 0; + mblk_t *ml; + int total_buf_len = iov->iov_len; + /* + * iov[0] might have header, adjust + * total_buf_len accordingly + */ + if (i == 0) { + total_buf_len = iov->iov_len - rxhdr_size; + } + for (ml = mp; ml != NULL; ml = ml->b_cont) { + size_t chunk = MBLKL(ml); + /* + * If chunk is less than + * copied_buf we should move + * to correct msgblk + */ + if (copied_buf != 0) { + if (copied_buf < chunk) { + chunk -= copied_buf; + } else { + copied_buf -= chunk; + continue; + } + } + /* + * iov[0] already has virtio header. + * and if copied chunk is length of iov_len break + */ + if (copied_chunk == total_buf_len) { + break; + } + /* + * Sometimes chunk is total mblk len, sometimes mblk is + * divided into multiple chunks. + */ + if (chunk > copied_buf) { + if (chunk > copied_chunk) { + if ((chunk + copied_chunk) > total_buf_len) + chunk = (size_t)total_buf_len + - copied_chunk; + } else { + if (chunk > (total_buf_len - copied_chunk)) + chunk = (size_t)((total_buf_len + - copied_chunk) - chunk); + } + bcopy(ml->b_rptr + copied_buf, buf, chunk); + } else { + if (chunk > (total_buf_len - copied_chunk)) { + chunk = (size_t)(total_buf_len - copied_chunk); + } + bcopy(ml->b_rptr + copied_buf, buf, chunk); + } + buf += chunk; + copied_chunk += chunk; + } + return (copied_chunk); +} + +static void +viona_rx(void *arg, mac_resource_handle_t mrh, mblk_t *mp, + boolean_t loopback) +{ + viona_link_t *link = arg; + viona_vring_hqueue_t *hq = &link->l_rx_vring; + mblk_t *mp0 = mp; + + while (viona_hq_num_avail(hq)) { + struct iovec iov[VTNET_MAXSEGS]; + size_t mblklen; + int n, i = 0; + uint16_t cookie; + struct virtio_net_hdr *vrx; + struct virtio_net_mrgrxhdr *vmrgrx; + mblk_t *ml; + caddr_t buf; + int total_len = 0; + int copied_buf = 0; + int num_bufs = 0; + int num_pops = 0; + used_elem_t uelem[VTNET_MAXSEGS]; + + if (mp == NULL) { + break; + } + mblklen = msgsize(mp); + if (mblklen == 0) { + break; + } + + mutex_enter(&hq->hq_a_mutex); + n = vq_popchain(link, hq, iov, VTNET_MAXSEGS, &cookie); + mutex_exit(&hq->hq_a_mutex); + if (n <= 0) { + break; + } + num_pops++; + if (link->l_features & VIRTIO_NET_F_MRG_RXBUF) { + int total_n = n; + int mrgrxhdr_size = sizeof (struct virtio_net_mrgrxhdr); + /* + * Get a pointer to the rx header, and use the + * data immediately following it for the packet buffer. + */ + vmrgrx = (struct virtio_net_mrgrxhdr *)iov[0].iov_base; + if (n == 1) { + buf = iov[0].iov_base + mrgrxhdr_size; + } + while (mblklen > copied_buf) { + if (total_n == i) { + mutex_enter(&hq->hq_a_mutex); + n = vq_popchain(link, hq, &iov[i], + VTNET_MAXSEGS, &cookie); + mutex_exit(&hq->hq_a_mutex); + if (n <= 0) { + freemsgchain(mp0); + return; + } + num_pops++; + total_n += n; + } + if (total_n > i) { + int copied_chunk = 0; + if (i != 0) { + buf = iov[i].iov_base; + } + copied_chunk = copy_in_mblk(mp, + copied_buf, buf, &iov[i], i, + mrgrxhdr_size); + copied_buf += copied_chunk; + uelem[i].id = cookie; + uelem[i].len = copied_chunk; + if (i == 0) { + uelem[i].len += mrgrxhdr_size; + } + } + num_bufs++; + i++; + } + } else { + boolean_t virt_hdr_incl_iov = B_FALSE; + int rxhdr_size = sizeof (struct virtio_net_hdr); + /* First element is header */ + vrx = (struct virtio_net_hdr *)iov[0].iov_base; + if (n == 1 || iov[0].iov_len > rxhdr_size) { + buf = iov[0].iov_base + rxhdr_size; + virt_hdr_incl_iov = B_TRUE; + total_len += rxhdr_size; + if (iov[0].iov_len < rxhdr_size) { + // Buff too small to fit pkt. Drop it. + freemsgchain(mp0); + return; + } + } else { + total_len = iov[0].iov_len; + } + if (iov[0].iov_len == rxhdr_size) + i++; + while (mblklen > copied_buf) { + if (n > i) { + int copied_chunk = 0; + if (i != 0) { + buf = iov[i].iov_base; + } + /* + * In case of non-mrgrx buf, first + * descriptor always has header and + * rest of the descriptors have data. + * But it is not guaranteed that first + * descriptor will only have virtio + * header. It might also have data. + */ + if (virt_hdr_incl_iov) { + copied_chunk = copy_in_mblk(mp, + copied_buf, buf, &iov[i], + i, rxhdr_size); + } else { + copied_chunk = copy_in_mblk(mp, + copied_buf, buf, &iov[i], + i, 0); + } + copied_buf += copied_chunk; + total_len += copied_chunk; + } else { + /* + * Drop packet as it cant fit + * in buf provided by guest. + */ + freemsgchain(mp0); + return; + } + i++; + } + } + /* + * The only valid field in the rx packet header is the + * number of buffers, which is always 1 without TSO + * support. + */ + if (link->l_features & VIRTIO_NET_F_MRG_RXBUF) { + memset(vmrgrx, 0, sizeof (struct virtio_net_mrgrxhdr)); + vmrgrx->vrh_bufs = num_bufs; + /* + * Make sure iov[0].iov_len >= MIN_BUF_SIZE + * otherwise guest will consider it as invalid frame. + */ + if (num_bufs == 1 && uelem[0].len < MIN_BUF_SIZE) { + uelem[0].len = MIN_BUF_SIZE; + } + /* + * Release this chain and handle more chains. + */ + mutex_enter(&hq->hq_u_mutex); + vq_pushchain_mrgrx(hq, num_pops, uelem); + mutex_exit(&hq->hq_u_mutex); + } else { + memset(vrx, 0, sizeof (struct virtio_net_hdr)); + if (total_len < MIN_BUF_SIZE) { + total_len = MIN_BUF_SIZE; + } + /* + * Release this chain and handle more chains. + */ + mutex_enter(&hq->hq_u_mutex); + vq_pushchain(hq, total_len, cookie); + mutex_exit(&hq->hq_u_mutex); + } + + mp = mp->b_next; + } + + if ((*hq->hq_avail_flags & VRING_AVAIL_F_NO_INTERRUPT) == 0) { + if (atomic_cas_uint(&link->l_rx_intr, 0, 1) == 0) { + pollwakeup(&link->l_pollhead, POLLIN); + } + } + + freemsgchain(mp0); +} + +static void +viona_desb_free(viona_desb_t *dp) +{ + viona_link_t *link; + viona_vring_hqueue_t *hq; + struct virtio_used *vu; + int uidx; + uint_t ref; + + ref = atomic_dec_uint_nv(&dp->d_ref); + if (ref != 0) + return; + + link = dp->d_link; + hq = &link->l_tx_vring; + + mutex_enter(&hq->hq_u_mutex); + vq_pushchain(hq, dp->d_len, dp->d_cookie); + mutex_exit(&hq->hq_u_mutex); + + kmem_cache_free(link->l_desb_kmc, dp); + + if ((*hq->hq_avail_flags & VRING_AVAIL_F_NO_INTERRUPT) == 0) { + if (atomic_cas_uint(&link->l_tx_intr, 0, 1) == 0) { + pollwakeup(&link->l_pollhead, POLLOUT); + } + } + if (copy_tx_mblks) { + mutex_enter(&link->l_tx_mutex); + if (--link->l_tx_outstanding == 0) { + cv_broadcast(&link->l_tx_cv); + } + mutex_exit(&link->l_tx_mutex); + } +} + +static void +viona_tx(viona_link_t *link, viona_vring_hqueue_t *hq) +{ + struct iovec iov[VTNET_MAXSEGS]; + uint16_t cookie; + int i, n; + mblk_t *mp_head, *mp_tail, *mp; + viona_desb_t *dp; + mac_client_handle_t link_mch = link->l_mch; + + mp_head = mp_tail = NULL; + + mutex_enter(&hq->hq_a_mutex); + n = vq_popchain(link, hq, iov, VTNET_MAXSEGS, &cookie); + mutex_exit(&hq->hq_a_mutex); + ASSERT(n != 0); + + dp = kmem_cache_alloc(link->l_desb_kmc, KM_SLEEP); + dp->d_frtn.free_func = viona_desb_free; + dp->d_frtn.free_arg = (void *)dp; + dp->d_link = link; + dp->d_cookie = cookie; + + dp->d_ref = 0; + dp->d_len = iov[0].iov_len; + + for (i = 1; i < n; i++) { + dp->d_ref++; + dp->d_len += iov[i].iov_len; + if (copy_tx_mblks) { + mp = desballoc((uchar_t *)iov[i].iov_base, + iov[i].iov_len, BPRI_MED, &dp->d_frtn); + ASSERT(mp); + } else { + mp = allocb(iov[i].iov_len, BPRI_MED); + ASSERT(mp); + bcopy((uchar_t *)iov[i].iov_base, mp->b_wptr, + iov[i].iov_len); + } + mp->b_wptr += iov[i].iov_len; + if (mp_head == NULL) { + ASSERT(mp_tail == NULL); + mp_head = mp; + } else { + ASSERT(mp_tail != NULL); + mp_tail->b_cont = mp; + } + mp_tail = mp; + } + if (copy_tx_mblks == B_FALSE) { + viona_desb_free(dp); + } + if (copy_tx_mblks) { + mutex_enter(&link->l_tx_mutex); + link->l_tx_outstanding++; + mutex_exit(&link->l_tx_mutex); + } + mac_tx(link_mch, mp_head, 0, MAC_DROP_ON_NO_DESC, NULL); +} diff --git a/usr/src/uts/i86pc/io/vmm/offsets.in b/usr/src/uts/i86pc/io/vmm/offsets.in new file mode 100644 index 0000000000..4b1fe1d6b6 --- /dev/null +++ b/usr/src/uts/i86pc/io/vmm/offsets.in @@ -0,0 +1,72 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2014 Pluribus Networks Inc. + */ + +#include <sys/types.h> +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/cpuvar.h> + +#include <machine/pmap.h> + +#include <machine/vmm.h> +#include "intel/vmx_cpufunc.h" +#include "intel/vmx.h" + +vmxctx + tmpstktop VMXCTX_TMPSTKTOP + guest_rdi VMXCTX_GUEST_RDI + guest_rsi VMXCTX_GUEST_RSI + guest_rdx VMXCTX_GUEST_RDX + guest_rcx VMXCTX_GUEST_RCX + guest_r8 VMXCTX_GUEST_R8 + guest_r9 VMXCTX_GUEST_R9 + guest_rax VMXCTX_GUEST_RAX + guest_rbx VMXCTX_GUEST_RBX + guest_rbp VMXCTX_GUEST_RBP + guest_r10 VMXCTX_GUEST_R10 + guest_r11 VMXCTX_GUEST_R11 + guest_r12 VMXCTX_GUEST_R12 + guest_r13 VMXCTX_GUEST_R13 + guest_r14 VMXCTX_GUEST_R14 + guest_r15 VMXCTX_GUEST_R15 + guest_cr2 VMXCTX_GUEST_CR2 + host_r15 VMXCTX_HOST_R15 + host_r14 VMXCTX_HOST_R14 + host_r13 VMXCTX_HOST_R13 + host_r12 VMXCTX_HOST_R12 + host_rbp VMXCTX_HOST_RBP + host_rsp VMXCTX_HOST_RSP + host_rbx VMXCTX_HOST_RBX + host_rip VMXCTX_HOST_RIP + launch_error VMXCTX_LAUNCH_ERROR + +vmx VMX_SIZE + +\#define VM_SUCCESS 0 +\#define VM_FAIL_INVALID 1 +\#define VM_FAIL_VALID 2 + +\#define VMX_RETURN_DIRECT 0 +\#define VMX_RETURN_LONGJMP 1 +\#define VMX_RETURN_VMRESUME 2 +\#define VMX_RETURN_VMLAUNCH 3 +\#define VMX_RETURN_AST 4 + +cpu + cpu_thread + +_kthread + t_lwp + _tu._ts._t_astflag T_ASTFLAG diff --git a/usr/src/uts/i86pc/io/vmm/vmm_ipi.h b/usr/src/uts/i86pc/io/vmm/vmm_ipi.h new file mode 100644 index 0000000000..4dff03ba1f --- /dev/null +++ b/usr/src/uts/i86pc/io/vmm/vmm_ipi.h @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2011 NetApp, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: head/sys/amd64/vmm/vmm_ipi.h 260466 2014-01-09 03:25:54Z neel $ + */ + +#ifndef _VMM_IPI_H_ +#define _VMM_IPI_H_ + +#ifdef __FreeBSD__ +int vmm_ipi_alloc(void); +void vmm_ipi_free(int num); +#endif + +#endif diff --git a/usr/src/uts/i86pc/io/vmm/vmm_sol_mem.c b/usr/src/uts/i86pc/io/vmm/vmm_sol_mem.c new file mode 100644 index 0000000000..3bb5412d16 --- /dev/null +++ b/usr/src/uts/i86pc/io/vmm/vmm_sol_mem.c @@ -0,0 +1,111 @@ +/*- + * Copyright (c) 2011 NetApp, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: head/sys/amd64/vmm/vmm_mem.c 245678 2013-01-20 03:42:49Z neel $ + */ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * Copyright 2013 Pluribus Networks Inc. + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD: head/sys/amd64/vmm/vmm_mem.c 245678 2013-01-20 03:42:49Z neel $"); + +#include <sys/param.h> +#include <sys/lock.h> +#include <sys/mutex.h> +#include <sys/systm.h> +#include <sys/malloc.h> +#include <sys/kernel.h> + +#include <vm/vm.h> +#include <machine/pmap.h> + +#include <sys/ddi.h> + +#include "vmm_util.h" +#include "vmm_mem.h" + +int +vmm_mem_init(void) +{ + return (0); +} + +vm_paddr_t +vmm_mem_alloc(size_t size) +{ + clock_t usec = 2 * 1000000; + vm_paddr_t pa; + caddr_t addr; + + if (size != PAGE_SIZE) + panic("vmm_mem_alloc: invalid allocation size %lu", size); + + while (usec > 0) { + if ((addr = kmem_zalloc(PAGE_SIZE, KM_NOSLEEP)) != NULL) { + ASSERT(((uintptr_t)addr & PAGE_MASK) == 0); + pa = vtophys((vm_offset_t)addr); + return (pa); + } + delay(drv_usectohz((clock_t)500000)); + usec -= 500000; + } + + return (NULL); +} + +void +vmm_mem_free(vm_paddr_t base, size_t length) +{ + page_t *pp; + + if (base & PAGE_MASK) { + panic("vmm_mem_free: base 0x%0lx must be aligned on a " + "0x%0x boundary\n", base, PAGE_SIZE); + } + + if (length != PAGE_SIZE) { + panic("vmm_mem_free: invalid length %lu", length); + } + + pp = page_numtopp_nolock(btop(base)); + kmem_free((void *)pp->p_offset, PAGE_SIZE); +} + +vm_paddr_t +vmm_mem_maxaddr(void) +{ + + return (ptob(physmax + 1)); +} diff --git a/usr/src/uts/i86pc/io/vmm/vmx_assym.s b/usr/src/uts/i86pc/io/vmm/vmx_assym.s new file mode 100644 index 0000000000..d84ca30275 --- /dev/null +++ b/usr/src/uts/i86pc/io/vmm/vmx_assym.s @@ -0,0 +1 @@ +#include "vmx_assym.h" diff --git a/usr/src/uts/i86pc/vm/seg_vmm.c b/usr/src/uts/i86pc/vm/seg_vmm.c index faebf9ac36..beb5e81d53 100644 --- a/usr/src/uts/i86pc/vm/seg_vmm.c +++ b/usr/src/uts/i86pc/vm/seg_vmm.c @@ -14,12 +14,15 @@ */ /* - * VM - Virtual-Machine-Memory segment + * segvmm - Virtual-Machine-Memory segment * * The vmm segment driver was designed for mapping regions of kernel memory * allocated to an HVM instance into userspace for manipulation there. It * draws direct lineage from the umap segment driver, but meant for larger * mappings with fewer restrictions. + * + * seg*k*vmm, in contrast, has mappings for every VMM into kas. We use its + * mappings here only to find the relevant PFNs in segvmm_fault_in(). */ @@ -93,7 +96,7 @@ static struct seg_ops segvmm_ops = { /* - * Create a kernel/user-mapped segment. + * Create a kernel/user-mapped segment. ->kaddr is the segkvmm mapping. */ int segvmm_create(struct seg **segpp, void *argsp) diff --git a/usr/src/uts/sparc/io/pciex/pcie_sparc.c b/usr/src/uts/sparc/io/pciex/pcie_sparc.c index de5def9f4a..1634078cbc 100644 --- a/usr/src/uts/sparc/io/pciex/pcie_sparc.c +++ b/usr/src/uts/sparc/io/pciex/pcie_sparc.c @@ -67,7 +67,7 @@ int pcie_plat_pwr_setup(dev_info_t *dip) { if (ddi_prop_create(DDI_DEV_T_NONE, dip, DDI_PROP_CANSLEEP, - "pm-want-child-notification?", NULL, NULL) != DDI_PROP_SUCCESS) { + "pm-want-child-notification?", NULL, 0) != DDI_PROP_SUCCESS) { PCIE_DBG("%s(%d): can't create pm-want-child-notification \n", ddi_driver_name(dip), ddi_get_instance(dip)); return (DDI_FAILURE); diff --git a/usr/src/uts/sparc/os/cpr_sparc.c b/usr/src/uts/sparc/os/cpr_sparc.c index 3dd44bb9e6..2b409b952a 100644 --- a/usr/src/uts/sparc/os/cpr_sparc.c +++ b/usr/src/uts/sparc/os/cpr_sparc.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * cpr functions for supported sparc platforms */ @@ -363,8 +361,8 @@ cpr_abbreviate_devpath(char *in_path, char *out_path) *out_path = '\0'; while ((cmpt = cpr_next_component(&position)) != NULL) { - pnode_t long_match = NULL; - pnode_t short_match = NULL; + pnode_t long_match = 0; + pnode_t short_match = 0; int short_hits = 0; char *name; char *prefix = cpr_get_prefix(cmpt); diff --git a/usr/src/uts/sun/io/dada/targets/dad.c b/usr/src/uts/sun/io/dada/targets/dad.c index b3be5f3ea5..c9e8b393b6 100644 --- a/usr/src/uts/sun/io/dada/targets/dad.c +++ b/usr/src/uts/sun/io/dada/targets/dad.c @@ -315,7 +315,7 @@ static struct cb_ops dcd_cb_ops = { 0, /* streamtab */ D_64BIT | D_MP | D_NEW, /* Driver compatibility flag */ CB_REV, /* cb_rev */ - dcdaread, /* async I/O read entry point */ + dcdaread, /* async I/O read entry point */ dcdawrite /* async I/O write entry point */ }; @@ -2255,7 +2255,7 @@ make_dcd_cmd(struct dcd_disk *un, struct buf *bp, int (*func)()) &p_lblksrt, NULL, NULL, - 0) != NULL) { + 0) != 0) { lblocks = 0; p_lblksrt = 0; } @@ -3041,7 +3041,7 @@ dcddump(dev_t dev, caddr_t addr, daddr_t blkno, int nblk) /* ARGSUSED3 */ static int dcdioctl(dev_t dev, int cmd, intptr_t arg, int flag, - cred_t *cred_p, int *rval_p) + cred_t *cred_p, int *rval_p) { auto int32_t data[512 / (sizeof (int32_t))]; struct dk_cinfo *info; @@ -3882,7 +3882,7 @@ static int dcd_write_deviceid(struct dcd_disk *un) { - int status; + int status; diskaddr_t blk; struct udcd_cmd ucmd; struct dcd_cmd cdb; @@ -4177,7 +4177,7 @@ dcd_validate_model_serial(char *str, int *retlen, int totallen) #ifndef lint void clean_print(dev_info_t *dev, char *label, uint_t level, - char *title, char *data, int len) + char *title, char *data, int len) { int i; char buf[256]; diff --git a/usr/src/uts/sun/io/sbusmem.c b/usr/src/uts/sun/io/sbusmem.c index c747c93dfc..1f0934707c 100644 --- a/usr/src/uts/sun/io/sbusmem.c +++ b/usr/src/uts/sun/io/sbusmem.c @@ -111,10 +111,6 @@ static struct modlinkage modlinkage = { static int sbmem_rw(dev_t, struct uio *, enum uio_rw, cred_t *); -#if !defined(lint) -static char sbusmem_initmsg[] = "sbusmem _init: sbusmem.c\t1.28\t08/19/2008\n"; -#endif - int _init(void) { @@ -206,7 +202,7 @@ sbmem_attach(dev_info_t *devi, ddi_attach_cmd_t cmd) } if (ddi_create_minor_node(devi, ident, S_IFCHR, instance, - DDI_PSEUDO, NULL) == DDI_FAILURE) { + DDI_PSEUDO, 0) == DDI_FAILURE) { kmem_free(ident, ilen); ddi_remove_minor_node(devi, NULL); ddi_soft_state_free(sbusmem_state_head, instance); @@ -279,15 +275,12 @@ sbmem_close(dev_t dev, int flag, int otyp, struct cred *cred) } static int -sbmem_info(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg, void **result) +sbmem_info(dev_info_t *dip __unused, ddi_info_cmd_t infocmd, void *arg, + void **result) { int instance, error = DDI_FAILURE; struct sbusmem_unit *un; -#if defined(lint) || defined(__lint) - dip = dip; -#endif /* lint || __lint */ - switch (infocmd) { case DDI_INFO_DEVT2DEVINFO: instance = getminor((dev_t)arg); @@ -328,7 +321,7 @@ sbmem_write(dev_t dev, struct uio *uio, cred_t *cred) } static int -sbmem_rw(dev_t dev, struct uio *uio, enum uio_rw rw, cred_t *cred) +sbmem_rw(dev_t dev, struct uio *uio, enum uio_rw rw, cred_t *cred __unused) { uint_t c; struct iovec *iov; @@ -338,10 +331,6 @@ sbmem_rw(dev_t dev, struct uio *uio, enum uio_rw rw, cred_t *cred) dev_info_t *dip; caddr_t reg; -#if defined(lint) || defined(__lint) - cred = cred; -#endif /* lint || __lint */ - instance = getminor(dev); if ((un = ddi_get_soft_state(sbusmem_state_head, instance)) == NULL) { return (ENXIO); @@ -383,15 +372,11 @@ sbmem_rw(dev_t dev, struct uio *uio, enum uio_rw rw, cred_t *cred) static int sbmem_devmap(dev_t dev, devmap_cookie_t dhp, offset_t off, size_t len, - size_t *maplen, uint_t model) + size_t *maplen, uint_t model __unused) { struct sbusmem_unit *un; int instance, error; -#if defined(lint) || defined(__lint) - model = model; -#endif /* lint || __lint */ - instance = getminor(dev); if ((un = ddi_get_soft_state(sbusmem_state_head, instance)) == NULL) { return (ENXIO); diff --git a/usr/src/uts/sun4/io/efcode/fcode.c b/usr/src/uts/sun4/io/efcode/fcode.c index 8610697835..eebe57bf7f 100644 --- a/usr/src/uts/sun4/io/efcode/fcode.c +++ b/usr/src/uts/sun4/io/efcode/fcode.c @@ -206,7 +206,7 @@ fc_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) fc_max_opens * sizeof (struct fc_state), KM_SLEEP); if (ddi_create_minor_node(dip, "fcode", S_IFCHR, - 0, DDI_PSEUDO, NULL) == DDI_FAILURE) { + 0, DDI_PSEUDO, 0) == DDI_FAILURE) { kmem_free(fc_states, fc_max_opens * sizeof (struct fc_state)); error = DDI_FAILURE; diff --git a/usr/src/uts/sun4/io/fpc/fpc-kstats.c b/usr/src/uts/sun4/io/fpc/fpc-kstats.c index 38a390031b..89949e9927 100644 --- a/usr/src/uts/sun4/io/fpc/fpc-kstats.c +++ b/usr/src/uts/sun4/io/fpc/fpc-kstats.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/sunddi.h> #include <sys/sunndi.h> @@ -281,7 +279,7 @@ fpc_dev_kstat(fire_perfcnt_t reg_group, uint8_t num_inst) (void) strncpy(dev_name, "tlu", sizeof (dev_name)); num_events = sizeof (fire_tlu_events) / sizeof (fi_kev_mask_t); num_events2 = sizeof (fire_tlu2_events) / - sizeof (fi_kev_mask_t); + sizeof (fi_kev_mask_t); fire_events = fire_tlu_events; fire_events2 = fire_tlu2_events; num_cntrs = NUM_TLU_COUNTERS; @@ -297,8 +295,7 @@ fpc_dev_kstat(fire_perfcnt_t reg_group, uint8_t num_inst) } for (i = 0; i < num_inst; i++) { - ksinfop = (fi_ksinfo_t *)kmem_zalloc(sizeof (fi_ksinfo_t), - KM_SLEEP); + ksinfop = kmem_zalloc(sizeof (fi_ksinfo_t), KM_SLEEP); ksinfop->pic_num_events = num_events; ksinfop->pic_reg_group = reg_group; @@ -361,7 +358,7 @@ fpc_dev_kstat(fire_perfcnt_t reg_group, uint8_t num_inst) /* create counter kstats */ ksinfop->cntr_ksp = fpc_create_cntr_kstat(dev_name, i, - fpc_cntr_kstat_update, ksinfop, num_cntrs); + fpc_cntr_kstat_update, ksinfop, num_cntrs); if (ksinfop->cntr_ksp == NULL) goto err; @@ -384,7 +381,7 @@ fpc_create_name_kstat(char *name, fi_ksinfo_t *pp, fi_kev_mask_t *ev, for (i = base; i < (base + num_cntrs); i++) { pp->pic_name_ksp[i] = fpc_create_picN_kstat(name, i, - pp->pic_sel_shift[i], pp->pic_num_events, ev); + pp->pic_sel_shift[i], pp->pic_num_events, ev); if (pp->pic_name_ksp[i] == NULL) return (FAILURE); @@ -408,7 +405,7 @@ fpc_create_picN_kstat(char *mod_name, int pic, int pic_sel_shift, int num_ev, (void) snprintf(pic_name, sizeof (pic_name), "pic%d", pic); if ((picN_ksp = kstat_create(mod_name, 0, pic_name, - "bus", KSTAT_TYPE_NAMED, num_ev, NULL)) == NULL) { + "bus", KSTAT_TYPE_NAMED, num_ev, 0)) == NULL) { cmn_err(CE_WARN, "%s %s : kstat create failed", mod_name, pic_name); return (NULL); @@ -423,7 +420,7 @@ fpc_create_picN_kstat(char *mod_name, int pic, int pic_sel_shift, int num_ev, */ for (event = 0; event < num_ev - 1; event++) { pic_named_data[event].value.ui64 = - (ev_array[event].pcr_mask << pic_sel_shift); + (ev_array[event].pcr_mask << pic_sel_shift); kstat_named_init(&pic_named_data[event], ev_array[event].event_name, KSTAT_DATA_UINT64); @@ -433,7 +430,7 @@ fpc_create_picN_kstat(char *mod_name, int pic, int pic_sel_shift, int num_ev, * add the clear_pic entry */ pic_named_data[event].value.ui64 = - (uint64_t)~(ev_array[event].pcr_mask << pic_sel_shift); + (uint64_t)~(ev_array[event].pcr_mask << pic_sel_shift); kstat_named_init(&pic_named_data[event], ev_array[event].event_name, KSTAT_DATA_UINT64); @@ -471,7 +468,7 @@ fpc_create_cntr_kstat(char *name, int instance, int (*update)(kstat_t *, int), if ((counters_ksp = kstat_create(name, instance, "counters", "bus", KSTAT_TYPE_NAMED, num_pics + 1, KSTAT_FLAG_WRITABLE)) == NULL) { cmn_err(CE_WARN, "kstat_create for %s%d failed", - name, instance); + name, instance); return (NULL); } diff --git a/usr/src/uts/sun4/io/trapstat.c b/usr/src/uts/sun4/io/trapstat.c index 4f99221bc0..75e5dab413 100644 --- a/usr/src/uts/sun4/io/trapstat.c +++ b/usr/src/uts/sun4/io/trapstat.c @@ -151,14 +151,14 @@ * Globals. (The complete mapping can be found in the UltraSPARC I&II User's * Manual.) * - * Note that the sets of globals are per trap _type_, not per trap _level_. + * Note that the sets of globals are per trap _type_, not per trap _level_. * Thus, when executing a TL>0 trap handler, one may not have registers * available (for example, both trap-instruction traps and spill traps execute * on the alternate globals; if a trap-instruction trap induces a window spill, * the window spill handler has no available globals). For trapstat, this is * problematic: a register is required to transfer control from one arbitrary * location (in the interposing trap table) to another (in the actual trap - * table). + * table). * * We solve this problem by exploiting the trap table's location at the bottom * of valid kernel memory (i.e. at KERNELBASE). We locate the interposing trap @@ -173,7 +173,7 @@ * Actual trap table: * * +--------------------------------+- 2ff - * | | . + * | | . * | Non-trap instruction, TL>0 | . <-----------------------+ * | | . <-----------------------|-+ * |- - - - - - - - - - - - - - - - +- 200 <-----------------------|-|-+ @@ -323,11 +323,11 @@ * * To accurately determine the amount of time spent executing the TLB miss * handler, one must get a timestamp on trap entry and trap exit, subtract the - * latter from the former, and add the result to an accumulating count. + * latter from the former, and add the result to an accumulating count. * Consider flow of control during normal TLB miss processing (where "ldx * [%g2], %g2" is an arbitrary TLB-missing instruction): - * - * + - - - - - - - -+ + * + * + - - - - - - - -+ * : : * : ldx [%g2], %g2 :<-------------------------------------------------------+ * : : Return from trap: | @@ -357,10 +357,10 @@ * As the above diagram indicates, interposing on the trap table allows one * only to determine a timestamp on trap _entry_: when the TLB miss handler * has completed filling the TLB, a "retry" will be issued, and control will - * transfer immediately back to the missing %pc. + * transfer immediately back to the missing %pc. * * To obtain a timestamp on trap exit, we must then somehow interpose between - * the "retry" and the subsequent control transfer to the TLB-missing + * the "retry" and the subsequent control transfer to the TLB-missing * instruction. To do this, we _push_ a trap level. The basic idea is to * spoof a TLB miss by raising TL, setting the %tpc to be within text * controlled by trapstat (the "TLB return entry") and branching to the @@ -371,7 +371,7 @@ * Here is the above TLB miss flow control diagram modified to reflect * trapstat's operation: * - * + - - - - - - - -+ + * + - - - - - - - -+ * : : * : ldx [%g2], %g2 :<-------------------------------------------------------+ * : : Return from trap: | @@ -928,8 +928,8 @@ trapstat_enable() cpu_t *cp = CPU; cp->cpu_m.cpu_tstat_flags |= TSTAT_TLB_STATS; - (void) hv_set_ctx0(NULL, NULL); - (void) hv_set_ctxnon0(NULL, NULL); + (void) hv_set_ctx0(0, 0); + (void) hv_set_ctxnon0(0, 0); } } #endif @@ -1114,7 +1114,7 @@ trapstat_tlbretent(tstat_percpu_t *tcpu, tstat_tlbretent_t *ret, static const uint32_t retent[TSTAT_TLBRET_NINSTR] = { #ifndef sun4v 0x87410000, /* rd %tick, %g3 */ - 0x03000000, /* sethi %hi(stat), %g1 */ + 0x03000000, /* sethi %hi(stat), %g1 */ 0x82106000, /* or %g1, %lo(stat), %g1 */ 0x89297001, /* sllx %g5, 1, %g4 */ 0x8931303e, /* srlx %g4, 62, %g4 */ @@ -1129,19 +1129,19 @@ trapstat_tlbretent(tstat_percpu_t *tcpu, tstat_tlbretent_t *ret, 0xc4586000, /* ldx [%g1 + tmiss_count], %g2 */ 0x8400a001, /* add %g2, 1, %g2 */ 0xc4706000, /* stx %g2, [%g1 + tmiss_count] */ - 0x0d000000, /* sethi %hi(tdata_tmptick), %g6 */ - 0xc459a000, /* ldx [%g6 + %lo(tdata_tmptick)], %g2 */ + 0x0d000000, /* sethi %hi(tdata_tmptick), %g6 */ + 0xc459a000, /* ldx [%g6 + %lo(tdata_tmptick)], %g2 */ 0x8620c002, /* sub %g3, %g2, %g3 */ 0xc4586000, /* ldx [%g1 + tmiss_time], %g2 */ 0x84008003, /* add %g2, %g3, %g2 */ 0xc4706000, /* stx %g2, [%g1 + tmiss_time] */ 0x83f00000 /* retry */ #else /* sun4v */ - 0x82102008, /* mov SCRATCHPAD_CPUID, %g1 */ + 0x82102008, /* mov SCRATCHPAD_CPUID, %g1 */ 0xced84400, /* ldxa [%g1]ASI_SCRATCHPAD, %g7 */ 0x8f29f000, /* sllx %g7, TSTAT_DATA_SHIFT, %g7 */ 0x87410000, /* rd %tick, %g3 */ - 0x03000000, /* sethi %hi(stat), %g1 */ + 0x03000000, /* sethi %hi(stat), %g1 */ 0x82004007, /* add %g1, %g7, %g1 */ 0x82106000, /* or %g1, %lo(stat), %g1 */ 0x8929703d, /* sllx %g5, 61, %g4 */ @@ -1151,9 +1151,9 @@ trapstat_tlbretent(tstat_percpu_t *tcpu, tstat_tlbretent_t *ret, 0xc4586000, /* ldx [%g1 + tmiss_count], %g2 */ 0x8400a001, /* add %g2, 1, %g2 */ 0xc4706000, /* stx %g2, [%g1 + tmiss_count] */ - 0x0d000000, /* sethi %hi(tdata_tmptick), %g6 */ + 0x0d000000, /* sethi %hi(tdata_tmptick), %g6 */ 0x8c018007, /* add %g6, %g7, %g6 */ - 0xc459a000, /* ldx [%g6 + %lo(tdata_tmptick)], %g2 */ + 0xc459a000, /* ldx [%g6 + %lo(tdata_tmptick)], %g2 */ 0x8620c002, /* sub %g3, %g2, %g3 */ 0xc4586000, /* ldx [%g1 + tmiss_time], %g2 */ 0x84008003, /* add %g2, %g3, %g2 */ @@ -1291,7 +1291,7 @@ trapstat_tlbent(tstat_percpu_t *tcpu, int entno) */ static const uint32_t tlbent[] = { #ifndef sun4v - 0x03000000, /* sethi %hi(stat), %g1 */ + 0x03000000, /* sethi %hi(stat), %g1 */ 0xc4586000, /* ldx [%g1 + %lo(stat)], %g2 */ 0x8400a001, /* add %g2, 1, %g2 */ 0xc4706000, /* stx %g2, [%g1 + %lo(stat)] */ @@ -1309,14 +1309,14 @@ trapstat_tlbent(tstat_percpu_t *tcpu, int entno) 0xc2d80000, /* ldxa [%g0]ASI_MMU, %g1 */ 0x83307030, /* srlx %g1, CTXSHIFT, %g1 */ 0x02c04004, /* brz,pn %g1, .+0x10 */ - 0x03000000, /* sethi %hi(new_tpc), %g1 */ + 0x03000000, /* sethi %hi(new_tpc), %g1 */ 0x82106000, /* or %g1, %lo(new_tpc), %g1 */ 0x30800002, /* ba,a .+0x8 */ 0x82106000, /* or %g1, %lo(new_tpc), %g1 */ 0x81904000, /* wrpr %g1, %g0, %tpc */ 0x82006004, /* add %g1, 4, %g1 */ 0x83904000, /* wrpr %g1, %g0, %tnpc */ - 0x03000000, /* sethi %hi(tmptick), %g1 */ + 0x03000000, /* sethi %hi(tmptick), %g1 */ 0x85410000, /* rd %tick, %g2 */ 0xc4706000, /* stx %g2, [%g1 + %lo(tmptick)] */ 0x30800000, /* ba,a addr */ @@ -1325,7 +1325,7 @@ trapstat_tlbent(tstat_percpu_t *tcpu, int entno) 0x82102008, /* mov SCRATCHPAD_CPUID, %g1 */ 0xc8d84400, /* ldxa [%g1]ASI_SCRATCHPAD, %g4 */ 0x89293000, /* sllx %g4, TSTAT_DATA_SHIFT, %g4 */ - 0x03000000, /* sethi %hi(stat), %g1 */ + 0x03000000, /* sethi %hi(stat), %g1 */ 0x82004004, /* add %g1, %g4, %g1 */ 0xc4586000, /* ldx [%g1 + %lo(stat)], %g2 */ 0x8400a001, /* add %g2, 1, %g2 */ @@ -1347,14 +1347,14 @@ trapstat_tlbent(tstat_percpu_t *tcpu, int entno) 0xc2d80400, /* ldxa [%g0]ASI_SCRATCHPAD, %g1 */ 0xc2586000, /* ldx [%g1 + MMFSA_?_CTX], %g1 */ 0x02c04004, /* brz,pn %g1, .+0x10 */ - 0x03000000, /* sethi %hi(new_tpc), %g1 */ + 0x03000000, /* sethi %hi(new_tpc), %g1 */ 0x82106000, /* or %g1, %lo(new_tpc), %g1 */ 0x30800002, /* ba,a .+0x8 */ 0x82106000, /* or %g1, %lo(new_tpc), %g1 */ 0x81904000, /* wrpr %g1, %g0, %tpc */ 0x82006004, /* add %g1, 4, %g1 */ 0x83904000, /* wrpr %g1, %g0, %tnpc */ - 0x03000000, /* sethi %hi(tmptick), %g1 */ + 0x03000000, /* sethi %hi(tmptick), %g1 */ 0x82004004, /* add %g1, %g4, %g1 */ 0x85410000, /* rd %tick, %g2 */ 0xc4706000, /* stx %g2, [%g1 + %lo(tmptick)] */ @@ -1505,7 +1505,7 @@ trapstat_make_traptab(tstat_percpu_t *tcpu) * back before branching to the actual trap table entry. */ static const uint32_t enabled[TSTAT_ENT_NINSTR] = { - 0x03000000, /* sethi %hi(stat), %g1 */ + 0x03000000, /* sethi %hi(stat), %g1 */ 0xc4586000, /* ldx [%g1 + %lo(stat)], %g2 */ 0x8400a001, /* add %g2, 1, %g2 */ 0xc4706000, /* stx %g2, [%g1 + %lo(stat)] */ @@ -1617,9 +1617,9 @@ trapstat_make_traptab(tstat_percpu_t *tcpu) * the interposing trap table. */ static const uint32_t enabled[TSTAT_ENT_NINSTR] = { - 0x03000000, /* sethi %hi(stat), %g1 */ + 0x03000000, /* sethi %hi(stat), %g1 */ 0x82106000, /* or %g1, %lo[stat), %g1 */ - 0x05000000, /* sethi %hi(addr), %g2 */ + 0x05000000, /* sethi %hi(addr), %g2 */ 0x8410a000, /* or %g2, %lo(addr), %g2 */ 0x86102008, /* mov ASI_SCRATCHPAD_CPUID, %g3 */ 0xc6d8c400, /* ldxa [%g3]ASI_SCRATCHPAD, %g3 */ @@ -1628,7 +1628,7 @@ trapstat_make_traptab(tstat_percpu_t *tcpu) }; static const uint32_t enabled_cont[TSTAT_ENT_NINSTR] = { - 0xc8584003, /* ldx [%g1 + %g3], %g4 */ + 0xc8584003, /* ldx [%g1 + %g3], %g4 */ 0x88012001, /* add %g4, 1, %g4 */ 0x81c08000, /* jmp %g2 */ 0xc8704003, /* stx %g4, [%g1 + %g3] */ diff --git a/usr/src/uts/sun4u/adm1026/Makefile b/usr/src/uts/sun4u/adm1026/Makefile index f3d51c0215..abe50e2bda 100755 --- a/usr/src/uts/sun4u/adm1026/Makefile +++ b/usr/src/uts/sun4u/adm1026/Makefile @@ -22,8 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of the adm1026 driver kernel module # # sun4u implementation architecture dependent @@ -37,9 +35,8 @@ UTSBASE = ../.. # # Define the module and object file sets. # -MODULE = adm1026 +MODULE = adm1026 OBJECTS = $(ADM1026_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(ADM1026_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -47,25 +44,16 @@ ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # include $(UTSBASE)/sun4u/Makefile.sun4u -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -N misc/i2c_svc -# compile time debug flag - - # # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) .KEEP_STATE: - all: $(ALL_DEPS) def: $(DEF_DEPS) @@ -74,12 +62,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # Include common targets. diff --git a/usr/src/uts/sun4u/boston/Makefile b/usr/src/uts/sun4u/boston/Makefile index 77a8dbdc0a..417eb3a663 100644 --- a/usr/src/uts/sun4u/boston/Makefile +++ b/usr/src/uts/sun4u/boston/Makefile @@ -46,12 +46,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -59,9 +55,7 @@ check := TARGET= check # .KEEP_STATE: -def all clean clean.lint clobber modlist: $(BOSTON_KMODS) - -modlintlib: $(BOSTON_KMODS) +def all clean clobber modlist: $(BOSTON_KMODS) install: $(ROOT_BOSTON_DIR) \ $(USR_BOSTON_DIR) \ @@ -74,24 +68,6 @@ install: $(ROOT_BOSTON_DIR) \ check install_h: -lint: modlintlib - -# -# The 'lint.platmod' target lints the boston platform module against the sun4u -# kernel. This ends up doing all the kernel cross-checks, so it takes a couple -# of minutes. Due to the low ROI, it's not run by default, but it's a good -# idea to run this if you change os/boston.c. -# -LINT_LIBS = $(LINT_LIB) \ - -L$(BOSTON_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nBoston Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(BOSTON_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/boston/os/boston.c b/usr/src/uts/sun4u/boston/os/boston.c index 119e5d2f7b..2862266b10 100644 --- a/usr/src/uts/sun4u/boston/os/boston.c +++ b/usr/src/uts/sun4u/boston/os/boston.c @@ -51,7 +51,7 @@ int (*rmc_req_now)(rmc_comm_msg_t *, uint8_t) = NULL; void startup_platform(void) { - mutex_init(&mi2cv_mutex, NULL, NULL, NULL); + mutex_init(&mi2cv_mutex, NULL, MUTEX_ADAPTIVE, NULL); } int diff --git a/usr/src/uts/sun4u/cheetah/Makefile b/usr/src/uts/sun4u/cheetah/Makefile index d9a17fd409..cd92def8df 100644 --- a/usr/src/uts/sun4u/cheetah/Makefile +++ b/usr/src/uts/sun4u/cheetah/Makefile @@ -41,7 +41,6 @@ UTSBASE = ../.. # MODULE = SUNW,UltraSPARC-III OBJECTS = $(CHEETAH_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(CHEETAH_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_CPU_DIR)/$(MODULE) ROOTSOFTLINKS = $(SOFTLINKS:%=$(ROOT_PSM_CPU_DIR)/%) @@ -62,15 +61,9 @@ CLEANFILES += $(CPULIB) $(SYM_MOD) # Define targets # ALL_TARGET = $(SYM_MOD) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = def $(BINARY) $(ROOTMODULE) $(ROOTSOFTLINKS) # -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - -# # cpu-module-specific flags # CPPFLAGS += -DCPU_MODULE -DCHEETAH @@ -89,12 +82,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) $(CPULIB): $(OBJECTS) @@ -112,17 +99,6 @@ $(ROOTSOFTLINKS): $(ROOTMODULE) # include $(UTSBASE)/sun4u/Makefile.targ -# -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN -LINTTAGS += -erroff=E_STATIC_UNUSED -LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV - CERRWARN += -_gcc=-Wno-parentheses CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-type-limits diff --git a/usr/src/uts/sun4u/cherrystone/Makefile b/usr/src/uts/sun4u/cherrystone/Makefile index 415c9b4021..1fdf3597a7 100644 --- a/usr/src/uts/sun4u/cherrystone/Makefile +++ b/usr/src/uts/sun4u/cherrystone/Makefile @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of all Cherrystone system # dependent modules for the sun4u architecture. # @@ -45,12 +43,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -58,15 +52,13 @@ check := TARGET= check # .KEEP_STATE: -def all clean.lint clean clobber modlist: $(CHERRYSTONE_KMODS) - -modlintlib: $(CHERRYSTONE_KMODS) +def all clean clobber modlist: $(CHERRYSTONE_KMODS) IMPLEMENTED_PLATFORM = SUNW,Sun-Fire-480R LINKED_PLATFORMS = SUNW,Sun-Fire-V490 -install: $(ROOT_CHERRYSTONE_DIR) $(USR_CHERRYSTONE_DIR) \ +install: $(ROOT_CHERRYSTONE_DIR) $(USR_CHERRYSTONE_DIR) \ $(USR_CHERRYSTONE_INC_DIR) \ $(USR_CHERRYSTONE_SBIN_DIR) \ $(USR_CHERRYSTONE_LIB_DIR) \ @@ -85,18 +77,6 @@ $(CHERRYSTONE_CRYPTO_LINKS): $(ROOT_CHERRYSTONE_CRYPTO_DIR_64) $(SYMLINK) $(ROOT_US3_CRYPTO_LINK)/$@ \ $(ROOT_CHERRYSTONE_CRYPTO_DIR_64)/$@ -lint: modlintlib - -LINT_LIBS = $(LINT_LIB) \ - -L$(CHERRYSTONE_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nCherrystone Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(CHERRYSTONE_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/cherrystone/os/cherrystone.c b/usr/src/uts/sun4u/cherrystone/os/cherrystone.c index 5b24d1a3da..1baeda6b35 100644 --- a/usr/src/uts/sun4u/cherrystone/os/cherrystone.c +++ b/usr/src/uts/sun4u/cherrystone/os/cherrystone.c @@ -101,7 +101,7 @@ startup_platform(void) extern int disable_watchdog_on_exit; disable_watchdog_on_exit = 1; - mutex_init(&cherry_pcf8584_mutex, NULL, NULL, NULL); + mutex_init(&cherry_pcf8584_mutex, NULL, MUTEX_ADAPTIVE, NULL); } #pragma weak mmu_init_large_pages @@ -295,14 +295,15 @@ plat_discover_slice(pfn_t pfn, pfn_t *first, pfn_t *last) /*ARGSUSED*/ void plat_freelist_process(int mnode) -{} +{ +} /* * Called for each board/cpu/PA range detected in plat_fill_mc(). */ static void update_mem_bounds(int boardid, int cpuid, int bankid, - uint64_t base, uint64_t size) + uint64_t base, uint64_t size) { uint64_t end; int mnode; diff --git a/usr/src/uts/sun4u/chicago/Makefile b/usr/src/uts/sun4u/chicago/Makefile index 683b077445..8795f4f948 100644 --- a/usr/src/uts/sun4u/chicago/Makefile +++ b/usr/src/uts/sun4u/chicago/Makefile @@ -22,8 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # uts/sun4u/chicago/Makefile # # This makefile drives the production of the sun4u chicago platform @@ -48,12 +46,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -61,9 +55,7 @@ check := TARGET= check # .KEEP_STATE: -def all clean clean.lint clobber modlist: $(CHICAGO_KMODS) - -modlintlib: $(CHICAGO_KMODS) +def all clean clobber modlist: $(CHICAGO_KMODS) install: $(ROOT_CHICAGO_DIR) \ $(USR_CHICAGO_DIR) \ @@ -75,24 +67,6 @@ install: $(ROOT_CHICAGO_DIR) \ check install_h: -lint: modlintlib - -# -# The 'lint.platmod' target lints the chicago platform module against the sun4u -# kernel. This ends up doing all the kernel cross-checks, so it takes a couple -# of minutes. Due to the low ROI, it's not run by default, but it's a good -# idea to run this if you change os/chicago.c. -# -LINT_LIBS = $(LINT_LIB) \ - -L$(CHICAGO_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nChicago Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(CHICAGO_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/chicago/io/fpc/fpc-impl-4u.c b/usr/src/uts/sun4u/chicago/io/fpc/fpc-impl-4u.c index 850501397a..aa96f19079 100644 --- a/usr/src/uts/sun4u/chicago/io/fpc/fpc-impl-4u.c +++ b/usr/src/uts/sun4u/chicago/io/fpc/fpc-impl-4u.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/file.h> #include <sys/sunndi.h> #include <sys/sunddi.h> @@ -189,8 +187,7 @@ bad_regs_length: if (regs_p) kmem_free(regs_p, regs_length); bad_regs_p: - if (platform_specific_data) - kmem_free(platform_specific_data, sizeof (fire4u_specific_t)); + kmem_free(platform_specific_data, sizeof (fire4u_specific_t)); if (nodename) kmem_free(nodename, nodename_size); diff --git a/usr/src/uts/sun4u/chicago/os/chicago.c b/usr/src/uts/sun4u/chicago/os/chicago.c index f1cfc84bfe..205e940eba 100644 --- a/usr/src/uts/sun4u/chicago/os/chicago.c +++ b/usr/src/uts/sun4u/chicago/os/chicago.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/param.h> #include <sys/systm.h> #include <sys/sysmacros.h> @@ -53,7 +51,7 @@ static void get_ebus_rtc_vaddr(void); void startup_platform(void) { - mutex_init(&chicago_mi2cv_mutex, NULL, NULL, NULL); + mutex_init(&chicago_mi2cv_mutex, NULL, MUTEX_ADAPTIVE, NULL); } int diff --git a/usr/src/uts/sun4u/cpr/Makefile b/usr/src/uts/sun4u/cpr/Makefile index af9b3a9635..69438cd16a 100644 --- a/usr/src/uts/sun4u/cpr/Makefile +++ b/usr/src/uts/sun4u/cpr/Makefile @@ -47,10 +47,6 @@ OBJECTS = $(CPR_FIRST_OBJS:%=$(OBJS_DIR)/%) \ $(CPR_IMPL_OBJS:%=$(OBJS_DIR)/%) \ $(CPR_OBJS:%=$(OBJS_DIR)/%) \ $(CPR_SPARC_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(CPR_FIRST_OBJS:%.o=$(LINTS_DIR)/%.ln) \ - $(CPR_OBJS:%.o=$(LINTS_DIR)/%.ln) \ - $(CPR_IMPL_OBJS:%.o=$(LINTS_DIR)/%.ln) \ - $(CPR_SPARC_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE) # @@ -66,29 +62,13 @@ include $(UTSBASE)/sun4u/Makefile.sun4u # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - -# # Depends on bootdev # LDFLAGS += -dy -N misc/bootdev -# -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV -LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN - CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-unused-label CERRWARN += $(CNOWARN_UNINIT) @@ -108,12 +88,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4u/cpu/us3_common.c b/usr/src/uts/sun4u/cpu/us3_common.c index 22477e2a4c..38a06c2731 100644 --- a/usr/src/uts/sun4u/cpu/us3_common.c +++ b/usr/src/uts/sun4u/cpu/us3_common.c @@ -1418,7 +1418,8 @@ cpu_log_fast_ecc_error(caddr_t tpc, int priv, int tl, uint64_t ceen, */ if ((t_afsr_errs & (C_AFSR_UCU | C_AFSR_L3_UCU)) && aflt->flt_panic == 0 && aflt->flt_priv != 0 && - curthread->t_ontrap == NULL && curthread->t_lofault == NULL) { + curthread->t_ontrap == NULL && + curthread->t_lofault == (uintptr_t)NULL) { get_cpu_error_state(&cpu_error_regs); if (IS_PANTHER(cpunodes[CPU->cpu_id].implementation)) { aflt->flt_panic |= @@ -4549,7 +4550,7 @@ cpu_error_to_resource_type(struct async_flt *aflt) */ static void cpu_payload_add_aflt(struct async_flt *aflt, nvlist_t *payload, - nvlist_t *resource, int *afar_status, int *synd_status) + nvlist_t *resource, int *afar_status, int *synd_status) { ch_async_flt_t *ch_flt = (ch_async_flt_t *)aflt; *synd_status = AFLT_STAT_INVALID; @@ -5351,7 +5352,7 @@ afsr_to_synd_status(uint_t cpuid, uint64_t afsr, uint64_t afsr_bit) void sticksync_slave(void) { - int i; + int i; int tries = 0; int64_t tskew; int64_t av_tskew; @@ -5494,7 +5495,7 @@ cpu_uninit_private(struct cpu *cp) ASSERT(chprp); cpu_uninit_ecache_scrub_dr(cp); CPU_PRIVATE(cp) = NULL; - ch_err_tl1_paddrs[cp->cpu_id] = NULL; + ch_err_tl1_paddrs[cp->cpu_id] = 0; kmem_cache_free(ch_private_cache, chprp); cmp_delete_cpu(cp->cpu_id); @@ -6175,8 +6176,8 @@ cpu_check_ce_errors(void *arg) * * flag == SCRUBBER_CEEN_CHECK * called from memscrubber, just check/scrub, no reset - * paddr physical addr. for start of scrub pages - * vaddr virtual addr. for scrub area + * paddr physical addr. for start of scrub pages + * vaddr virtual addr. for scrub area * psz page size of area to be scrubbed * * flag == TIMEOUT_CEEN_CHECK @@ -6316,9 +6317,9 @@ cpu_ce_delayed_ec_logout(uint64_t afar) void cpu_ce_detected(ch_cpu_errors_t *cpu_error_regs, int flag) { - ch_async_flt_t ch_flt; + ch_async_flt_t ch_flt; struct async_flt *aflt; - char pr_reason[MAX_REASON_STRING]; + char pr_reason[MAX_REASON_STRING]; bzero(&ch_flt, sizeof (ch_async_flt_t)); ch_flt.flt_trapped_ce = flag; @@ -6356,8 +6357,8 @@ cpu_log_and_clear_ce(ch_async_flt_t *ch_flt) struct async_flt *aflt; uint64_t afsr, afsr_errs; ch_cpu_logout_t *clop; - char pr_reason[MAX_REASON_STRING]; - on_trap_data_t *otp = curthread->t_ontrap; + char pr_reason[MAX_REASON_STRING]; + on_trap_data_t *otp = curthread->t_ontrap; aflt = (struct async_flt *)ch_flt; afsr = aflt->flt_stat; @@ -7017,7 +7018,7 @@ fpras_failure(int op, int how) * ie, don't panic for copyin, copyout, kcopy and bcopy called * under on_fault and do panic for unprotected bcopy and hwblkpagecopy. */ - aflt->flt_panic = (curthread->t_lofault == NULL); + aflt->flt_panic = (curthread->t_lofault == (uintptr_t)NULL); /* * XOR the source instruction block with the copied instruction diff --git a/usr/src/uts/sun4u/daktari/Makefile b/usr/src/uts/sun4u/daktari/Makefile index 2e5a318a1f..9a2a3f02c0 100644 --- a/usr/src/uts/sun4u/daktari/Makefile +++ b/usr/src/uts/sun4u/daktari/Makefile @@ -23,9 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# -#ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of all Daktari system # dependent modules for the sun4u architecture. # @@ -47,12 +44,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -60,15 +53,13 @@ check := TARGET= check # .KEEP_STATE: -def all clean.lint clean clobber modlist: $(DAKTARI_KMODS) - -modlintlib: $(DAKTARI_KMODS) +def all clean clobber modlist: $(DAKTARI_KMODS) IMPLEMENTED_PLATFORM = SUNW,Sun-Fire-880 LINKED_PLATFORMS = SUNW,Sun-Fire-V890 -install: $(ROOT_DAKTARI_DIR) $(USR_DAKTARI_DIR) \ +install: $(ROOT_DAKTARI_DIR) $(USR_DAKTARI_DIR) \ $(USR_DAKTARI_INC_DIR) \ $(USR_DAKTARI_SBIN_DIR) \ $(USR_DAKTARI_LIB_DIR) \ @@ -86,25 +77,6 @@ $(DAKTARI_CRYPTO_LINKS): $(ROOT_DAKTARI_CRYPTO_DIR_64) install_h check: FRC @cd sys; pwd; $(MAKE) $(TARGET) - -lint: modlintlib - -# -# The 'lint.platmod' target lints the daktari platform module against the sun4u -# kernel. This ends up doing all the kernel cross-checks, so it takes a couple -# of minutes. Due to the low ROI, it's not run by default, but it's a good -# idea to run this if you change os/daktari.c. -# -LINT_LIBS = $(LINT_LIB) \ - -L$(DAKTARI_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nDaktari Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(DAKTARI_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/daktari/io/hpc3130_dak.c b/usr/src/uts/sun4u/daktari/io/hpc3130_dak.c index a0247ea880..47e9b8ac2b 100644 --- a/usr/src/uts/sun4u/daktari/io/hpc3130_dak.c +++ b/usr/src/uts/sun4u/daktari/io/hpc3130_dak.c @@ -336,7 +336,7 @@ hpc3130_get(intptr_t arg, int reg, hpc3130_unit_t *unitp, int mode) i2c_transfer_t *i2c_tran_pointer; int err = DDI_SUCCESS; - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "ioctl: arg passed in to " "ioctl = NULL")); return (EINVAL); @@ -380,7 +380,7 @@ hpc3130_set(intptr_t arg, int reg, hpc3130_unit_t *unitp, int mode) int err = DDI_SUCCESS; uint8_t passin_byte; - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "ioctl: arg passed in to " "ioctl = NULL")); return (EINVAL); @@ -413,11 +413,11 @@ hpc3130_set(intptr_t arg, int reg, hpc3130_unit_t *unitp, int mode) static int hpc3130_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { _NOTE(ARGUNUSED(credp, rvalp)) hpc3130_unit_t *unitp; - int err = DDI_SUCCESS; + int err = DDI_SUCCESS; i2c_transfer_t *i2c_tran_pointer; i2c_reg_t ioctl_reg; int port = MINOR_TO_PORT(getminor(dev)); @@ -522,7 +522,7 @@ hpc3130_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, break; case I2C_GET_REG: - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "ioctl: arg passed in to " "ioctl = NULL")); err = EINVAL; @@ -566,7 +566,7 @@ hpc3130_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, break; case I2C_SET_REG: - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "ioctl: arg passed in to " "ioctl = NULL")); err = EINVAL; @@ -581,7 +581,7 @@ hpc3130_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, } (void) i2c_transfer_alloc(unitp->hpc3130_hdl, &i2c_tran_pointer, 2, 0, I2C_SLEEP); - if (i2c_tran_pointer == NULL) { + if (i2c_tran_pointer == NULL) { D2CMN_ERR((CE_WARN, "Failed in I2C_GET_REG " "i2c_tran_pointer not allocated")); err = ENOMEM; @@ -685,11 +685,11 @@ hpc3130_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, } static int -hpc3130_poll(dev_t dev, short events, int anyyet, short - *reventsp, struct pollhead **phpp) +hpc3130_poll(dev_t dev, short events, int anyyet, short *reventsp, + struct pollhead **phpp) { _NOTE(ARGUNUSED(events)) - hpc3130_unit_t *unitp; + hpc3130_unit_t *unitp; int port = MINOR_TO_PORT(getminor(dev)); int instance = MINOR_TO_INST(getminor(dev)); @@ -983,7 +983,7 @@ hpc3130_do_attach(dev_info_t *dip) minor_number = INST_TO_MINOR(instance) | PORT_TO_MINOR(I2C_PORT(i)); if (ddi_create_minor_node(dip, name, S_IFCHR, minor_number, - "ddi_i2c:controller", NULL) == DDI_FAILURE) { + "ddi_i2c:controller", 0) == DDI_FAILURE) { D1CMN_ERR((CE_WARN, "ddi_create_minor_node failed " "for %s", name)); ddi_remove_intr(dip, 0u, @@ -1112,7 +1112,7 @@ hpc3130_set_led(hpc3130_unit_t *unitp, int slot, int led, uint8_t value) int hpc3130_get_led(i2c_client_hdl_t handle, int slot, - int led, uint8_t *value) + int led, uint8_t *value) { uint8_t temp; @@ -1126,7 +1126,7 @@ hpc3130_get_led(i2c_client_hdl_t handle, int slot, static int hpc3130_write(i2c_client_hdl_t handle, uint8_t offset, - uint8_t port, uint8_t data) + uint8_t port, uint8_t data) { ASSERT(port < HPC3130_MAX_SLOT); ASSERT(handle); @@ -1137,7 +1137,7 @@ hpc3130_write(i2c_client_hdl_t handle, uint8_t offset, static int hpc3130_read(i2c_client_hdl_t handle, uint8_t offset, - uint8_t port, uint8_t *data) + uint8_t port, uint8_t *data) { ASSERT(port < HPC3130_MAX_SLOT); ASSERT(handle); @@ -1148,7 +1148,7 @@ hpc3130_read(i2c_client_hdl_t handle, uint8_t offset, static int hpc3130_rw(i2c_client_hdl_t handle, uint8_t reg, - boolean_t write, uint8_t *data) + boolean_t write, uint8_t *data) { i2c_transfer_t *i2c_tran_pointer; int err; @@ -1201,7 +1201,7 @@ hpc3130_rw(i2c_client_hdl_t handle, uint8_t reg, */ static int hpc3130_init(dev_info_t *dip, - struct tuple *init_sequence) + struct tuple *init_sequence) { int slot; @@ -1445,7 +1445,7 @@ out: static int hpc3130_debounce_status(i2c_client_hdl_t handle, - int slot, uint8_t *status) + int slot, uint8_t *status) { int count, limit; uint8_t old; @@ -1484,7 +1484,7 @@ hpc3130_debounce_status(i2c_client_hdl_t handle, static int hpc3130_slot_connect(caddr_t ops_arg, hpc_slot_t slot_hdl, - void *data, uint_t flags) + void *data, uint_t flags) { _NOTE(ARGUNUSED(slot_hdl, data, flags)) uint8_t control; @@ -1673,7 +1673,7 @@ out: static int hpc3130_slot_disconnect(caddr_t ops_arg, hpc_slot_t slot_hdl, - void *data, uint_t flags) + void *data, uint_t flags) { _NOTE(ARGUNUSED(slot_hdl, data, flags)) uint8_t control; @@ -1800,7 +1800,7 @@ out: static int hpc3130_verify_slot_power(hpc3130_unit_t *hpc3130_p, i2c_client_hdl_t handle, - uint8_t offset, char *phys_slot, boolean_t slot_target_state) + uint8_t offset, char *phys_slot, boolean_t slot_target_state) { uint8_t tries = 0; uint8_t status; @@ -1870,7 +1870,7 @@ hpc3130_verify_slot_power(hpc3130_unit_t *hpc3130_p, i2c_client_hdl_t handle, static int hpc3130_slot_insert(caddr_t ops_arg, hpc_slot_t slot_hdl, - void *data, uint_t flags) + void *data, uint_t flags) { _NOTE(ARGUNUSED(ops_arg, slot_hdl, data, flags)) return (HPC_ERR_NOTSUPPORTED); @@ -1878,7 +1878,7 @@ hpc3130_slot_insert(caddr_t ops_arg, hpc_slot_t slot_hdl, static int hpc3130_slot_remove(caddr_t ops_arg, hpc_slot_t slot_hdl, - void *data, uint_t flags) + void *data, uint_t flags) { _NOTE(ARGUNUSED(ops_arg, slot_hdl, data, flags)) return (HPC_ERR_NOTSUPPORTED); @@ -1886,7 +1886,7 @@ hpc3130_slot_remove(caddr_t ops_arg, hpc_slot_t slot_hdl, static int hpc3130_slot_control(caddr_t ops_arg, hpc_slot_t slot_hdl, - int request, caddr_t arg) + int request, caddr_t arg) { _NOTE(ARGUNUSED(slot_hdl)) i2c_client_hdl_t handle; @@ -2049,9 +2049,9 @@ hpc3130_lookup_slot(char *nexus, int pcidev) { int i = 0; - while ((slot_translate[i].pcidev != pcidev || - strcmp(nexus, slot_translate[i].nexus) != 0) && - i < HPC3130_LOOKUP_SLOTS) + while (i < HPC3130_LOOKUP_SLOTS && + (slot_translate[i].pcidev != pcidev || + strcmp(nexus, slot_translate[i].nexus) != 0)) i++; ASSERT(i != HPC3130_LOOKUP_SLOTS); return (i); diff --git a/usr/src/uts/sun4u/db21554/Makefile b/usr/src/uts/sun4u/db21554/Makefile index ef3d37f0f3..79b523ba96 100644 --- a/usr/src/uts/sun4u/db21554/Makefile +++ b/usr/src/uts/sun4u/db21554/Makefile @@ -41,7 +41,6 @@ UTSBASE = ../.. # MODULE = db21554 OBJECTS = $(DB21554_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(DB21554_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -53,18 +52,12 @@ include $(UTSBASE)/sun4u/Makefile.sun4u # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Turn this on once compiler understands v9 in it's backend #INLINES += $(UTSBASE)/sun4u/io/pci.il # -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - -# # Turn on doubleword alignment for 64 bit registers # CFLAGS += -dalign @@ -79,13 +72,6 @@ CFLAGS += -DPCI_HOTPLUG # LDFLAGS += -dy -Nmisc/pcihp -# -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN - CERRWARN += -_gcc=-Wno-parentheses CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-type-limits @@ -102,12 +88,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4u/excalibur/Makefile b/usr/src/uts/sun4u/excalibur/Makefile index 9c110d7809..ea5b6dc325 100644 --- a/usr/src/uts/sun4u/excalibur/Makefile +++ b/usr/src/uts/sun4u/excalibur/Makefile @@ -24,8 +24,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of the sun4u excalibur platform # module. # @@ -48,12 +46,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -61,9 +55,7 @@ check := TARGET= check # .KEEP_STATE: -def all clean clean.lint clobber modlist: $(EXCALIBUR_KMODS) - -modlintlib: $(EXCALIBUR_KMODS) +def all clean clobber modlist: $(EXCALIBUR_KMODS) install: $(ROOT_EXCALIBUR_DIR) \ $(USR_EXCALIBUR_DIR) \ @@ -75,24 +67,6 @@ install: $(ROOT_EXCALIBUR_DIR) \ check install_h: -lint: modlintlib - -# -# The 'lint.platmod' target lints the excalibur platform module against the sun4u -# kernel. This ends up doing all the kernel cross-checks, so it takes a couple -# of minutes. Due to the low ROI, it's not run by default, but it's a good -# idea to run this if you change os/excalibur.c. -# -LINT_LIBS = $(LINT_LIB) \ - -L$(EXCALIBUR_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nExcalibur Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(EXCALIBUR_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/excalibur/io/xcalwd.c b/usr/src/uts/sun4u/excalibur/io/xcalwd.c index a712ae5102..62cb0aaa70 100644 --- a/usr/src/uts/sun4u/excalibur/io/xcalwd.c +++ b/usr/src/uts/sun4u/excalibur/io/xcalwd.c @@ -196,7 +196,7 @@ _info(struct modinfo *modinfop) /*ARGSUSED*/ static int xcalwd_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, - void *arg, void **resultp) + void *arg, void **resultp) { int retval; dev_t dev = (dev_t)arg; @@ -255,7 +255,7 @@ xcalwd_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) } if (ddi_create_minor_node(dip, MINOR_DEVICE_NAME, - S_IFCHR, instance, DDI_PSEUDO, NULL) == DDI_FAILURE) { + S_IFCHR, instance, DDI_PSEUDO, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "create minor node failed\n"); return (DDI_FAILURE); } @@ -396,7 +396,7 @@ xcalwd_close(dev_t dev, int flag, int otyp, cred_t *credp) /*ARGSUSED*/ static int xcalwd_ioctl(dev_t dev, int cmd, intptr_t arg, int flag, - cred_t *cred_p, int *rvalp) + cred_t *cred_p, int *rvalp) { int instance; xcalwd_state_t *tsp; diff --git a/usr/src/uts/sun4u/excalibur/os/excalibur.c b/usr/src/uts/sun4u/excalibur/os/excalibur.c index 2727e25ac3..9dd7b33a13 100644 --- a/usr/src/uts/sun4u/excalibur/os/excalibur.c +++ b/usr/src/uts/sun4u/excalibur/os/excalibur.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/param.h> #include <sys/systm.h> #include <sys/sysmacros.h> @@ -66,7 +64,7 @@ static xcalfan_info_t xcalfans[] = { void startup_platform(void) { - mutex_init(&excal_pcf8584_mutex, NULL, NULL, NULL); + mutex_init(&excal_pcf8584_mutex, NULL, MUTEX_ADAPTIVE, NULL); } int @@ -185,7 +183,7 @@ plat_get_mem_unum(int synd_code, uint64_t flt_addr, int flt_bus_id, { if (flt_in_memory && (p2get_mem_unum != NULL)) return (p2get_mem_unum(synd_code, P2ALIGN(flt_addr, 8), - buf, buflen, lenp)); + buf, buflen, lenp)); else return (ENOTSUP); } diff --git a/usr/src/uts/sun4u/gpio_87317/Makefile b/usr/src/uts/sun4u/gpio_87317/Makefile index 86374e2b13..a0962484f3 100644 --- a/usr/src/uts/sun4u/gpio_87317/Makefile +++ b/usr/src/uts/sun4u/gpio_87317/Makefile @@ -39,9 +39,8 @@ UTSBASE = ../.. # # Define the module and object file sets. # -MODULE = gpio_87317 +MODULE = gpio_87317 OBJECTS = $(GPIO_87317_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(GPIO_87317_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -52,14 +51,9 @@ include $(UTSBASE)/sun4u/Makefile.sun4u # # Define targets # -ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint +ALL_TARGET = $(BINARY) INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses # @@ -75,16 +69,9 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # # Include common targets. # include $(UTSBASE)/sun4u/Makefile.targ - diff --git a/usr/src/uts/sun4u/grover/io/grfans.c b/usr/src/uts/sun4u/grover/io/grfans.c index 73219668da..0f8e397b4a 100644 --- a/usr/src/uts/sun4u/grover/io/grfans.c +++ b/usr/src/uts/sun4u/grover/io/grfans.c @@ -215,7 +215,7 @@ grfans_do_attach(dev_info_t *dip) if (ddi_create_minor_node(dip, "cpu_fan", S_IFCHR, DEVINST_TO_MINOR(instance) | CHANNEL_TO_MINOR(CPU_FAN_CHANNEL), - FANS_NODE_TYPE, NULL) == DDI_FAILURE) { + FANS_NODE_TYPE, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s ddi_create_minor_node failed" " for cpu fan", name); ddi_regs_map_free(&unitp->cpufan_rhandle); @@ -228,7 +228,7 @@ grfans_do_attach(dev_info_t *dip) if (ddi_create_minor_node(dip, "sys_fan", S_IFCHR, DEVINST_TO_MINOR(instance) | CHANNEL_TO_MINOR(SYSTEM_FAN_CHANNEL), - FANS_NODE_TYPE, NULL) == DDI_FAILURE) { + FANS_NODE_TYPE, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s ddi_create_minor_node failed" " for system fan", name); ddi_regs_map_free(&unitp->cpufan_rhandle); diff --git a/usr/src/uts/sun4u/grover/os/grover.c b/usr/src/uts/sun4u/grover/os/grover.c index 6a84c726e1..3cb4cc58c3 100644 --- a/usr/src/uts/sun4u/grover/os/grover.c +++ b/usr/src/uts/sun4u/grover/os/grover.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/param.h> #include <sys/systm.h> #include <sys/sunddi.h> @@ -57,12 +55,12 @@ set_platform_defaults(void) * of Southbridge. */ #define GROVER_ISA_PATHNAME "/pci@1f,0/isa@7" -ddi_acc_handle_t grover_isa_handle; /* handle for isa pci space */ +ddi_acc_handle_t grover_isa_handle; /* handle for isa pci space */ void load_platform_drivers(void) { - dev_info_t *dip; /* dip of the isa driver */ + dev_info_t *dip; /* dip of the isa driver */ if (i_ddi_attach_hw_nodes("power") != DDI_SUCCESS) @@ -88,12 +86,10 @@ load_platform_drivers(void) dip = e_ddi_hold_devi_by_path(GROVER_ISA_PATHNAME, 0); if (dip == NULL) { cmn_err(CE_PANIC, "Could not install the isa driver\n"); - return; } if (pci_config_setup(dip, &grover_isa_handle) != DDI_SUCCESS) { cmn_err(CE_PANIC, "Could not get the config space of isa\n"); - return; } } diff --git a/usr/src/uts/sun4u/grover/platmod/Makefile b/usr/src/uts/sun4u/grover/platmod/Makefile index c217de09a7..7962801ce2 100644 --- a/usr/src/uts/sun4u/grover/platmod/Makefile +++ b/usr/src/uts/sun4u/grover/platmod/Makefile @@ -40,7 +40,6 @@ UTSBASE = ../../.. # MODULE = platmod OBJECTS = $(GROVER_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(GROVER_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_GROVER_MISC_DIR)/$(MODULE) PLAT_DIR = . @@ -60,7 +59,6 @@ CLEANFILES += $(PLATLIB) $(SYM_MOD) # Define targets # ALL_TARGET = $(SYM_MOD) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # @@ -81,18 +79,10 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) check: -LINT_LIB_DIR = $(GROVER_LINT_LIB_DIR) - $(PLATLIB): $(OBJECTS) $(BUILD.SO) $(OBJECTS) diff --git a/usr/src/uts/sun4u/io/gpio_87317.c b/usr/src/uts/sun4u/io/gpio_87317.c index 450425e407..3c218b58b5 100644 --- a/usr/src/uts/sun4u/io/gpio_87317.c +++ b/usr/src/uts/sun4u/io/gpio_87317.c @@ -213,7 +213,7 @@ gpio_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) instance = ddi_get_instance(dip); DBG(dip, "attach: instance is %d", instance, 0, 0, 0, 0); if (ddi_soft_state_zalloc(statep, instance) != DDI_SUCCESS) - goto attach_failed; + goto attach_failed; softc = getsoftc(instance); softc->gp_dip = dip; softc->gp_state = 0; @@ -226,7 +226,7 @@ gpio_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) dev_attr.devacc_attr_dataorder = DDI_STRICTORDER_ACC; if (ddi_regs_map_setup(dip, 0, (caddr_t *)&softc->gp_regs, 0, 0, &dev_attr, &softc->gp_handle) != DDI_SUCCESS) - goto attach_failed; + goto attach_failed; DBG(dip, "attach: regs=0x%p", (uintptr_t)softc->gp_regs, 0, 0, 0, 0); DBG(dip, "attach: port 1 data is %x", @@ -254,10 +254,10 @@ gpio_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) (uintptr_t)ddi_get8(softc->gp_handle, &softc->gp_regs[7]), 0, 0, 0, 0); - /* Create device minor nodes. */ + /* Create device minor nodes. */ if (ddi_create_minor_node(dip, "gpio", S_IFCHR, - instance, NULL, NULL) == DDI_FAILURE) { + instance, NULL, 0) == DDI_FAILURE) { ddi_regs_map_free(&softc->gp_handle); goto attach_failed; } @@ -267,7 +267,7 @@ gpio_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) case DDI_RESUME: - /* Nothing to do for a resume. */ + /* Nothing to do for a resume. */ return (DDI_SUCCESS); @@ -340,7 +340,7 @@ gpio_close(dev_t dev, int flag, int otyp, cred_t *credp) /* ARGSUSED */ static int gpio_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { int instance = getminor(dev); struct gpio_softc *softc = getsoftc(instance); @@ -423,7 +423,7 @@ gpio_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, #ifdef DEBUG void gpio_debug(dev_info_t *dip, char *format, uint_t arg1, uint_t arg2, uint_t arg3, - uint_t arg4, uint_t arg5) + uint_t arg4, uint_t arg5) { if (gpio_debug_flag == 0) { return; diff --git a/usr/src/uts/sun4u/io/i2c/clients/adm1026.c b/usr/src/uts/sun4u/io/i2c/clients/adm1026.c index 7ab697104c..4e8340d642 100644 --- a/usr/src/uts/sun4u/io/i2c/clients/adm1026.c +++ b/usr/src/uts/sun4u/io/i2c/clients/adm1026.c @@ -312,7 +312,7 @@ adm1026_do_attach(dev_info_t *dip) D2CMN_ERR((CE_WARN, "adm1026_do_attach: ddi_create_minor_node")); if (ddi_create_minor_node(dip, "adm1026", S_IFCHR, instance, - "ddi_i2c:led_control", NULL) == DDI_FAILURE) { + "ddi_i2c:led_control", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "adm1026_do_attach: ddi_create_minor_node failed"); ddi_soft_state_free(adm1026soft_statep, instance); @@ -438,7 +438,7 @@ adm1026_put8(adm1026_unit_t *unitp, uint8_t reg, uint8_t val) */ static int adm1026_send8(adm1026_unit_t *unitp, uint8_t reg, uint8_t reg_val, - uint8_t reg_mask) + uint8_t reg_mask) { uint8_t val = 0; int err; @@ -593,7 +593,7 @@ adm1026_get_config(adm1026_unit_t *unitp, int cmd, uint32_t mask, uint32_t *val) static int adm1026_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { _NOTE(ARGUNUSED(credp, rvalp)) diff --git a/usr/src/uts/sun4u/io/i2c/clients/pic16f819.c b/usr/src/uts/sun4u/io/i2c/clients/pic16f819.c index 0f093c72d5..71cfcde9b3 100644 --- a/usr/src/uts/sun4u/io/i2c/clients/pic16f819.c +++ b/usr/src/uts/sun4u/io/i2c/clients/pic16f819.c @@ -275,17 +275,17 @@ pic16f819_close(dev_t dev, int flags, int otyp, cred_t *credp) static int pic16f819_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, - cred_t *credp, int *rvalp) + cred_t *credp, int *rvalp) { _NOTE(ARGUNUSED(credp, rvalp)) - struct pic16f819_unit *unitp; - int instance; - int err = 0; + struct pic16f819_unit *unitp; + int instance; + int err = 0; i2c_reg_t ioctl_reg; - uchar_t val8; + uchar_t val8; - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "PIC16F819: ioctl: arg passed in to ioctl " "= NULL\n")); err = EINVAL; @@ -389,7 +389,7 @@ pic16f819_do_attach(dev_info_t *dip) "%s%d", ddi_node_name(dip), instance); if (ddi_create_minor_node(dip, "fan_1", S_IFCHR, instance, - "ddi_i2c:pic", NULL) == DDI_FAILURE) { + "ddi_i2c:pic", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s ddi_create_minor_node failed for " "%s\n", unitp->pic16f819_name, "pic16f819"); ddi_soft_state_free(pic16f819soft_statep, instance); diff --git a/usr/src/uts/sun4u/io/i2c/clients/ssc050.c b/usr/src/uts/sun4u/io/i2c/clients/ssc050.c index 1cf46a0574..1a79a14f4f 100644 --- a/usr/src/uts/sun4u/io/i2c/clients/ssc050.c +++ b/usr/src/uts/sun4u/io/i2c/clients/ssc050.c @@ -306,7 +306,7 @@ ssc050_set(struct ssc050_unit *unitp, int reg, uchar_t byte) static int ssc050_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { _NOTE(ARGUNUSED(credp, rvalp)) @@ -317,14 +317,14 @@ ssc050_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, i2c_reg_t ioctl_reg; int port = MINOR_TO_PORT(getminor(dev)); int instance = MINOR_TO_INST(getminor(dev)); - uchar_t reg, val8; - uchar_t control; + uchar_t reg, val8; + uchar_t control; uchar_t fan_count; int divisor; int32_t fan_speed; uint8_t inverted_mask; - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "SSC050: ioctl: arg passed in to ioctl " "= NULL")); return (EINVAL); @@ -498,10 +498,10 @@ ssc050_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, val8)); err = ssc050_set(unitp, reg, val8 | SSC050_DATADIRECTION_BIT); - if (err != I2C_SUCCESS) { - break; - } - delay(10); + if (err != I2C_SUCCESS) { + break; + } + delay(10); } } @@ -647,7 +647,7 @@ ssc050_do_attach(dev_info_t *dip) PORT_TO_MINOR(I2C_PORT(i)); if (ddi_create_minor_node(dip, name, S_IFCHR, minor_number, - "ddi_i2c:ioexp", NULL) == DDI_FAILURE) { + "ddi_i2c:ioexp", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s: failed to create node for %s", unitp->name, name); ddi_soft_state_free(ssc050soft_statep, instance); @@ -684,7 +684,7 @@ ssc050_do_detach(dev_info_t *dip) int ssc050_get_port_bit(dev_info_t *dip, int port, int bit, uchar_t *rval, - int flags) + int flags) { struct ssc050_unit *unitp; int instance; diff --git a/usr/src/uts/sun4u/io/i2c/clients/ssc100.c b/usr/src/uts/sun4u/io/i2c/clients/ssc100.c index 9ebc3eabc8..0c92f7b977 100644 --- a/usr/src/uts/sun4u/io/i2c/clients/ssc100.c +++ b/usr/src/uts/sun4u/io/i2c/clients/ssc100.c @@ -294,7 +294,7 @@ ssc100_set(struct ssc100_unit *unitp, uchar_t byte) static int ssc100_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, - cred_t *credp, int *rvalp) + cred_t *credp, int *rvalp) { _NOTE(ARGUNUSED(credp, rvalp)) @@ -306,7 +306,7 @@ ssc100_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, i2c_reg_t ioctl_reg; uchar_t byte; - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "SSC100: ioctl: arg passed in to ioctl " "= NULL")); err = EINVAL; @@ -529,7 +529,7 @@ ssc100_do_attach(dev_info_t *dip) "%s%d", ddi_node_name(dip), instance); if (ddi_create_minor_node(dip, "ssc100", S_IFCHR, instance, - "ddi_i2c:ioexp", NULL) == DDI_FAILURE) { + "ddi_i2c:ioexp", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s ddi_create_minor_node failed for " "%s", unitp->ssc100_name, "ssc100"); ddi_soft_state_free(ssc100soft_statep, instance); diff --git a/usr/src/uts/sun4u/io/pci/db21554.c b/usr/src/uts/sun4u/io/pci/db21554.c index f51ad8c0e6..fc1e83fd19 100644 --- a/usr/src/uts/sun4u/io/pci/db21554.c +++ b/usr/src/uts/sun4u/io/pci/db21554.c @@ -321,7 +321,7 @@ static void db_pci_get_conf_regs(ddi_acc_handle_t config_handle, #ifdef DEBUG static void db_debug(uint64_t func_id, dev_info_t *dip, char *fmt, - uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5); + uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5); #endif static int db_prop_op(dev_t dev, dev_info_t *dip, ddi_prop_op_t prop_op, @@ -348,34 +348,34 @@ static struct cb_ops db_cb_ops = { nodev /* int (*cb_awrite)() */ }; -static uint8_t db_ddi_get8(ddi_acc_impl_t *handle, uint8_t *addr); +static uint8_t db_ddi_get8(ddi_acc_impl_t *handle, uint8_t *addr); static uint16_t db_ddi_get16(ddi_acc_impl_t *handle, uint16_t *addr); static uint32_t db_ddi_get32(ddi_acc_impl_t *handle, uint32_t *addr); static uint64_t db_ddi_get64(ddi_acc_impl_t *handle, uint64_t *addr); -static void db_ddi_put8(ddi_acc_impl_t *handle, uint8_t *addr, - uint8_t data); -static void db_ddi_put16(ddi_acc_impl_t *handle, uint16_t *addr, - uint16_t data); -static void db_ddi_put32(ddi_acc_impl_t *handle, uint32_t *addr, - uint32_t data); -static void db_ddi_put64(ddi_acc_impl_t *handle, uint64_t *addr, - uint64_t data); -static void db_ddi_rep_get8(ddi_acc_impl_t *handle, uint8_t *host_addr, - uint8_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_get16(ddi_acc_impl_t *handle, uint16_t *host_addr, - uint16_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_get32(ddi_acc_impl_t *handle, uint32_t *host_addr, - uint32_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_get64(ddi_acc_impl_t *handle, uint64_t *host_addr, - uint64_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_put8(ddi_acc_impl_t *handle, uint8_t *host_addr, - uint8_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_put16(ddi_acc_impl_t *handle, uint16_t *host_addr, - uint16_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_put32(ddi_acc_impl_t *handle, uint32_t *host_addr, - uint32_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_put64(ddi_acc_impl_t *handle, uint64_t *host_addr, - uint64_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_put8(ddi_acc_impl_t *handle, uint8_t *addr, + uint8_t data); +static void db_ddi_put16(ddi_acc_impl_t *handle, uint16_t *addr, + uint16_t data); +static void db_ddi_put32(ddi_acc_impl_t *handle, uint32_t *addr, + uint32_t data); +static void db_ddi_put64(ddi_acc_impl_t *handle, uint64_t *addr, + uint64_t data); +static void db_ddi_rep_get8(ddi_acc_impl_t *handle, uint8_t *host_addr, + uint8_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_get16(ddi_acc_impl_t *handle, uint16_t *host_addr, + uint16_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_get32(ddi_acc_impl_t *handle, uint32_t *host_addr, + uint32_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_get64(ddi_acc_impl_t *handle, uint64_t *host_addr, + uint64_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_put8(ddi_acc_impl_t *handle, uint8_t *host_addr, + uint8_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_put16(ddi_acc_impl_t *handle, uint16_t *host_addr, + uint16_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_put32(ddi_acc_impl_t *handle, uint32_t *host_addr, + uint32_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_put64(ddi_acc_impl_t *handle, uint64_t *host_addr, + uint64_t *dev_addr, size_t repcount, uint_t flags); static struct dev_ops db_dev_ops = { DEVO_REV, /* devo_rev */ @@ -410,16 +410,16 @@ static struct modlinkage modlinkage = { }; /* soft state pointer and structure template. */ -static void *db_state; +static void *db_state; /* * forward function declarations: */ static void db_uninitchild(dev_info_t *); -static int db_initchild(dev_info_t *child); -static int db_create_pci_prop(dev_info_t *child); -static int db_save_config_regs(db_ctrl_t *dbp); -static int db_restore_config_regs(db_ctrl_t *dbp); +static int db_initchild(dev_info_t *child); +static int db_create_pci_prop(dev_info_t *child); +static int db_save_config_regs(db_ctrl_t *dbp); +static int db_restore_config_regs(db_ctrl_t *dbp); /* * FMA error callback @@ -675,7 +675,7 @@ db_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) if (ddi_create_minor_node(dip, name, S_IFCHR, PCIHP_AP_MINOR_NUM(instance, PCIHP_DEBUG_MINOR), - NULL, NULL) == DDI_FAILURE) { + NULL, 0) == DDI_FAILURE) { cmn_err(CE_NOTE, "%s#%d: node creation failure", ddi_driver_name(dbp->dip), instance); } @@ -1443,7 +1443,7 @@ db_close(dev_t dev, int flag, int otyp, cred_t *cred_p) /*ARGSUSED*/ static int db_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cred_p, - int *rval_p) + int *rval_p) { int rc = DDI_SUCCESS; #ifdef DB_DEBUG @@ -1698,15 +1698,15 @@ db_pci_get_conf_regs(ddi_acc_handle_t config_handle, db_conf_regs_t *cr) /* * Function: db_pci_map * - * Note: Only memory accesses are direct. IO could be direct - * or indirect. Config accesses are always indirect. - * The question here is, does the "assigned-addresses" - * property entry represents the addresses in the - * local domain or the host domain itself. - * Strictly speaking, the assumption should be that - * it is in the local domain, as the transactions - * upstream or downstream are automatically - * translated by the bridge chip anyway. + * Note: Only memory accesses are direct. IO could be direct + * or indirect. Config accesses are always indirect. + * The question here is, does the "assigned-addresses" + * property entry represents the addresses in the + * local domain or the host domain itself. + * Strictly speaking, the assumption should be that + * it is in the local domain, as the transactions + * upstream or downstream are automatically + * translated by the bridge chip anyway. * * Return values: * DDI_SUCCESS: map call by child device success @@ -1715,7 +1715,7 @@ db_pci_get_conf_regs(ddi_acc_handle_t config_handle, db_conf_regs_t *cr) static int db_pci_map(dev_info_t *dip, dev_info_t *rdip, ddi_map_req_t *mp, - off_t offset, off_t len, caddr_t *addrp) + off_t offset, off_t len, caddr_t *addrp) { register dev_info_t *pdip; int reg_proplen, num_regs, rnumber; @@ -2088,7 +2088,7 @@ char *db_ctlop_name[] = { static int db_ctlops(dev_info_t *dip, dev_info_t *rdip, - ddi_ctl_enum_t ctlop, void *arg, void *result) + ddi_ctl_enum_t ctlop, void *arg, void *result) { if ((ctlop >= DDI_CTLOPS_DMAPMAPC) && @@ -2865,7 +2865,7 @@ db_ddi_put64(ddi_acc_impl_t *handle, uint64_t *addr, uint64_t data) */ static void db_ddi_rep_get8(ddi_acc_impl_t *handle, uint8_t *host_addr, - uint8_t *dev_addr, size_t repcount, uint_t flags) + uint8_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2881,7 +2881,7 @@ db_ddi_rep_get8(ddi_acc_impl_t *handle, uint8_t *host_addr, */ static void db_ddi_rep_get16(ddi_acc_impl_t *handle, uint16_t *host_addr, - uint16_t *dev_addr, size_t repcount, uint_t flags) + uint16_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2897,7 +2897,7 @@ db_ddi_rep_get16(ddi_acc_impl_t *handle, uint16_t *host_addr, */ static void db_ddi_rep_get32(ddi_acc_impl_t *handle, uint32_t *host_addr, - uint32_t *dev_addr, size_t repcount, uint_t flags) + uint32_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2913,7 +2913,7 @@ db_ddi_rep_get32(ddi_acc_impl_t *handle, uint32_t *host_addr, */ static void db_ddi_rep_get64(ddi_acc_impl_t *handle, uint64_t *host_addr, - uint64_t *dev_addr, size_t repcount, uint_t flags) + uint64_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2929,7 +2929,7 @@ db_ddi_rep_get64(ddi_acc_impl_t *handle, uint64_t *host_addr, */ static void db_ddi_rep_put8(ddi_acc_impl_t *handle, uint8_t *host_addr, - uint8_t *dev_addr, size_t repcount, uint_t flags) + uint8_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2945,7 +2945,7 @@ db_ddi_rep_put8(ddi_acc_impl_t *handle, uint8_t *host_addr, */ static void db_ddi_rep_put16(ddi_acc_impl_t *handle, uint16_t *host_addr, - uint16_t *dev_addr, size_t repcount, uint_t flags) + uint16_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2961,7 +2961,7 @@ db_ddi_rep_put16(ddi_acc_impl_t *handle, uint16_t *host_addr, */ static void db_ddi_rep_put32(ddi_acc_impl_t *handle, uint32_t *host_addr, - uint32_t *dev_addr, size_t repcount, uint_t flags) + uint32_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2977,7 +2977,7 @@ db_ddi_rep_put32(ddi_acc_impl_t *handle, uint32_t *host_addr, */ static void db_ddi_rep_put64(ddi_acc_impl_t *handle, uint64_t *host_addr, - uint64_t *dev_addr, size_t repcount, uint_t flags) + uint64_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2991,7 +2991,7 @@ db_ddi_rep_put64(ddi_acc_impl_t *handle, uint64_t *host_addr, static void db_debug(uint64_t func_id, dev_info_t *dip, char *fmt, - uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5) + uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5) { char *s = NULL; uint_t dip_no_disp = 0; @@ -3097,7 +3097,7 @@ db_fm_fini(db_ctrl_t *db_p) /*ARGSUSED*/ static int db_fm_init_child(dev_info_t *dip, dev_info_t *tdip, int cap, - ddi_iblock_cookie_t *ibc) + ddi_iblock_cookie_t *ibc) { db_ctrl_t *db_p = (db_ctrl_t *)ddi_get_soft_state(db_state, ddi_get_instance(dip)); diff --git a/usr/src/uts/sun4u/io/pic16f747.c b/usr/src/uts/sun4u/io/pic16f747.c index 011a8974d0..0a8a4d398c 100644 --- a/usr/src/uts/sun4u/io/pic16f747.c +++ b/usr/src/uts/sun4u/io/pic16f747.c @@ -220,7 +220,7 @@ pic_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) (void) sprintf(name, "env-monitor%d", inst); minor = PIC_INST_TO_MINOR(inst) | PIC_UNIT_TO_MINOR(0); if (ddi_create_minor_node(dip, name, S_IFCHR, minor, - DDI_PSEUDO, NULL) == DDI_FAILURE) { + DDI_PSEUDO, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "ddi_create_minor_node() failed for inst %d\n", inst); @@ -261,7 +261,7 @@ pic_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) minor_name = pic_nodes[i].minor_name; minor = PIC_INST_TO_MINOR(inst) | PIC_UNIT_TO_MINOR(i); if (ddi_create_minor_node(dip, minor_name, S_IFCHR, - minor, PICDEV_NODE_TYPE, NULL) == DDI_FAILURE) { + minor, PICDEV_NODE_TYPE, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s:%d ddi_create_minor_node failed", ddi_driver_name(dip), inst); diff --git a/usr/src/uts/sun4u/io/rmc_comm_drvintf.c b/usr/src/uts/sun4u/io/rmc_comm_drvintf.c index 6c173379e0..58fd2db8eb 100644 --- a/usr/src/uts/sun4u/io/rmc_comm_drvintf.c +++ b/usr/src/uts/sun4u/io/rmc_comm_drvintf.c @@ -360,13 +360,13 @@ rmc_comm_send_req_resp(struct rmc_comm_state *rcs, rmc_comm_msg_t *request, if (response != NULL) { exp_resp->msg_type = response->msg_type; exp_resp->msg_buf = (uint8_t *)response->msg_buf; - exp_resp->msg_msglen = (uint16_t)response->msg_bytes; - exp_resp->msg_bufsiz = (uint16_t)response->msg_len; + exp_resp->msg_msglen = response->msg_bytes; + exp_resp->msg_bufsiz = response->msg_len; } else { exp_resp->msg_type = DP_NULL_MSG; - exp_resp->msg_buf = (uint8_t)NULL; - exp_resp->msg_bufsiz = (uint16_t)0; - exp_resp->msg_msglen = (uint16_t)0; + exp_resp->msg_buf = NULL; + exp_resp->msg_bufsiz = 0; + exp_resp->msg_msglen = 0; } /* @@ -374,7 +374,7 @@ rmc_comm_send_req_resp(struct rmc_comm_state *rcs, rmc_comm_msg_t *request, */ req.msg_type = request->msg_type; req.msg_buf = (uint8_t *)request->msg_buf; - req.msg_msglen = (uint16_t)request->msg_len; + req.msg_msglen = request->msg_len; /* * send the message and wait for the reply or ACKnowledgment @@ -636,7 +636,7 @@ int rmc_comm_reg_intr(uint8_t msg_type, rmc_comm_intrfunc_t intr_handler, rmc_comm_msg_t *msgbuf, uint_t *state, kmutex_t *lock) { - struct rmc_comm_state *rcs; + struct rmc_comm_state *rcs; dp_msg_intr_t *msgintr; int err = RCNOERR; diff --git a/usr/src/uts/sun4u/io/rmclomv.c b/usr/src/uts/sun4u/io/rmclomv.c index 13c10e3a01..9d00fdd6fb 100644 --- a/usr/src/uts/sun4u/io/rmclomv.c +++ b/usr/src/uts/sun4u/io/rmclomv.c @@ -399,7 +399,7 @@ rmclomv_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) return (DDI_FAILURE); err = ddi_create_minor_node(dip, "rmclomv", S_IFCHR, - instance, DDI_PSEUDO, NULL); + instance, DDI_PSEUDO, 0); if (err != DDI_SUCCESS) return (DDI_FAILURE); @@ -1621,7 +1621,7 @@ refresh_name_cache(int force_fail) if (retval == 0) { retval = rmclomv_do_cmd(DP_GET_SYSINFO, DP_GET_SYSINFO_R, - sizeof (sysinfo), NULL, (intptr_t)&sysinfo); + sizeof (sysinfo), (intptr_t)NULL, (intptr_t)&sysinfo); } if (retval == 0) { fru_cmd.handle = DP_NULL_HANDLE; @@ -2896,7 +2896,7 @@ rmclomv_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cred_p, case ENVMONIOCCHASSISSERIALNUM: retval = rmclomv_do_cmd(DP_GET_SDP_VERSION, DP_GET_SDP_VERSION_R, sizeof (rmc_sdpver_r), - NULL, (intptr_t)&rmc_sdpver_r); + (intptr_t)NULL, (intptr_t)&rmc_sdpver_r); if (retval != 0) { cmn_err(CE_WARN, "DP_GET_SDP_VERSION failed, ret=%d\n", @@ -2908,7 +2908,7 @@ rmclomv_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cred_p, } retval = rmclomv_do_cmd(DP_GET_CHASSIS_SERIALNUM, DP_GET_CHASSIS_SERIALNUM_R, sizeof (rmc_serialnum_r), - NULL, (intptr_t)&rmc_serialnum_r); + (intptr_t)NULL, (intptr_t)&rmc_serialnum_r); if (retval != 0) { break; @@ -2940,7 +2940,7 @@ rmclomv_checkrmc(caddr_t arg) int err; int retries; int state; - dp_get_sysinfo_r_t sysinfo; + dp_get_sysinfo_r_t sysinfo; CALLB_CPR_INIT(&cprinfo, &rmclomv_checkrmc_lock, callb_generic_cpr, "rmclomv_checkrmc"); @@ -3005,7 +3005,7 @@ rmclomv_checkrmc(caddr_t arg) mutex_exit(&rmclomv_checkrmc_lock); err = rmclomv_do_cmd(DP_GET_SYSINFO, DP_GET_SYSINFO_R, - sizeof (sysinfo), NULL, (intptr_t)&sysinfo); + sizeof (sysinfo), (intptr_t)NULL, (intptr_t)&sysinfo); if (err == 0) { mutex_enter(&rmclomv_state_lock); state = rmclomv_rmc_state; @@ -3393,7 +3393,7 @@ plat_timesync(void *arg) if (arg != NULL) { /* Request the time from the RMC clock. */ retval = rmclomv_do_cmd(DP_GET_DATE_TIME, DP_GET_DATE_TIME_R, - DATE_TIME_MSG_SIZE, NULL, (intptr_t)&buffer); + DATE_TIME_MSG_SIZE, (intptr_t)NULL, (intptr_t)&buffer); /* * If we were able to get the time lets set the local clock. diff --git a/usr/src/uts/sun4u/io/todds1287.c b/usr/src/uts/sun4u/io/todds1287.c index 35dc7ad8fc..bf9cb8bd42 100644 --- a/usr/src/uts/sun4u/io/todds1287.c +++ b/usr/src/uts/sun4u/io/todds1287.c @@ -176,7 +176,7 @@ static ddi_softintr_t ds1287_softintr_id; static kmutex_t ds1287_reg_mutex; /* Protects ds1287 Registers */ static struct modldrv modldrv = { - &mod_driverops, /* Type of module. This one is a driver */ + &mod_driverops, /* Type of module. This one is a driver */ "ds1287 clock driver", /* Name of the module. */ &ds1287_ops, /* driver ops */ }; @@ -354,7 +354,7 @@ ds1287_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) * creating the minor node. */ if (ddi_create_minor_node(dip, "power_button", S_IFCHR, - (instance << 8) + 0, "ddi_power_button", NULL) == DDI_FAILURE) { + (instance << 8) + 0, "ddi_power_button", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "ds1287_attach: Failed to create minor node"); goto error3; } @@ -453,7 +453,7 @@ ds1287_close(dev_t dev, int flags, int otyp, cred_t *credp) /*ARGSUSED4*/ static int ds1287_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, - cred_t *credp, int *rvalp) + cred_t *credp, int *rvalp) { struct ds1287 *softsp; int clone; diff --git a/usr/src/uts/sun4u/io/todds1337.c b/usr/src/uts/sun4u/io/todds1337.c index 319928bde7..4688467769 100644 --- a/usr/src/uts/sun4u/io/todds1337.c +++ b/usr/src/uts/sun4u/io/todds1337.c @@ -67,8 +67,8 @@ static uint_t todds1337_set_watchdog_timer(uint_t); static uint_t todds1337_clear_watchdog_timer(void); static void todds1337_set_power_alarm(timestruc_t); static void todds1337_clear_power_alarm(void); -static int todds1337_setup_prom(); -static void todds1337_rele_prom(); +static int todds1337_setup_prom(void); +static void todds1337_rele_prom(void); static int todds1337_prom_getdate(struct rtc_t *rtc); static int todds1337_prom_setdate(struct rtc_t *rtc); @@ -90,7 +90,7 @@ static ihandle_t todds1337_ihandle = 0; #define I2C_CYCLIC_TIMEOUT 1000000000 uint_t i2c_cyclic_timeout = I2C_CYCLIC_TIMEOUT; static int sync_clock_once = 1; -static struct rtc_t soft_rtc; +static struct rtc_t soft_rtc; /* * cp_ops structure @@ -898,7 +898,7 @@ todds1337_getinfo(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg, * execute the get-time method */ static int -todds1337_setup_prom() +todds1337_setup_prom(void) { pnode_t todnode; char tod1337_devpath[MAXNAMELEN]; @@ -920,7 +920,7 @@ todds1337_setup_prom() /* * Now open the node and store it's ihandle */ - if ((todds1337_ihandle = prom_open(tod1337_devpath)) == NULL) { + if ((todds1337_ihandle = prom_open(tod1337_devpath)) == 0) { cmn_err(CE_WARN, "prom_open failed"); return (DDI_FAILURE); } @@ -932,7 +932,7 @@ todds1337_setup_prom() * Closes the prom interface */ static void -todds1337_rele_prom() +todds1337_rele_prom(void) { (void) prom_close(todds1337_ihandle); } @@ -958,7 +958,7 @@ todds1337_prom_getdate(struct rtc_t *rtc) (void) p1275_cif_handler(&ci); promif_postprom(); - year = p1275_cell2int(ci[6]); + year = p1275_cell2int(ci[6]); rtc->rtc_mon = p1275_cell2int(ci[7]); rtc->rtc_dom = p1275_cell2int(ci[8]); rtc->rtc_dow = 0; diff --git a/usr/src/uts/sun4u/littleneck/Makefile b/usr/src/uts/sun4u/littleneck/Makefile index 134c28b1d8..c6c7ba37e0 100644 --- a/usr/src/uts/sun4u/littleneck/Makefile +++ b/usr/src/uts/sun4u/littleneck/Makefile @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of all Littleneck system # dependent modules for the sun4u architecture. # @@ -45,12 +43,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -58,11 +52,9 @@ check := TARGET= check # .KEEP_STATE: -def all clean.lint clean clobber modlist: $(LITTLENECK_KMODS) - -modlintlib: $(LITTLENECK_KMODS) +def all clean clobber modlist: $(LITTLENECK_KMODS) -install: $(ROOT_LITTLENECK_DIR) $(USR_LITTLENECK_DIR) \ +install: $(ROOT_LITTLENECK_DIR) $(USR_LITTLENECK_DIR) \ $(USR_LITTLENECK_INC_DIR) \ $(USR_LITTLENECK_SBIN_DIR) \ $(USR_LITTLENECK_LIB_DIR) \ @@ -71,18 +63,6 @@ install: $(ROOT_LITTLENECK_DIR) $(USR_LITTLENECK_DIR) \ install_h check: -lint: modlintlib - -LINT_LIBS = $(LINT_LIB) \ - -L$(LITTLENECK_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nLittleneck Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(LITTLENECK_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/littleneck/io/pcf8574_lneck.c b/usr/src/uts/sun4u/littleneck/io/pcf8574_lneck.c index 8b0bcd007e..767d2a4f24 100644 --- a/usr/src/uts/sun4u/littleneck/io/pcf8574_lneck.c +++ b/usr/src/uts/sun4u/littleneck/io/pcf8574_lneck.c @@ -229,18 +229,18 @@ pcf8574_close(dev_t dev, int flags, int otyp, cred_t *credp) } static int -pcf8574_get(struct pcf8574_unit *unitp, uchar_t *byte) { +pcf8574_get(struct pcf8574_unit *unitp, uchar_t *byte) +{ i2c_transfer_t *i2c_tran_pointer; int err = I2C_SUCCESS; D1CMN_ERR((CE_WARN, "Entered the pcf8574_get routine\n")); (void) i2c_transfer_alloc(unitp->pcf8574_hdl, &i2c_tran_pointer, - 0, 1, I2C_SLEEP); + 0, 1, I2C_SLEEP); if (i2c_tran_pointer == NULL) { D2CMN_ERR((CE_WARN, "%s: Failed in pcf8574_get " - "i2c_tran_pointer not allocated\n", - unitp->pcf8574_name)); + "i2c_tran_pointer not allocated\n", unitp->pcf8574_name)); return (ENOMEM); } @@ -249,13 +249,13 @@ pcf8574_get(struct pcf8574_unit *unitp, uchar_t *byte) { err = i2c_transfer(unitp->pcf8574_hdl, i2c_tran_pointer); if (err) { D2CMN_ERR((CE_WARN, "%s: Failed in the i2c_transfer routine\n", - unitp->pcf8574_name)); + unitp->pcf8574_name)); i2c_transfer_free(unitp->pcf8574_hdl, i2c_tran_pointer); return (err); } D1CMN_ERR((CE_WARN, "Back from a transfer value is %x\n", - i2c_tran_pointer->i2c_rbuf[0])); + i2c_tran_pointer->i2c_rbuf[0])); *byte = i2c_tran_pointer->i2c_rbuf[0]; i2c_transfer_free(unitp->pcf8574_hdl, i2c_tran_pointer); @@ -263,16 +263,17 @@ pcf8574_get(struct pcf8574_unit *unitp, uchar_t *byte) { } static int -pcf8574_set(struct pcf8574_unit *unitp, uchar_t byte) { +pcf8574_set(struct pcf8574_unit *unitp, uchar_t byte) +{ i2c_transfer_t *i2c_tran_pointer; int err = I2C_SUCCESS; (void) i2c_transfer_alloc(unitp->pcf8574_hdl, &i2c_tran_pointer, - 1, 0, I2C_SLEEP); + 1, 0, I2C_SLEEP); if (i2c_tran_pointer == NULL) { D2CMN_ERR((CE_WARN, "%s: Failed in pcf8574_set " - "i2c_tran_pointer not allocated\n", - unitp->pcf8574_name)); + "i2c_tran_pointer not allocated\n", + unitp->pcf8574_name)); return (ENOMEM); } @@ -280,13 +281,12 @@ pcf8574_set(struct pcf8574_unit *unitp, uchar_t byte) { i2c_tran_pointer->i2c_wbuf[0] = byte; D1CMN_ERR((CE_NOTE, "%s: contains %x\n", unitp->pcf8574_name, - i2c_tran_pointer->i2c_wbuf[0])); + i2c_tran_pointer->i2c_wbuf[0])); err = i2c_transfer(unitp->pcf8574_hdl, i2c_tran_pointer); if (err) { D2CMN_ERR((CE_WARN, "%s: Failed in the pcf8574_set" - " i2c_transfer routine\n", - unitp->pcf8574_name)); + " i2c_transfer routine\n", unitp->pcf8574_name)); i2c_transfer_free(unitp->pcf8574_hdl, i2c_tran_pointer); return (err); } @@ -296,7 +296,7 @@ pcf8574_set(struct pcf8574_unit *unitp, uchar_t byte) { static int pcf8574_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, - cred_t *credp, int *rvalp) + cred_t *credp, int *rvalp) { _NOTE(ARGUNUSED(credp, rvalp)) struct pcf8574_unit *unitp; @@ -306,7 +306,7 @@ pcf8574_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, i2c_port_t ioctl_port; uchar_t byte; - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "PCF8574: ioctl: arg passed in to ioctl " "= NULL\n")); err = EINVAL; @@ -523,7 +523,7 @@ pcf8574_do_attach(dev_info_t *dip) if (ddi_create_minor_node(dip, "pcf8574", S_IFCHR, instance, - "ddi_i2c:ioexp", NULL) == DDI_FAILURE) { + "ddi_i2c:ioexp", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s ddi_create_minor_node failed for " "%s\n", unitp->pcf8574_name, "pcf8574"); ddi_soft_state_free(pcf8574soft_statep, instance); diff --git a/usr/src/uts/sun4u/littleneck/os/littleneck.c b/usr/src/uts/sun4u/littleneck/os/littleneck.c index cb299c8117..9a048efc20 100644 --- a/usr/src/uts/sun4u/littleneck/os/littleneck.c +++ b/usr/src/uts/sun4u/littleneck/os/littleneck.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/param.h> #include <sys/systm.h> #include <sys/sunddi.h> @@ -51,7 +49,7 @@ int (*p2get_mem_unum)(int, uint64_t, char *, int, int *); void startup_platform(void) { - mutex_init(&lneck_pcf8584_mutex, NULL, NULL, NULL); + mutex_init(&lneck_pcf8584_mutex, NULL, MUTEX_ADAPTIVE, NULL); } int @@ -149,7 +147,7 @@ plat_get_mem_unum(int synd_code, uint64_t flt_addr, int flt_bus_id, { if (flt_in_memory && (p2get_mem_unum != NULL)) return (p2get_mem_unum(synd_code, P2ALIGN(flt_addr, 8), - buf, buflen, lenp)); + buf, buflen, lenp)); else return (ENOTSUP); } diff --git a/usr/src/uts/sun4u/mpxu/Makefile b/usr/src/uts/sun4u/mpxu/Makefile index e7170e8e2d..6014c8761e 100644 --- a/usr/src/uts/sun4u/mpxu/Makefile +++ b/usr/src/uts/sun4u/mpxu/Makefile @@ -45,12 +45,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -58,11 +54,7 @@ check := TARGET= check # .KEEP_STATE: -def all clean clean.lint clobber modlist: $(MPXU_KMODS) $(CLOSED_MPXU_KMODS) - -lintlib: unix - -modlintlib: $(MPXU_KMODS) $(CLOSED_MPXU_KMODS) +def all clean clobber modlist: $(MPXU_KMODS) $(CLOSED_MPXU_KMODS) IMPLEMENTED_PLATFORM = SUNW,Sun-Fire-V240 @@ -95,19 +87,6 @@ $(MPXU_CRYPTO_LINKS): $(ROOT_MPXU_CRYPTO_DIR_64) install_h check: FRC @cd sys; pwd; $(MAKE) $(TARGET) - -lint: modlintlib - -LINT_LIBS = $(LINT_LIB) \ - -L$(MPXU_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nMPXU Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - # # # Include common targets. diff --git a/usr/src/uts/sun4u/mpxu/io/tsalarm.c b/usr/src/uts/sun4u/mpxu/io/tsalarm.c index 7c56f1d63f..819c44a0a6 100644 --- a/usr/src/uts/sun4u/mpxu/io/tsalarm.c +++ b/usr/src/uts/sun4u/mpxu/io/tsalarm.c @@ -211,7 +211,7 @@ tsalarm_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) * the device's softc, is used to direct peculiar behavior. */ if (ddi_create_minor_node(dip, "lom", S_IFCHR, 0, - DDI_PSEUDO, NULL) == DDI_FAILURE) + DDI_PSEUDO, 0) == DDI_FAILURE) goto attach_failed; ddi_report_dev(dip); @@ -288,7 +288,7 @@ tsalarm_close(dev_t dev, int flag, int otyp, cred_t *credp) /* ARGSUSED */ static int tsalarm_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, - cred_t *credp, int *rvalp) + cred_t *credp, int *rvalp) { int inst = getminor(dev); struct tsalarm_softc *softc; diff --git a/usr/src/uts/sun4u/ngdr/io/dr.c b/usr/src/uts/sun4u/ngdr/io/dr.c index e89ea0b05e..73b1528c7e 100644 --- a/usr/src/uts/sun4u/ngdr/io/dr.c +++ b/usr/src/uts/sun4u/ngdr/io/dr.c @@ -556,7 +556,7 @@ int dr_enable = 1; /*ARGSUSED3*/ static int dr_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, - cred_t *cred_p, int *rval_p) + cred_t *cred_p, int *rval_p) { int rv = 0; int instance; @@ -706,7 +706,7 @@ dr_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) { int rv, rv2; int bd; - int instance; + int instance; sbd_error_t *err; dr_softstate_t *softsp; @@ -768,7 +768,7 @@ dr_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) minor_num = DR_MAKE_MINOR(instance, bd); rv = ddi_create_minor_node(dip, name, S_IFCHR, - minor_num, DDI_NT_SBD_ATTACHMENT_POINT, NULL); + minor_num, DDI_NT_SBD_ATTACHMENT_POINT, 0); if (rv != DDI_SUCCESS) rv = DDI_FAILURE; } @@ -806,7 +806,7 @@ dr_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) static int dr_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) { - int instance; + int instance; dr_softstate_t *softsp; switch (cmd) { @@ -1293,7 +1293,8 @@ dr_test_board(dr_handle_t *hp) * devlists for the board have been initialized. */ static void -dr_make_comp_nodes(dr_board_t *bp) { +dr_make_comp_nodes(dr_board_t *bp) +{ int i; @@ -1580,7 +1581,7 @@ dr_dev_is_target(dr_dev_unit_t *dp, int present_only, uint_t uset) static void dr_dev_make_list(dr_handle_t *hp, sbd_comp_type_t type, int present_only, - dr_common_unit_t ***devlist, int *devnum) + dr_common_unit_t ***devlist, int *devnum) { dr_board_t *bp = hp->h_bd; int unum; @@ -1702,10 +1703,10 @@ dr_dev_clean_up(dr_handle_t *hp, dr_common_unit_t **list, int devnum) static int dr_dev_walk(dr_handle_t *hp, sbd_comp_type_t type, int present_only, - int (*pre_op)(dr_handle_t *, dr_common_unit_t **, int), - void (*op)(dr_handle_t *, dr_common_unit_t *), - int (*post_op)(dr_handle_t *, dr_common_unit_t **, int), - void (*board_op)(dr_handle_t *, dr_common_unit_t **, int)) + int (*pre_op)(dr_handle_t *, dr_common_unit_t **, int), + void (*op)(dr_handle_t *, dr_common_unit_t *), + int (*post_op)(dr_handle_t *, dr_common_unit_t **, int), + void (*board_op)(dr_handle_t *, dr_common_unit_t **, int)) { int devnum, rv; dr_common_unit_t **devlist; @@ -1740,7 +1741,7 @@ dr_dev_noop(dr_handle_t *hp, dr_common_unit_t **devlist, int devnum) static void dr_attach_update_state(dr_handle_t *hp, - dr_common_unit_t **devlist, int devnum) + dr_common_unit_t **devlist, int devnum) { dr_board_t *bp = hp->h_bd; int i; @@ -1841,7 +1842,7 @@ dr_dev_configure(dr_handle_t *hp) static void dr_release_update_state(dr_handle_t *hp, - dr_common_unit_t **devlist, int devnum) + dr_common_unit_t **devlist, int devnum) { _NOTE(ARGUNUSED(devlist)) _NOTE(ARGUNUSED(devnum)) @@ -1965,7 +1966,7 @@ dr_dev_release(dr_handle_t *hp) static void dr_detach_update_state(dr_handle_t *hp, - dr_common_unit_t **devlist, int devnum) + dr_common_unit_t **devlist, int devnum) { dr_board_t *bp = hp->h_bd; int i; @@ -2686,7 +2687,7 @@ dr_nt_to_dev_type(int nt) */ static int dr_check_transition(dr_board_t *bp, dr_devset_t *devsetp, - struct dr_state_trans *transp, int cmd) + struct dr_state_trans *transp, int cmd) { int s, ut; int state_err = 0; diff --git a/usr/src/uts/sun4u/opl/io/dm2s.c b/usr/src/uts/sun4u/opl/io/dm2s.c index 92735d9981..1e6a1f9fc0 100644 --- a/usr/src/uts/sun4u/opl/io/dm2s.c +++ b/usr/src/uts/sun4u/opl/io/dm2s.c @@ -177,8 +177,8 @@ struct streamtab dm2s_streamtab = { NULL }; -DDI_DEFINE_STREAM_OPS(dm2s_ops, nulldev, nulldev, dm2s_attach, \ - dm2s_detach, nodev, dm2s_info, D_NEW | D_MP | D_MTPERMOD, \ +DDI_DEFINE_STREAM_OPS(dm2s_ops, nulldev, nulldev, dm2s_attach, + dm2s_detach, nodev, dm2s_info, D_NEW | D_MP | D_MTPERMOD, &dm2s_streamtab, ddi_quiesce_not_supported); @@ -296,7 +296,7 @@ dm2s_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) (void) sprintf(name, "%s%d", DM2S_MODNAME, instance); if (ddi_create_minor_node(dip, name, S_IFCHR, instance, - DDI_PSEUDO, NULL) == DDI_FAILURE) { + DDI_PSEUDO, 0) == DDI_FAILURE) { ddi_remove_minor_node(dip, NULL); cmn_err(CE_WARN, "Device node creation failed."); goto error; diff --git a/usr/src/uts/sun4u/opl/io/drmach.c b/usr/src/uts/sun4u/opl/io/drmach.c index 0999f18e15..651b60d8ba 100644 --- a/usr/src/uts/sun4u/opl/io/drmach.c +++ b/usr/src/uts/sun4u/opl/io/drmach.c @@ -218,14 +218,14 @@ static int drmach_node_ddi_get_prop(drmach_node_t *np, static int drmach_node_ddi_get_proplen(drmach_node_t *np, char *name, int *len); -static int drmach_get_portid(drmach_node_t *); +static int drmach_get_portid(drmach_node_t *); static sbd_error_t *drmach_i_status(drmachid_t, drmach_status_t *); static int opl_check_dr_status(); static void drmach_io_dispose(drmachid_t); static sbd_error_t *drmach_io_release(drmachid_t); static sbd_error_t *drmach_io_status(drmachid_t, drmach_status_t *); -static int drmach_init(void); -static void drmach_fini(void); +static int drmach_init(void); +static void drmach_fini(void); static void drmach_swap_pa(drmach_mem_t *, drmach_mem_t *); static drmach_board_t *drmach_get_board_by_bnum(int); @@ -457,7 +457,7 @@ struct drmach_hotcpu { drmach_board_t *bp; int bnum; int core_id; - int rv; + int rv; int option; }; @@ -652,7 +652,7 @@ drmach_setup_core_info(drmach_board_t *obj) typedef struct { drmach_node_walk_args_t *nwargs; - int (*cb)(drmach_node_walk_args_t *args); + int (*cb)(drmach_node_walk_args_t *args); int err; } drmach_node_ddi_walk_args_t; @@ -686,7 +686,7 @@ drmach_node_ddi_walk_cb(dev_info_t *dip, void *arg) static int drmach_node_ddi_walk(drmach_node_t *np, void *data, - int (*cb)(drmach_node_walk_args_t *args)) + int (*cb)(drmach_node_walk_args_t *args)) { drmach_node_walk_args_t args; drmach_node_ddi_walk_args_t nargs; @@ -735,7 +735,7 @@ drmach_node_ddi_get_parent(drmach_node_t *np, drmach_node_t *pp) static pnode_t drmach_node_ddi_get_dnode(drmach_node_t *np) { - return ((pnode_t)NULL); + return (0); } static drmach_node_t * @@ -769,7 +769,7 @@ drmach_node_ddi_get_dip(drmach_node_t *np) static int drmach_node_walk(drmach_node_t *np, void *param, - int (*cb)(drmach_node_walk_args_t *args)) + int (*cb)(drmach_node_walk_args_t *args)) { return (np->walk(np, param, cb)); } @@ -977,7 +977,7 @@ drmach_configure(drmachid_t id, int flags) static sbd_error_t * drmach_device_new(drmach_node_t *node, - drmach_board_t *bp, int portid, drmachid_t *idp) + drmach_board_t *bp, int portid, drmachid_t *idp) { int i; int rv; @@ -1541,7 +1541,7 @@ drmach_get_portid(drmach_node_t *np) static int drmach_name2type_idx(char *name) { - int index, ntypes; + int index, ntypes; if (name == NULL) return (-1); @@ -1656,7 +1656,7 @@ drmach_board_find_devices_cb(drmach_node_walk_args_t *args) sbd_error_t * drmach_board_find_devices(drmachid_t id, void *a, - sbd_error_t *(*found)(void *a, const char *, int, drmachid_t)) + sbd_error_t *(*found)(void *a, const char *, int, drmachid_t)) { drmach_board_t *bp = (drmach_board_t *)id; sbd_error_t *err; @@ -2782,7 +2782,7 @@ drmach_cpu_poweron(struct cpu *cp) int drmach_cpu_poweroff(struct cpu *cp) { - int rv = 0; + int rv = 0; processorid_t cpuid = cp->cpu_id; DRMACH_PR("drmach_cpu_poweroff: stopping cpuid %d\n", cp->cpu_id); @@ -2957,7 +2957,7 @@ opl_check_dr_status() static struct memlist * drmach_memlist_add_span(drmach_copy_rename_program_t *p, - struct memlist *mlist, uint64_t base, uint64_t len) + struct memlist *mlist, uint64_t base, uint64_t len) { struct memlist *ml, *tl, *nl; @@ -3072,7 +3072,7 @@ static int fmem_timeout = 17; /* * The empirical data on some OPL system shows that * we can copy 250 MB per second. We set it to - * 80 MB to be conservative. In normal case, + * 80 MB to be conservative. In normal case, * this timeout does not affect anything. */ @@ -3113,7 +3113,7 @@ static int drmach_copy_rename_timeout = 500; static int drmach_copy_rename_prog__relocatable(drmach_copy_rename_program_t *prog, - int cpuid) + int cpuid) { struct memlist *ml; register int rtn; @@ -3412,7 +3412,7 @@ drmach_unlock_critical(caddr_t va) sbd_error_t * drmach_copy_rename_init(drmachid_t t_id, drmachid_t s_id, - struct memlist *c_ml, drmachid_t *pgm_id) + struct memlist *c_ml, drmachid_t *pgm_id) { drmach_mem_t *s_mem; drmach_mem_t *t_mem; @@ -3690,7 +3690,7 @@ drmach_copy_rename_init(drmachid_t t_id, drmachid_t s_id, /* * max_elms - max number of memlist structures that - * may be allocated for the CPU memory list. + * may be allocated for the CPU memory list. * If there are too many memory span (because * of fragmentation) than number of memlist * available, we should return error. @@ -4042,7 +4042,7 @@ drmach_copy_rename(drmachid_t id) prog->critical->scf_reg_base = (*prog->data->scf_get_base_addr)(); if (prog->critical->scf_reg_base == (uint64_t)-1 || - prog->critical->scf_reg_base == NULL) { + prog->critical->scf_reg_base == 0) { prog->data->fmem_status.error = EOPL_FMEM_SCF_ERR; drmach_unlock_critical((caddr_t)prog); return; diff --git a/usr/src/uts/sun4u/opl/io/mc-opl.c b/usr/src/uts/sun4u/opl/io/mc-opl.c index 7d267110da..2ed14e6d22 100644 --- a/usr/src/uts/sun4u/opl/io/mc-opl.c +++ b/usr/src/uts/sun4u/opl/io/mc-opl.c @@ -607,12 +607,12 @@ mc_close(dev_t devp, int flag, int otyp, cred_t *credp) /* ARGSUSED */ static int mc_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { mc_flt_page_t flt_page; if (cmd == MCIOC_FAULT_PAGE) { - if (arg == NULL) + if (arg == (intptr_t)NULL) return (EINVAL); if (ddi_copyin((const void *)arg, (void *)&flt_page, @@ -1986,7 +1986,7 @@ mc_error_handler_mir(mc_opl_t *mcp, int bank, mc_rsaddr_info_t *rsaddr) } static int mc_process_error(mc_opl_t *mcp, int bank, mc_aflt_t *mc_aflt, - mc_flt_stat_t *flt_stat) + mc_flt_stat_t *flt_stat) { int ptrl_error = mc_aflt->mflt_is_ptrl; int rv = 0; @@ -2981,7 +2981,7 @@ mc_opl_get_physical_board(int sb) /* ARGSUSED */ int mc_get_mem_unum(int synd_code, uint64_t flt_addr, char *buf, int buflen, - int *lenp) + int *lenp) { int i; int j; @@ -4019,7 +4019,7 @@ mc_dump_dimm_info(board_dimm_info_t *bd_dimmp) /* ARGSUSED */ static int mc_ioctl_debug(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { caddr_t buf, kbuf; uint64_t pa; diff --git a/usr/src/uts/sun4u/opl/io/oplkmdrv.c b/usr/src/uts/sun4u/opl/io/oplkmdrv.c index be026a7c80..c2dfee332c 100644 --- a/usr/src/uts/sun4u/opl/io/oplkmdrv.c +++ b/usr/src/uts/sun4u/opl/io/oplkmdrv.c @@ -241,7 +241,7 @@ okm_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) */ okmsp->km_clean |= OKM_CLEAN_NODE; if (ddi_create_minor_node(dip, OKM_NODENAME, S_IFCHR, - instance, NULL, NULL) == DDI_FAILURE) { + instance, NULL, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "Device node creation failed"); okm_cleanup(okmsp); return (DDI_FAILURE); diff --git a/usr/src/uts/sun4u/opl/io/oplmsu/oplmsu.c b/usr/src/uts/sun4u/opl/io/oplmsu/oplmsu.c index 4037644c39..dd1ed50fdb 100644 --- a/usr/src/uts/sun4u/opl/io/oplmsu/oplmsu.c +++ b/usr/src/uts/sun4u/opl/io/oplmsu/oplmsu.c @@ -660,7 +660,7 @@ oplmsu_close(queue_t *urq, int flag, cred_t *cred_p) cmn_err(CE_WARN, "oplmsu: close: node_flag = 0x%lx", node_flag); } - ctrl->minor = NULL; + ctrl->minor = 0; ctrl->queue = NULL; wbuf_id = ctrl->wbuf_id; wtout_id = ctrl->wtout_id; diff --git a/usr/src/uts/sun4u/opl/io/pcicmu/pcmu_counters.c b/usr/src/uts/sun4u/opl/io/pcicmu/pcmu_counters.c index baa214a87e..edc92c1228 100644 --- a/usr/src/uts/sun4u/opl/io/pcicmu/pcmu_counters.c +++ b/usr/src/uts/sun4u/opl/io/pcicmu/pcmu_counters.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/async.h> #include <sys/sunddi.h> @@ -56,7 +54,7 @@ pcmu_create_name_kstat(char *name, pcmu_ksinfo_t *pp, pcmu_kev_mask_t *ev) for (i = 0; i < NUM_OF_PICS; i++) { pp->pic_name_ksp[i] = pcmu_create_picN_kstat(name, - i, pp->pic_shift[i], pp->pic_no_evs, ev); + i, pp->pic_shift[i], pp->pic_no_evs, ev); if (pp->pic_name_ksp[i] == NULL) { cmn_err(CE_WARN, "pci: unable to create name kstat"); @@ -85,7 +83,7 @@ pcmu_delete_name_kstat(pcmu_ksinfo_t *pp) */ static kstat_t * pcmu_create_picN_kstat(char *mod_name, int pic, int pic_shift, - int num_ev, pcmu_kev_mask_t *ev_array) + int num_ev, pcmu_kev_mask_t *ev_array) { struct kstat_named *pic_named_data; int inst = 0; @@ -95,9 +93,9 @@ pcmu_create_picN_kstat(char *mod_name, int pic, int pic_shift, (void) sprintf(pic_name, "pic%d", pic); if ((picN_ksp = kstat_create(mod_name, inst, pic_name, - "bus", KSTAT_TYPE_NAMED, num_ev, NULL)) == NULL) { + "bus", KSTAT_TYPE_NAMED, num_ev, 0)) == NULL) { cmn_err(CE_WARN, "%s %s : kstat create failed", - mod_name, pic_name); + mod_name, pic_name); /* * It is up to the calling function to delete any kstats @@ -158,7 +156,7 @@ kstat_t *pcmu_create_cntr_kstat(pcmu_t *pcmu_p, char *name, "counters", "bus", KSTAT_TYPE_NAMED, num_pics + 1, KSTAT_FLAG_WRITABLE)) == NULL) { cmn_err(CE_WARN, "%s%d counters kstat_create failed", - drv_name, drv_instance); + drv_name, drv_instance); return (NULL); } diff --git a/usr/src/uts/sun4u/pcie/Makefile b/usr/src/uts/sun4u/pcie/Makefile index b1ad4eb65f..81f4d70472 100644 --- a/usr/src/uts/sun4u/pcie/Makefile +++ b/usr/src/uts/sun4u/pcie/Makefile @@ -42,8 +42,6 @@ UTSBASE = ../.. MODULE = pcie OBJECTS = $(PCIE_MISC_OBJS:%=$(OBJS_DIR)/%) \ $(PCI_STRING_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(PCIE_MISC_OBJS:%.o=$(LINTS_DIR)/%.ln) \ - $(PCI_STRING_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE) # @@ -55,7 +53,6 @@ include $(UTSBASE)/sun4u/Makefile.sun4u # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # @@ -81,12 +78,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4u/pic16f747/Makefile b/usr/src/uts/sun4u/pic16f747/Makefile index 530a5790a8..2b3a292a69 100644 --- a/usr/src/uts/sun4u/pic16f747/Makefile +++ b/usr/src/uts/sun4u/pic16f747/Makefile @@ -35,7 +35,6 @@ UTSBASE = ../.. # MODULE = pic16f747 OBJECTS = $(PIC16F747_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(PIC16F747_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -50,10 +49,6 @@ ALL_TARGET = $(BINARY) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses # @@ -69,16 +64,9 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # # Include common targets. # include $(UTSBASE)/sun4u/Makefile.targ - diff --git a/usr/src/uts/sun4u/pic16f819/Makefile b/usr/src/uts/sun4u/pic16f819/Makefile index 2df7ffa19d..cb0b95b4ed 100644 --- a/usr/src/uts/sun4u/pic16f819/Makefile +++ b/usr/src/uts/sun4u/pic16f819/Makefile @@ -22,10 +22,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. -# -#ident "%Z%%M% %I% %E% SMI" -# - # This makefile drives the pic16f819 build. # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -37,7 +33,6 @@ UTSBASE = ../.. # MODULE = pic16f819 OBJECTS = $(PIC16F819_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(PIC16F819_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -45,18 +40,12 @@ ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # include $(UTSBASE)/sun4u/Makefile.sun4u -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - LDFLAGS += -dy -N misc/i2c_svc # # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) .KEEP_STATE: @@ -69,12 +58,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4u/rmc_comm/Makefile b/usr/src/uts/sun4u/rmc_comm/Makefile index ac8785ac2b..4afebe2b65 100644 --- a/usr/src/uts/sun4u/rmc_comm/Makefile +++ b/usr/src/uts/sun4u/rmc_comm/Makefile @@ -23,8 +23,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of the rmc_comm driver kernel # module in the sun4u systems # @@ -39,7 +37,6 @@ UTSBASE = ../.. # MODULE = rmc_comm OBJECTS = $(RMC_COMM_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(RMC_COMM_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/sun4u/io @@ -52,32 +49,14 @@ include $(UTSBASE)/sun4u/Makefile.sun4u # Define targets # ALL_TARGET = $(BINARY) $(SRC_CONFILE) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - -# # Turn on doubleword alignment for 64 bit registers # CFLAGS += -dalign # -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN -LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED -LINTTAGS += -erroff=E_STATIC_UNUSED -LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV - -# # Default build targets. # .KEEP_STATE: @@ -90,12 +69,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4u/rmclomv/Makefile b/usr/src/uts/sun4u/rmclomv/Makefile index 9d77985ad2..8243155cb6 100644 --- a/usr/src/uts/sun4u/rmclomv/Makefile +++ b/usr/src/uts/sun4u/rmclomv/Makefile @@ -39,7 +39,6 @@ UTSBASE = ../.. # MODULE = rmclomv OBJECTS = $(RMCLOMV_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(RMCLOMV_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/sun4u/io @@ -52,13 +51,8 @@ include $(UTSBASE)/sun4u/Makefile.sun4u # Define targets # ALL_TARGET = $(BINARY) $(SRC_CONFILE) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Ndrv/rmc_comm -Ndrv/pmugpio # @@ -66,14 +60,6 @@ LDFLAGS += -dy -Ndrv/rmc_comm -Ndrv/pmugpio # CFLAGS += -dalign -# -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN - CERRWARN += -_gcc=-Wno-parentheses # @@ -89,12 +75,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4u/seattle/Makefile b/usr/src/uts/sun4u/seattle/Makefile index 5cb4516a06..e9ff071a63 100644 --- a/usr/src/uts/sun4u/seattle/Makefile +++ b/usr/src/uts/sun4u/seattle/Makefile @@ -46,12 +46,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -59,9 +55,7 @@ check := TARGET= check # .KEEP_STATE: -def all clean clean.lint clobber modlist: $(SEATTLE_KMODS) - -modlintlib: $(SEATTLE_KMODS) +def all clean clobber modlist: $(SEATTLE_KMODS) LINKED_PLATFORMS = SUNW,Sun-Fire-V245 @@ -78,24 +72,6 @@ install: $(ROOT_SEATTLE_DIR) \ check install_h: -lint: modlintlib - -# -# The 'lint.platmod' target lints the seattle platform module against the sun4u -# kernel. This ends up doing all the kernel cross-checks, so it takes a couple -# of minutes. Due to the low ROI, it's not run by default, but it's a good -# idea to run this if you change os/seattle.c. -# -LINT_LIBS = $(LINT_LIB) \ - -L$(SEATTLE_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nSeattle Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(SEATTLE_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/seattle/os/seattle.c b/usr/src/uts/sun4u/seattle/os/seattle.c index 50eeb7ca09..80faf2faa3 100644 --- a/usr/src/uts/sun4u/seattle/os/seattle.c +++ b/usr/src/uts/sun4u/seattle/os/seattle.c @@ -52,7 +52,7 @@ int (*rmc_req_now)(rmc_comm_msg_t *, uint8_t) = NULL; void startup_platform(void) { - mutex_init(&mi2cv_mutex, NULL, NULL, NULL); + mutex_init(&mi2cv_mutex, NULL, MUTEX_ADAPTIVE, NULL); } int diff --git a/usr/src/uts/sun4u/ssc050/Makefile b/usr/src/uts/sun4u/ssc050/Makefile index 13bfe470b6..7701b0cef3 100644 --- a/usr/src/uts/sun4u/ssc050/Makefile +++ b/usr/src/uts/sun4u/ssc050/Makefile @@ -22,10 +22,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. -# -#ident "%Z%%M% %I% %E% SMI" -# - # This makefile drives the ssc050 build. # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -37,7 +33,6 @@ UTSBASE = ../.. # MODULE = ssc050 OBJECTS = $(SSC050_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(SSC050_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -45,18 +40,12 @@ ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # include $(UTSBASE)/sun4u/Makefile.sun4u -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - LDFLAGS += -dy -N misc/i2c_svc # # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) .KEEP_STATE: @@ -69,12 +58,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4u/ssc100/Makefile b/usr/src/uts/sun4u/ssc100/Makefile index 579f19a910..f42fdb1b17 100644 --- a/usr/src/uts/sun4u/ssc100/Makefile +++ b/usr/src/uts/sun4u/ssc100/Makefile @@ -22,10 +22,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. -# -#ident "%Z%%M% %I% %E% SMI" -# - # This makefile drives the ssc100 build. # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -37,7 +33,6 @@ UTSBASE = ../.. # MODULE = ssc100 OBJECTS = $(SSC100_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(SSC100_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -45,18 +40,12 @@ ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # include $(UTSBASE)/sun4u/Makefile.sun4u -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - LDFLAGS += -dy -N misc/i2c_svc # # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) .KEEP_STATE: @@ -69,12 +58,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4u/sunfire/Makefile b/usr/src/uts/sun4u/sunfire/Makefile index ee5e425567..d3d0cfc768 100644 --- a/usr/src/uts/sun4u/sunfire/Makefile +++ b/usr/src/uts/sun4u/sunfire/Makefile @@ -23,8 +23,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of the sun4u sunfire platform # module. # @@ -47,12 +45,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -60,11 +54,9 @@ check := TARGET= check # .KEEP_STATE: -def all clean clean.lint clobber modlist: \ +def all clean clobber modlist: \ $(SUNFIRE_KMODS) $(CLOSED_SUNFIRE_KMODS) -modlintlib: $(SUNFIRE_KMODS) $(CLOSED_SUNFIRE_KMODS) - IMPLEMENTED_PLATFORM = SUNW,Ultra-Enterprise install: $(ROOT_SUNFIRE_DIR) $(USR_SUNFIRE_DIR) \ @@ -76,24 +68,6 @@ install: $(ROOT_SUNFIRE_DIR) $(USR_SUNFIRE_DIR) \ install_h check: FRC @cd sys; pwd; $(MAKE) $(TARGET) -lint: modlintlib - -# -# The 'lint.platmod' target lints the sunfire platform module against the sun4u -# kernel. This ends up doing all the kernel cross-checks, so it takes a couple -# of minutes. Due to the low ROI, it's not run by default, but it's a good -# idea to run this if you change os/sunfire.c. -# -LINT_LIBS = $(LINT_LIB) \ - -L$(SUNFIRE_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nSunfire Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(SUNFIRE_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/sunfire/io/ac.c b/usr/src/uts/sun4u/sunfire/io/ac.c index c19cad9264..19cf822093 100644 --- a/usr/src/uts/sun4u/sunfire/io/ac.c +++ b/usr/src/uts/sun4u/sunfire/io/ac.c @@ -905,8 +905,8 @@ ac_add_picN_kstats(dev_info_t *dip) }; struct kstat_named *ac_pic_named_data; - int event, pic; - char pic_name[30]; + int event, pic; + char pic_name[30]; int instance = ddi_get_instance(dip); int pic_shift = 0; @@ -918,7 +918,7 @@ ac_add_picN_kstats(dev_info_t *dip) (void) sprintf(pic_name, "pic%d", pic); /* pic0, pic1 ... */ if ((ac_picN_ksp[pic] = kstat_create("ac", instance, pic_name, "bus", KSTAT_TYPE_NAMED, - AC_NUM_EVENTS + 1, NULL)) == NULL) { + AC_NUM_EVENTS + 1, 0)) == NULL) { cmn_err(CE_WARN, "ac %s: kstat_create failed", pic_name); diff --git a/usr/src/uts/sun4u/sunfire/io/fhc.c b/usr/src/uts/sun4u/sunfire/io/fhc.c index d47130bddc..d89eb3dfb5 100644 --- a/usr/src/uts/sun4u/sunfire/io/fhc.c +++ b/usr/src/uts/sun4u/sunfire/io/fhc.c @@ -245,7 +245,7 @@ short clk_danger_temp = 68; /* Clock Board Danger Temperature */ short dft_warn_temp = 60; /* default warning temp value */ short dft_danger_temp = 68; /* default danger temp value */ -short cpu_warn_temp_4x = 60; /* CPU/Memory warning temp for 400 MHZ */ +short cpu_warn_temp_4x = 60; /* CPU/Memory warning temp for 400 MHZ */ short cpu_danger_temp_4x = 68; /* CPU/Memory danger temp for 400 MHZ */ /* @@ -398,7 +398,7 @@ static struct cb_ops fhc_cb_ops = { nulldev, /* dump */ nulldev, /* read */ nulldev, /* write */ - nulldev, /* ioctl */ + nulldev, /* ioctl */ nodev, /* devmap */ nodev, /* mmap */ nodev, /* segmap */ @@ -1321,7 +1321,7 @@ done: */ static void fhc_remove_intr_impl(dev_info_t *dip, dev_info_t *rdip, - ddi_intr_handle_impl_t *hdlp) + ddi_intr_handle_impl_t *hdlp) { volatile uint_t *mondo_vec_reg; volatile uint_t tmpreg; @@ -1490,7 +1490,7 @@ fhc_intr_ops(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op, */ static int fhc_ctlops(dev_info_t *dip, dev_info_t *rdip, - ddi_ctl_enum_t op, void *arg, void *result) + ddi_ctl_enum_t op, void *arg, void *result) { switch (op) { @@ -1529,7 +1529,6 @@ fhc_ctlops(dev_info_t *dip, dev_info_t *rdip, /* ARGSUSED */ static void fhc_xlate_intrs(ddi_intr_handle_impl_t *hdlp, uint32_t ign) - { uint32_t mondo; @@ -2384,8 +2383,8 @@ cpu_on_board(int board) int upa_a = board << 1; int upa_b = (board << 1) + 1; - if ((cpunodes[upa_a].nodeid != NULL) || - (cpunodes[upa_b].nodeid != NULL)) { + if ((cpunodes[upa_a].nodeid != 0) || + (cpunodes[upa_b].nodeid != 0)) { return (1); } else { return (0); @@ -3385,7 +3384,7 @@ fhc_cpu_poweron(struct cpu *cp) static void os_completes_shutdown(void) { - pfn_t pfn; + pfn_t pfn; tte_t tte; volatile uint_t *src; volatile uint_t *dst; diff --git a/usr/src/uts/sun4u/sunfire/io/sysctrl.c b/usr/src/uts/sun4u/sunfire/io/sysctrl.c index 206829b2a2..16ae450198 100644 --- a/usr/src/uts/sun4u/sunfire/io/sysctrl.c +++ b/usr/src/uts/sun4u/sunfire/io/sysctrl.c @@ -806,7 +806,7 @@ sysctrl_attach(dev_info_t *devi, ddi_attach_cmd_t cmd) * perform initialization to allow setting of powerfail-time */ if ((dip = ddi_find_devinfo("options", -1, 0)) == NULL) - softsp->options_nodeid = (pnode_t)NULL; + softsp->options_nodeid = (pnode_t)0; else softsp->options_nodeid = (pnode_t)ddi_get_nodeid(dip); @@ -1218,7 +1218,7 @@ sysc_pkt_fini(sysc_cfga_pkt_t *pkt, intptr_t arg, int flag) /* ARGSUSED */ static int sysctrl_ioctl(dev_t devt, int cmd, intptr_t arg, int flag, cred_t *cred_p, - int *rval_p) + int *rval_p) { struct sysctrl_soft_state *softsp; sysc_cfga_pkt_t sysc_pkt; diff --git a/usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c b/usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c index b9b091f759..86f576bf22 100644 --- a/usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c +++ b/usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c @@ -576,7 +576,7 @@ sysctrl_resume(sysc_cfga_pkt_t *pkt) */ if (sysc_watchdog_suspended) { mutex_enter(&tod_lock); - tod_ops.tod_set_watchdog_timer( + (void) tod_ops.tod_set_watchdog_timer( watchdog_timeout_seconds); mutex_exit(&tod_lock); } @@ -731,7 +731,7 @@ sysctrl_suspend(sysc_cfga_pkt_t *pkt) */ if (watchdog_activated) { mutex_enter(&tod_lock); - tod_ops.tod_clear_watchdog_timer(); + (void) tod_ops.tod_clear_watchdog_timer(); mutex_exit(&tod_lock); sysc_watchdog_suspended = 1; } else { diff --git a/usr/src/uts/sun4u/tazmo/Makefile b/usr/src/uts/sun4u/tazmo/Makefile index 1f69f760e9..53480d8bb5 100644 --- a/usr/src/uts/sun4u/tazmo/Makefile +++ b/usr/src/uts/sun4u/tazmo/Makefile @@ -24,8 +24,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of the sun4u tazmo platform # module. # @@ -48,12 +46,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -61,9 +55,7 @@ check := TARGET= check # .KEEP_STATE: -def all clean clean.lint clobber modlist: $(TAZMO_KMODS) $(CLOSED_TAZMO_KMODS) - -modlintlib: $(TAZMO_KMODS) $(CLOSED_TAZMO_KMODS) +def all clean clobber modlist: $(TAZMO_KMODS) $(CLOSED_TAZMO_KMODS) install: $(ROOT_TAZMO_DIR) $(USR_TAZMO_DIR) \ $(USR_TAZMO_INC_DIR) \ @@ -73,24 +65,6 @@ install: $(ROOT_TAZMO_DIR) $(USR_TAZMO_DIR) \ check install_h: -lint: modlintlib - -# -# The 'lint.platmod' target lints the tazmo platform module against the sun4u -# kernel. This ends up doing all the kernel cross-checks, so it takes a couple -# of minutes. Due to the low ROI, it's not run by default, but it's a good -# idea to run this if you change os/tazmo.c. -# -LINT_LIBS = $(LINT_LIB) \ - -L$(TAZMO_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nTazmo Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(TAZMO_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/tazmo/io/envctrl.c b/usr/src/uts/sun4u/tazmo/io/envctrl.c index 40e7f6532b..30c3e93feb 100644 --- a/usr/src/uts/sun4u/tazmo/io/envctrl.c +++ b/usr/src/uts/sun4u/tazmo/io/envctrl.c @@ -59,13 +59,13 @@ #include <sys/envctrl.h> /* Environment header */ /* driver entry point fn definitions */ -static int envctrl_open(queue_t *, dev_t *, int, int, cred_t *); +static int envctrl_open(queue_t *, dev_t *, int, int, cred_t *); static int envctrl_close(queue_t *, int, cred_t *); -static uint_t envctrl_bus_isr(caddr_t); -static uint_t envctrl_dev_isr(caddr_t); +static uint_t envctrl_bus_isr(caddr_t); +static uint_t envctrl_dev_isr(caddr_t); /* configuration entry point fn definitions */ -static int envctrl_getinfo(dev_info_t *, ddi_info_cmd_t, void *, void **); +static int envctrl_getinfo(dev_info_t *, ddi_info_cmd_t, void *, void **); static int envctrl_attach(dev_info_t *, ddi_attach_cmd_t); static int envctrl_detach(dev_info_t *, ddi_detach_cmd_t); @@ -141,7 +141,7 @@ static int controller_present[] = {-1, -1, -1}; #ifdef MULTIFAN static int envctrl_fan_debug = 0; #endif -static int eHc_debug = 0; +static int eHc_debug = 0; static int power_supply_previous_state[] = {-1, -1, -1}; extern void pci_thermal_rem_intr(dev_info_t *, uint_t); @@ -274,12 +274,12 @@ static struct modlinkage envctrlmodlinkage = { #define EHC_DEV3 0x06 #define EHC_DEV4 0x08 #define EHC_DEV5 0x0A -#define EHC_DEV6 0x0C +#define EHC_DEV6 0x0C #define EHC_DEV7 0x0E /* - * CONTROL OF CHIP + * CONTROL OF CHIP * PCF8591 Temp sensing control register definitions * * 7 6 5 4 3 2 1 0 @@ -520,7 +520,7 @@ envctrl_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) (void) sprintf(name, "envctrl%d", instance); if (ddi_create_minor_node(dip, name, S_IFCHR, instance, DDI_PSEUDO, - NULL) == DDI_FAILURE) { + 0) == DDI_FAILURE) { ddi_remove_minor_node(dip, NULL); goto remhardintr1; } @@ -1449,7 +1449,7 @@ envctrl_init_bus(struct envctrlunit *unitp) { int i; - uint8_t noval = NULL; + uint8_t noval = 0; struct envctrl_tda8444t_chip fan; int fans[] = {ENVCTRL_CPU_FANS, ENVCTRL_PS_FANS, ENVCTRL_AFB_FANS}; @@ -1890,7 +1890,7 @@ envctrl_get_lm75_temp(struct envctrlunit *unitp) } else { k = lmval /2; } - return (k); + return (k); } @@ -1975,7 +1975,7 @@ envctrl_get_sys_temperatures(struct envctrlunit *unitp, uint8_t *diag_tempr) int i; struct envctrl_tda8444t_chip fan; uint8_t psaddr[] = {PSTEMP3, PSTEMP2, PSTEMP1, PSTEMP0}; - uint8_t noval = NULL; + uint8_t noval = 0; uint8_t fspval; ASSERT(MUTEX_HELD(&unitp->umutex)); @@ -2050,11 +2050,11 @@ envctrl_get_sys_temperatures(struct envctrlunit *unitp, uint8_t *diag_tempr) unitp->current_mode == ENVCTRL_NORMAL_MODE) { unitp->shutdown = B_TRUE; } - if (unitp->current_mode == ENVCTRL_NORMAL_MODE) { - cmn_err(CE_WARN, - "Ambient Temperature is %d C, shutdown now\n", - ambtemp); - } + if (unitp->current_mode == ENVCTRL_NORMAL_MODE) { + cmn_err(CE_WARN, + "Ambient Temperature is %d C, shutdown now\n", + ambtemp); + } } else { if (envctrl_isother_fault_led(unitp, fspval, ENVCTRL_FSP_TEMP_ERR)) { @@ -2106,16 +2106,16 @@ envctrl_get_sys_temperatures(struct envctrlunit *unitp, uint8_t *diag_tempr) } if (temperature < 0) { - fan.val = MAX_FAN_SPEED; /* blast it is out of range */ + fan.val = MAX_FAN_SPEED; /* blast it is out of range */ } else if (temperature > MAX_AMB_TEMP) { fan.val = MAX_FAN_SPEED; fspval |= (ENVCTRL_FSP_TEMP_ERR | ENVCTRL_FSP_GEN_ERR); - if (unitp->current_mode == ENVCTRL_NORMAL_MODE) { - cmn_err(CE_WARN, - "CPU Fans set to MAX. CPU Temp is %d C\n", - hicputemp); - } + if (unitp->current_mode == ENVCTRL_NORMAL_MODE) { + cmn_err(CE_WARN, + "CPU Fans set to MAX. CPU Temp is %d C\n", + hicputemp); + } } else if (ambtemp < MAX_AMB_TEMP) { if (!envctrl_p0_enclosure) { fan.val = acme_cpu_fanspd[temperature]; @@ -3635,7 +3635,7 @@ eHc_after_read_pcf8584(struct eHc_envcunit *ehcp, uint8_t *data) */ static int eHc_write_tda8444(struct eHc_envcunit *ehcp, int byteaddress, int instruction, - int subaddress, uint8_t *buf, int size) + int subaddress, uint8_t *buf, int size) { uint8_t control; int i, status; @@ -3687,7 +3687,7 @@ eHc_write_tda8444(struct eHc_envcunit *ehcp, int byteaddress, int instruction, */ static int eHc_read_pcf8574a(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, - int size) + int size) { int i; int status; @@ -3742,7 +3742,7 @@ eHc_read_pcf8574a(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, */ static int eHc_write_pcf8574a(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, - int size) + int size) { int i; int status; @@ -3789,7 +3789,7 @@ eHc_write_pcf8574a(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, */ static int eHc_read_pcf8574(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, - int size) + int size) { int i; int status; @@ -3844,7 +3844,7 @@ eHc_read_pcf8574(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, */ static int eHc_write_pcf8574(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, - int size) + int size) { int i; int status; @@ -3890,7 +3890,7 @@ eHc_write_pcf8574(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, */ static int eHc_read_lm75(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, - int size) + int size) { int i; int status; @@ -3944,7 +3944,7 @@ eHc_read_lm75(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, */ static int eHc_write_pcf8583(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, - int size) + int size) { int i; int status; @@ -3988,7 +3988,7 @@ eHc_write_pcf8583(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, */ static int eHc_read_pcf8591(struct eHc_envcunit *ehcp, int byteaddress, int channel, - int autoinc, int amode, int aenable, uint8_t *buf, int size) + int autoinc, int amode, int aenable, uint8_t *buf, int size) { int i; int status; diff --git a/usr/src/uts/sun4u/todds1287/Makefile b/usr/src/uts/sun4u/todds1287/Makefile index ee0d883bc9..df904ac01e 100644 --- a/usr/src/uts/sun4u/todds1287/Makefile +++ b/usr/src/uts/sun4u/todds1287/Makefile @@ -40,7 +40,6 @@ UTSBASE = ../.. # MODULE = todds1287 OBJECTS = $(TODDS1287_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(TODDS1287_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_TOD_DIR)/$(MODULE) # @@ -52,21 +51,8 @@ include $(UTSBASE)/sun4u/Makefile.sun4u # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - -# -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN - CERRWARN += $(CNOWARN_UNINIT) # @@ -82,16 +68,9 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # # Include common targets. # include $(UTSBASE)/sun4u/Makefile.targ - diff --git a/usr/src/uts/sun4u/todds1337/Makefile b/usr/src/uts/sun4u/todds1337/Makefile index 4e7ebf7363..3d068d04a7 100644 --- a/usr/src/uts/sun4u/todds1337/Makefile +++ b/usr/src/uts/sun4u/todds1337/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of todds1337 kernel module. # # sun4u implementation architecture dependent @@ -39,7 +37,6 @@ UTSBASE = ../.. # MODULE = todds1337 OBJECTS = $(TODDS1337_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(TODDS1337_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_TOD_DIR)/$(MODULE) # @@ -51,24 +48,11 @@ include $(UTSBASE)/sun4u/Makefile.sun4u # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - LDFLAGS += -dy -N misc/i2c_svc # -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV - -# # Default build targets. # .KEEP_STATE: @@ -81,16 +65,9 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # # Include common targets. # include $(UTSBASE)/sun4u/Makefile.targ - diff --git a/usr/src/uts/sun4v/cpu/niagara_perfctr.c b/usr/src/uts/sun4v/cpu/niagara_perfctr.c index d32191727b..9e70093f7a 100644 --- a/usr/src/uts/sun4v/cpu/niagara_perfctr.c +++ b/usr/src/uts/sun4v/cpu/niagara_perfctr.c @@ -598,7 +598,7 @@ ni_delete_name_kstat(ni_ksinfo_t *pp) */ static kstat_t * ni_create_picN_kstat(char *mod_name, int pic, int pic_sel_shift, - int num_ev, ni_kev_mask_t *ev_array) + int num_ev, ni_kev_mask_t *ev_array) { struct kstat_named *pic_named_data; int inst = 0; @@ -608,7 +608,7 @@ ni_create_picN_kstat(char *mod_name, int pic, int pic_sel_shift, (void) sprintf(pic_name, "pic%d", pic); if ((picN_ksp = kstat_create(mod_name, inst, pic_name, - "bus", KSTAT_TYPE_NAMED, num_ev, NULL)) == NULL) { + "bus", KSTAT_TYPE_NAMED, num_ev, 0)) == NULL) { cmn_err(CE_WARN, "%s %s : kstat create failed", mod_name, pic_name); @@ -656,7 +656,7 @@ ni_create_picN_kstat(char *mod_name, int pic, int pic_sel_shift, */ static kstat_t * ni_create_cntr_kstat(char *name, int instance, int (*update)(kstat_t *, int), - void *ksinfop) + void *ksinfop) { struct kstat *counters_ksp; struct kstat_named *counters_named_data; diff --git a/usr/src/uts/sun4v/dr_cpu/Makefile b/usr/src/uts/sun4v/dr_cpu/Makefile index f4a96fa25a..2a2800ea37 100644 --- a/usr/src/uts/sun4v/dr_cpu/Makefile +++ b/usr/src/uts/sun4v/dr_cpu/Makefile @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -36,7 +34,6 @@ UTSBASE = ../.. # MODULE = dr_cpu OBJECTS = $(DR_CPU_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(DR_CPU_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE) # @@ -48,15 +45,9 @@ include $(UTSBASE)/sun4v/Makefile.sun4v # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - -# # Turn on doubleword alignment for 64 bit registers # CFLAGS += -dalign @@ -79,12 +70,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4v/dr_mem/Makefile b/usr/src/uts/sun4v/dr_mem/Makefile index f55ea3ef6b..3f8233df47 100644 --- a/usr/src/uts/sun4v/dr_mem/Makefile +++ b/usr/src/uts/sun4v/dr_mem/Makefile @@ -34,7 +34,6 @@ UTSBASE = ../.. # MODULE = dr_mem OBJECTS = $(DR_MEM_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(DR_MEM_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE) # @@ -46,13 +45,8 @@ include $(UTSBASE)/sun4v/Makefile.sun4v # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses # @@ -78,12 +72,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4v/glvc/Makefile b/usr/src/uts/sun4v/glvc/Makefile index 997f92cef7..5d44984f49 100644 --- a/usr/src/uts/sun4v/glvc/Makefile +++ b/usr/src/uts/sun4v/glvc/Makefile @@ -22,9 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# This makefile drives the production of the virtual channel driver +# This makefile drives the production of the virtual channel driver # kernel module. # # sun4v implementation architecture dependent @@ -38,9 +36,8 @@ UTSBASE = ../.. # # Define the module and object file sets. # -MODULE = glvc +MODULE = glvc OBJECTS = $(GLVC_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(GLVC_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -59,24 +56,9 @@ CLEANFILES += $(MODSTUBS_O) # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - -# -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV -LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON - -# # Default build targets. # .KEEP_STATE: @@ -89,12 +71,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4v/io/dr_cpu.c b/usr/src/uts/sun4v/io/dr_cpu.c index f2cfbb5873..e980cb55de 100644 --- a/usr/src/uts/sun4v/io/dr_cpu.c +++ b/usr/src/uts/sun4v/io/dr_cpu.c @@ -583,7 +583,7 @@ dr_cpu_res_array_init(dr_cpu_hdr_t *req, drctl_rsrc_t *rsrc, int nrsrc) * on the memory allocated for the message buffer * itself. */ - if (rsrc[idx].offset != NULL) { + if (rsrc[idx].offset != 0) { err_str = (char *)rsrc + rsrc[idx].offset; err_len = strlen(err_str) + 1; diff --git a/usr/src/uts/sun4v/io/dr_mem.c b/usr/src/uts/sun4v/io/dr_mem.c index c9695e7c6f..2443f4d550 100644 --- a/usr/src/uts/sun4v/io/dr_mem.c +++ b/usr/src/uts/sun4v/io/dr_mem.c @@ -611,7 +611,7 @@ dr_mem_res_array_init(dr_mem_hdr_t *req, drctl_rsrc_t *rsrc, int nrsrc) * on the memory allocated for the message buffer * itself. */ - if (rsrc[idx].offset != NULL) { + if (rsrc[idx].offset != 0) { err_str = (char *)rsrc + rsrc[idx].offset; err_len = strlen(err_str) + 1; @@ -768,7 +768,7 @@ dr_mem_list_query(dr_mem_hdr_t *req, dr_mem_hdr_t **resp, int *resp_len) /* allocate a response message, should be freed by caller */ nml = 0; rlen = sizeof (dr_mem_hdr_t); - if (req_mblks->addr == NULL && req_mblks->size == 0) { + if (req_mblks->addr == 0 && req_mblks->size == 0) { /* * Request is for domain's full view of it's memory. * place a copy in phys_copy then release the memlist lock. @@ -926,8 +926,8 @@ dr_mem_unconfigure(dr_mem_blk_t *mbp, int *status) if (!MBLK_IS_VALID(mbp)) { DR_DBG_MEM("invalid mblk 0x%lx.0x%lx\n", mbp->addr, mbp->size); - *status = DR_MEM_STAT_CONFIGURED; - rv = DR_MEM_RES_EINVAL; + *status = DR_MEM_STAT_CONFIGURED; + rv = DR_MEM_RES_EINVAL; } else if (rv = mem_del(btop(mbp->addr), btop(mbp->size))) { *status = DR_MEM_STAT_CONFIGURED; } else { diff --git a/usr/src/uts/sun4v/io/glvc/glvc.c b/usr/src/uts/sun4v/io/glvc/glvc.c index 8c151416aa..77dd8c60f3 100644 --- a/usr/src/uts/sun4v/io/glvc/glvc.c +++ b/usr/src/uts/sun4v/io/glvc/glvc.c @@ -254,7 +254,7 @@ glvc_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) { int instance; int err; - glvc_soft_state_t *softsp; + glvc_soft_state_t *softsp; switch (cmd) { case DDI_ATTACH: @@ -338,7 +338,7 @@ glvc_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) va_to_pa((caddr_t)softsp->mb_send_buf); err = ddi_create_minor_node(dip, "glvc", S_IFCHR, - instance, DDI_PSEUDO, NULL); + instance, DDI_PSEUDO, 0); if (err != DDI_SUCCESS) { kmem_free(softsp->mb_recv_buf, softsp->mtu); kmem_free(softsp->mb_send_buf, softsp->mtu); @@ -412,7 +412,7 @@ glvc_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) { int instance; int err; - glvc_soft_state_t *softsp; + glvc_soft_state_t *softsp; switch (cmd) { diff --git a/usr/src/uts/sun4v/io/iospc/iospc.c b/usr/src/uts/sun4v/io/iospc/iospc.c index 47efae480c..8ca72c2539 100644 --- a/usr/src/uts/sun4v/io/iospc/iospc.c +++ b/usr/src/uts/sun4v/io/iospc/iospc.c @@ -377,7 +377,7 @@ iospc_create_picN_kstat(char *mod_name, int pic, uint64_t ev_offset, (void) snprintf(pic_name, PIC_STR_LEN, "pic%1d", pic); if ((picN_ksp = kstat_create(mod_name, 0, pic_name, - "bus", KSTAT_TYPE_NAMED, num_ev, NULL)) == NULL) { + "bus", KSTAT_TYPE_NAMED, num_ev, 0)) == NULL) { return (NULL); } @@ -467,7 +467,7 @@ iospc_create_cntr_kstat(char *name, int dev_inst, */ static int iospc_perfcnt_program(iospc_t *iospc_p, iospc_grp_t *grp_p, - iospc_ksinfo_t *ksinfo_p, uint64_t new_events) + iospc_ksinfo_t *ksinfo_p, uint64_t new_events) { uint64_t old_events; int rval = SUCCESS; diff --git a/usr/src/uts/sun4v/io/ldc.c b/usr/src/uts/sun4v/io/ldc.c index 939c260834..0b2b94d173 100644 --- a/usr/src/uts/sun4v/io/ldc.c +++ b/usr/src/uts/sun4v/io/ldc.c @@ -288,18 +288,6 @@ ldc_inject_error(ldc_chan_t *ldcp, uint64_t error) return (B_TRUE); } -#define D1 \ -if (ldcdbg & 0x01) \ - ldcdebug - -#define D2 \ -if (ldcdbg & 0x02) \ - ldcdebug - -#define DWARN \ -if (ldcdbg & 0x04) \ - ldcdebug - #define DUMP_PAYLOAD(id, addr) \ { \ char buf[65*3]; \ @@ -321,10 +309,10 @@ if (ldcdbg & 0x04) \ (msg->env & LDC_FRAG_START) ? 'B' : ' ', \ (msg->env & LDC_FRAG_STOP) ? 'E' : ' ', \ (msg->env & LDC_LEN_MASK)); \ - } else { \ + } else { \ D2((c)->id, "%s: msg%d (/%x/%x/%x/,env=%x)", (s), \ mid, msg->type, msg->stype, msg->ctrl, msg->env); \ - } \ + } \ } #define LDC_INJECT_RESET(_ldcp) ldc_inject_error(_ldcp, LDC_ERR_RESET) @@ -337,10 +325,6 @@ extern void i_ldc_mem_inject_dring_clear(ldc_chan_t *ldcp); #define DBG_ALL_LDCS -1 -#define D1 -#define D2 -#define DWARN - #define DUMP_PAYLOAD(id, addr) #define DUMP_LDC_PKT(c, s, addr) @@ -461,10 +445,10 @@ _info(struct modinfo *modinfop) int _fini(void) { - int rv, status; - ldc_chan_t *tmp_ldcp, *ldcp; - ldc_dring_t *tmp_dringp, *dringp; - ldc_mem_info_t minfo; + int rv, status; + ldc_chan_t *tmp_ldcp, *ldcp; + ldc_dring_t *tmp_dringp, *dringp; + ldc_mem_info_t minfo; /* Unlink the driver module from the system */ status = mod_remove(&ml); @@ -564,7 +548,7 @@ i_ldc_h2v_error(int h_error) case H_ENOTSUPPORTED: return (ENOTSUP); - case H_ETOOMANY: + case H_ETOOMANY: return (ENOSPC); case H_ECHANNEL: @@ -809,8 +793,8 @@ i_ldc_clear_intr(ldc_chan_t *ldcp, cnex_intrtype_t itype) static int i_ldc_set_rx_head(ldc_chan_t *ldcp, uint64_t head) { - int rv; - int retries; + int rv; + int retries; ASSERT(MUTEX_HELD(&ldcp->lock)); for (retries = 0; retries < ldc_max_retries; retries++) { @@ -840,7 +824,7 @@ i_ldc_set_rx_head(ldc_chan_t *ldcp, uint64_t head) static void i_ldc_get_tx_head(ldc_chan_t *ldcp, uint64_t *head) { - ldc_msg_t *pkt; + ldc_msg_t *pkt; ASSERT(MUTEX_HELD(&ldcp->tx_lock)); @@ -876,8 +860,8 @@ i_ldc_get_tx_head(ldc_chan_t *ldcp, uint64_t *head) static int i_ldc_get_tx_tail(ldc_chan_t *ldcp, uint64_t *tail) { - int rv; - uint64_t current_head, new_tail; + int rv; + uint64_t current_head, new_tail; ASSERT(MUTEX_HELD(&ldcp->tx_lock)); /* Read the head and tail ptrs from HV */ @@ -924,7 +908,7 @@ static int i_ldc_set_tx_tail(ldc_chan_t *ldcp, uint64_t tail) { int rv, retval = EWOULDBLOCK; - int retries; + int retries; ASSERT(MUTEX_HELD(&ldcp->tx_lock)); for (retries = 0; retries < ldc_max_retries; retries++) { @@ -1131,7 +1115,7 @@ i_ldc_send_pkt(ldc_chan_t *ldcp, uint8_t pkttype, uint8_t subtype, uint8_t ctrlmsg) { int rv; - ldc_msg_t *pkt; + ldc_msg_t *pkt; uint64_t tx_tail; uint32_t curr_seqid; @@ -1236,8 +1220,8 @@ i_ldc_check_seqid(ldc_chan_t *ldcp, ldc_msg_t *msg) static int i_ldc_process_VER(ldc_chan_t *ldcp, ldc_msg_t *msg) { - int rv = 0, idx = ldcp->next_vidx; - ldc_msg_t *pkt; + int rv = 0, idx = ldcp->next_vidx; + ldc_msg_t *pkt; uint64_t tx_tail; ldc_ver_t *rcvd_ver; @@ -1533,8 +1517,8 @@ i_ldc_process_VER(ldc_chan_t *ldcp, ldc_msg_t *msg) static int i_ldc_process_RTS(ldc_chan_t *ldcp, ldc_msg_t *msg) { - int rv = 0; - ldc_msg_t *pkt; + int rv = 0; + ldc_msg_t *pkt; uint64_t tx_tail; boolean_t sent_NACK = B_FALSE; @@ -1660,7 +1644,7 @@ i_ldc_process_RTS(ldc_chan_t *ldcp, ldc_msg_t *msg) static int i_ldc_process_RTR(ldc_chan_t *ldcp, ldc_msg_t *msg) { - int rv = 0; + int rv = 0; boolean_t sent_NACK = B_FALSE; D2(ldcp->id, "i_ldc_process_RTR: (0x%llx) received RTR\n", ldcp->id); @@ -1824,7 +1808,7 @@ static int i_ldc_process_data_ACK(ldc_chan_t *ldcp, ldc_msg_t *msg) { int rv; - uint64_t tx_head; + uint64_t tx_head; ldc_msg_t *pkt; /* Obtain Tx lock */ @@ -1892,7 +1876,7 @@ i_ldc_process_data_ACK(ldc_chan_t *ldcp, ldc_msg_t *msg) static int i_ldc_ctrlmsg(ldc_chan_t *ldcp, ldc_msg_t *msg) { - int rv = 0; + int rv = 0; D1(ldcp->id, "i_ldc_ctrlmsg: (%llx) tstate = %lx, hstate = %lx\n", ldcp->id, ldcp->tstate, ldcp->hstate); @@ -2102,9 +2086,9 @@ i_ldc_tx_hdlr(caddr_t arg1, caddr_t arg2) { _NOTE(ARGUNUSED(arg2)) - int rv; - ldc_chan_t *ldcp; - boolean_t notify_client = B_FALSE; + int rv; + ldc_chan_t *ldcp; + boolean_t notify_client = B_FALSE; uint64_t notify_event = 0, link_state; /* Get the channel for which interrupt was received */ @@ -2227,8 +2211,8 @@ i_ldc_rx_process_hvq(ldc_chan_t *ldcp, boolean_t *notify_client, uint64_t *notify_event) { int rv; - uint64_t rx_head, rx_tail; - ldc_msg_t *msg; + uint64_t rx_head, rx_tail; + ldc_msg_t *msg; uint64_t link_state, first_fragment = 0; boolean_t trace_length = B_TRUE; @@ -2580,7 +2564,7 @@ i_ldc_rx_ackpeek(ldc_chan_t *ldcp, uint64_t rx_head, uint64_t rx_tail) int ldc_init(uint64_t id, ldc_attr_t *attr, ldc_handle_t *handle) { - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; int rv, exit_val; uint64_t ra_base, nentries; uint64_t qlen; @@ -2728,7 +2712,7 @@ ldc_init(uint64_t id, ldc_attr_t *attr, ldc_handle_t *handle) /* Create a transmit queue */ ldcp->tx_q_va = (uint64_t) contig_mem_alloc(ldcp->tx_q_entries << LDC_PACKET_SHIFT); - if (ldcp->tx_q_va == NULL) { + if (ldcp->tx_q_va == 0) { cmn_err(CE_WARN, "ldc_init: (0x%lx) TX queue allocation failed\n", ldcp->id); @@ -2745,7 +2729,7 @@ ldc_init(uint64_t id, ldc_attr_t *attr, ldc_handle_t *handle) /* Create a receive queue */ ldcp->rx_q_va = (uint64_t) contig_mem_alloc(ldcp->rx_q_entries << LDC_PACKET_SHIFT); - if (ldcp->rx_q_va == NULL) { + if (ldcp->rx_q_va == 0) { cmn_err(CE_WARN, "ldc_init: (0x%lx) RX queue allocation failed\n", ldcp->id); @@ -2775,7 +2759,7 @@ ldc_init(uint64_t id, ldc_attr_t *attr, ldc_handle_t *handle) ldcp->rx_dq_va = (uint64_t) kmem_alloc(ldcp->rx_dq_entries << LDC_PACKET_SHIFT, KM_SLEEP); - if (ldcp->rx_dq_va == NULL) { + if (ldcp->rx_dq_va == 0) { cmn_err(CE_WARN, "ldc_init: (0x%lx) RX data queue " "allocation failed\n", ldcp->id); @@ -2831,8 +2815,7 @@ cleanup_on_exit: mutex_destroy(&ldcp->tx_lock); mutex_destroy(&ldcp->lock); - if (ldcp) - kmem_free(ldcp, sizeof (ldc_chan_t)); + kmem_free(ldcp, sizeof (ldc_chan_t)); return (exit_val); } @@ -2846,11 +2829,11 @@ cleanup_on_exit: int ldc_fini(ldc_handle_t handle) { - ldc_chan_t *ldcp; - ldc_chan_t *tmp_ldcp; - uint64_t id; + ldc_chan_t *ldcp; + ldc_chan_t *tmp_ldcp; + uint64_t id; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_fini: invalid channel handle\n"); return (EINVAL); } @@ -2895,7 +2878,7 @@ ldc_fini(ldc_handle_t handle) /* Free the map table for this channel */ if (ldcp->mtbl) { - (void) hv_ldc_set_map_table(ldcp->id, NULL, NULL); + (void) hv_ldc_set_map_table(ldcp->id, 0, 0); if (ldcp->mtbl->contigmem) contig_mem_free(ldcp->mtbl->table, ldcp->mtbl->size); else @@ -2951,10 +2934,10 @@ ldc_fini(ldc_handle_t handle) int ldc_open(ldc_handle_t handle) { - ldc_chan_t *ldcp; - int rv; + ldc_chan_t *ldcp; + int rv; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_open: invalid channel handle\n"); return (EINVAL); } @@ -2979,7 +2962,7 @@ ldc_open(ldc_handle_t handle) /* * Unregister/Register the tx queue with the hypervisor */ - rv = hv_ldc_tx_qconf(ldcp->id, NULL, NULL); + rv = hv_ldc_tx_qconf(ldcp->id, 0, 0); if (rv) { cmn_err(CE_WARN, "ldc_open: (0x%lx) channel tx queue unconf failed\n", @@ -3003,7 +2986,7 @@ ldc_open(ldc_handle_t handle) /* * Unregister/Register the rx queue with the hypervisor */ - rv = hv_ldc_rx_qconf(ldcp->id, NULL, NULL); + rv = hv_ldc_rx_qconf(ldcp->id, 0, 0); if (rv) { cmn_err(CE_WARN, "ldc_open: (0x%lx) channel rx queue unconf failed\n", @@ -3032,8 +3015,8 @@ ldc_open(ldc_handle_t handle) cmn_err(CE_WARN, "ldc_open: (0x%lx) channel register failed\n", ldcp->id); ldcp->tstate &= ~TS_QCONF_RDY; - (void) hv_ldc_tx_qconf(ldcp->id, NULL, NULL); - (void) hv_ldc_rx_qconf(ldcp->id, NULL, NULL); + (void) hv_ldc_tx_qconf(ldcp->id, 0, 0); + (void) hv_ldc_rx_qconf(ldcp->id, 0, 0); mutex_exit(&ldcp->lock); return (EIO); } @@ -3050,8 +3033,8 @@ ldc_open(ldc_handle_t handle) ldcp->id); (void) i_ldc_unregister_channel(ldcp); ldcp->tstate &= ~TS_QCONF_RDY; - (void) hv_ldc_tx_qconf(ldcp->id, NULL, NULL); - (void) hv_ldc_rx_qconf(ldcp->id, NULL, NULL); + (void) hv_ldc_tx_qconf(ldcp->id, 0, 0); + (void) hv_ldc_rx_qconf(ldcp->id, 0, 0); mutex_exit(&ldcp->lock); return (EIO); } @@ -3102,11 +3085,11 @@ ldc_open(ldc_handle_t handle) int ldc_close(ldc_handle_t handle) { - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; int rv = 0, retries = 0; boolean_t chk_done = B_FALSE; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_close: invalid channel handle\n"); return (EINVAL); } @@ -3230,7 +3213,7 @@ ldc_close(ldc_handle_t handle) /* * Unregister queues */ - rv = hv_ldc_tx_qconf(ldcp->id, NULL, NULL); + rv = hv_ldc_tx_qconf(ldcp->id, 0, 0); if (rv) { cmn_err(CE_WARN, "ldc_close: (0x%lx) channel TX queue unconf failed\n", @@ -3239,7 +3222,7 @@ ldc_close(ldc_handle_t handle) mutex_exit(&ldcp->lock); return (EIO); } - rv = hv_ldc_rx_qconf(ldcp->id, NULL, NULL); + rv = hv_ldc_rx_qconf(ldcp->id, 0, 0); if (rv) { cmn_err(CE_WARN, "ldc_close: (0x%lx) channel RX queue unconf failed\n", @@ -3280,7 +3263,7 @@ ldc_reg_callback(ldc_handle_t handle, { ldc_chan_t *ldcp; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_reg_callback: invalid channel handle\n"); return (EINVAL); @@ -3327,7 +3310,7 @@ ldc_unreg_callback(ldc_handle_t handle) { ldc_chan_t *ldcp; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_unreg_callback: invalid channel handle\n"); return (EINVAL); @@ -3373,12 +3356,12 @@ ldc_unreg_callback(ldc_handle_t handle) int ldc_up(ldc_handle_t handle) { - int rv; - ldc_chan_t *ldcp; - ldc_msg_t *ldcmsg; - uint64_t tx_tail, tstate, link_state; + int rv; + ldc_chan_t *ldcp; + ldc_msg_t *ldcmsg; + uint64_t tx_tail, tstate, link_state; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_up: invalid channel handle\n"); return (EINVAL); } @@ -3515,9 +3498,9 @@ ldc_up(ldc_handle_t handle) int ldc_down(ldc_handle_t handle) { - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_down: invalid channel handle\n"); return (EINVAL); } @@ -3539,7 +3522,7 @@ ldc_status(ldc_handle_t handle, ldc_status_t *status) { ldc_chan_t *ldcp; - if (handle == NULL || status == NULL) { + if (handle == 0 || status == NULL) { DWARN(DBG_ALL_LDCS, "ldc_status: invalid argument\n"); return (EINVAL); } @@ -3559,9 +3542,9 @@ ldc_status(ldc_handle_t handle, ldc_status_t *status) int ldc_set_cb_mode(ldc_handle_t handle, ldc_cb_mode_t cmode) { - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_set_intr_mode: invalid channel handle\n"); return (EINVAL); @@ -3613,11 +3596,11 @@ ldc_set_cb_mode(ldc_handle_t handle, ldc_cb_mode_t cmode) int ldc_chkq(ldc_handle_t handle, boolean_t *hasdata) { - int rv; - uint64_t rx_head, rx_tail; - ldc_chan_t *ldcp; + int rv; + uint64_t rx_head, rx_tail; + ldc_chan_t *ldcp; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_chkq: invalid channel handle\n"); return (EINVAL); } @@ -3720,11 +3703,11 @@ ldc_chkq(ldc_handle_t handle, boolean_t *hasdata) int ldc_read(ldc_handle_t handle, caddr_t bufp, size_t *sizep) { - ldc_chan_t *ldcp; - uint64_t rx_head = 0, rx_tail = 0; + ldc_chan_t *ldcp; + uint64_t rx_head = 0, rx_tail = 0; int rv = 0, exit_val; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_read: invalid channel handle\n"); return (EINVAL); } @@ -3809,11 +3792,11 @@ ldc_read(ldc_handle_t handle, caddr_t bufp, size_t *sizep) static int i_ldc_read_raw(ldc_chan_t *ldcp, caddr_t target_bufp, size_t *sizep) { - uint64_t q_size_mask; - ldc_msg_t *msgp; + uint64_t q_size_mask; + ldc_msg_t *msgp; uint8_t *msgbufp; int rv = 0, space; - uint64_t rx_head, rx_tail; + uint64_t rx_head, rx_tail; space = *sizep; @@ -3885,13 +3868,13 @@ static int i_ldc_read_packet(ldc_chan_t *ldcp, caddr_t target_bufp, size_t *sizep) { int rv = 0; - uint64_t rx_head = 0, rx_tail = 0; - uint64_t curr_head = 0; - ldc_msg_t *msg; - caddr_t target; - size_t len = 0, bytes_read = 0; - int retries = 0; - uint64_t q_va, q_size_mask; + uint64_t rx_head = 0, rx_tail = 0; + uint64_t curr_head = 0; + ldc_msg_t *msg; + caddr_t target; + size_t len = 0, bytes_read = 0; + int retries = 0; + uint64_t q_va, q_size_mask; uint64_t first_fragment = 0; target = target_bufp; @@ -4286,7 +4269,7 @@ ldc_write(ldc_handle_t handle, caddr_t buf, size_t *sizep) ldc_chan_t *ldcp; int rv = 0; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_write: invalid channel handle\n"); return (EINVAL); } @@ -4332,8 +4315,8 @@ ldc_write(ldc_handle_t handle, caddr_t buf, size_t *sizep) static int i_ldc_write_raw(ldc_chan_t *ldcp, caddr_t buf, size_t *sizep) { - ldc_msg_t *ldcmsg; - uint64_t tx_head, tx_tail, new_tail; + ldc_msg_t *ldcmsg; + uint64_t tx_head, tx_tail, new_tail; int rv = 0; size_t size; @@ -4463,11 +4446,11 @@ i_ldc_write_raw(ldc_chan_t *ldcp, caddr_t buf, size_t *sizep) static int i_ldc_write_packet(ldc_chan_t *ldcp, caddr_t buf, size_t *size) { - ldc_msg_t *ldcmsg; - uint64_t tx_head, tx_tail, new_tail, start; + ldc_msg_t *ldcmsg; + uint64_t tx_head, tx_tail, new_tail, start; uint64_t txq_size_mask, numavail; - uint8_t *msgbuf, *source = (uint8_t *)buf; - size_t len, bytes_written = 0, remaining; + uint8_t *msgbuf, *source = (uint8_t *)buf; + size_t len, bytes_written = 0, remaining; int rv; uint32_t curr_seqid; @@ -4735,7 +4718,7 @@ ldc_info(ldc_handle_t handle, ldc_info_t *info) ldc_chan_t *ldcp; uint64_t avail; - if (handle == NULL || info == NULL) { + if (handle == 0 || info == NULL) { DWARN(DBG_ALL_LDCS, "ldc_get_info: invalid args\n"); return (EINVAL); } diff --git a/usr/src/uts/sun4v/io/ldc_shm.c b/usr/src/uts/sun4v/io/ldc_shm.c index f35bcdb7f0..f8edd4f845 100644 --- a/usr/src/uts/sun4v/io/ldc_shm.c +++ b/usr/src/uts/sun4v/io/ldc_shm.c @@ -191,10 +191,10 @@ i_ldc_init_mapin(ldc_soft_state_t *ldcssp, uint64_t major, uint64_t minor) int ldc_mem_alloc_handle(ldc_handle_t handle, ldc_mem_handle_t *mhandle) { - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; ldc_mhdl_t *mhdl; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_alloc_handle: invalid channel handle\n"); return (EINVAL); @@ -250,10 +250,10 @@ ldc_mem_alloc_handle(ldc_handle_t handle, ldc_mem_handle_t *mhandle) int ldc_mem_free_handle(ldc_mem_handle_t mhandle) { - ldc_mhdl_t *mhdl, *phdl; - ldc_chan_t *ldcp; + ldc_mhdl_t *mhdl, *phdl; + ldc_chan_t *ldcp; - if (mhandle == NULL) { + if (mhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_free_handle: invalid memory handle\n"); return (EINVAL); @@ -346,7 +346,7 @@ i_ldc_mem_bind_handle(ldc_mem_handle_t mhandle, caddr_t vaddr, size_t len, uint8_t mtype, uint8_t perm, ldc_mem_cookie_t *cookie, uint32_t *ccount) { ldc_mhdl_t *mhdl; - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; ldc_mtbl_t *mtbl; ldc_memseg_t *memseg; ldc_mte_t tmp_mte; @@ -357,9 +357,9 @@ i_ldc_mem_bind_handle(ldc_mem_handle_t mhandle, caddr_t vaddr, size_t len, uint64_t pg_shift, pg_size, pg_size_code, pg_mask; pgcnt_t npages; caddr_t v_align, addr; - int i, rv; + int i, rv; - if (mhandle == NULL) { + if (mhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_bind_handle: invalid memory handle\n"); return (EINVAL); @@ -400,7 +400,7 @@ i_ldc_mem_bind_handle(ldc_mem_handle_t mhandle, caddr_t vaddr, size_t len, mtbl = kmem_zalloc(sizeof (ldc_mtbl_t), KM_SLEEP); mtbl->num_entries = mtbl->num_avail = ldc_maptable_entries; mtbl->size = ldc_maptable_entries * sizeof (ldc_mte_slot_t); - mtbl->next_entry = NULL; + mtbl->next_entry = 0; mtbl->contigmem = B_TRUE; /* Allocate the table itself */ @@ -671,10 +671,10 @@ int ldc_mem_nextcookie(ldc_mem_handle_t mhandle, ldc_mem_cookie_t *cookie) { ldc_mhdl_t *mhdl; - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; ldc_memseg_t *memseg; - if (mhandle == NULL) { + if (mhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_nextcookie: invalid memory handle\n"); return (EINVAL); @@ -727,14 +727,14 @@ int ldc_mem_unbind_handle(ldc_mem_handle_t mhandle) { ldc_mhdl_t *mhdl; - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; ldc_mtbl_t *mtbl; ldc_memseg_t *memseg; uint64_t cookie_addr; uint64_t pg_shift, pg_size_code; int i, rv, retries; - if (mhandle == NULL) { + if (mhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_unbind_handle: invalid memory handle\n"); return (EINVAL); @@ -827,7 +827,7 @@ ldc_mem_info(ldc_mem_handle_t mhandle, ldc_mem_info_t *minfo) { ldc_mhdl_t *mhdl; - if (mhandle == NULL) { + if (mhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_info: invalid memory handle\n"); return (EINVAL); } @@ -862,20 +862,20 @@ int ldc_mem_copy(ldc_handle_t handle, caddr_t vaddr, uint64_t off, size_t *size, ldc_mem_cookie_t *cookies, uint32_t ccount, uint8_t direction) { - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; uint64_t local_voff, local_valign; uint64_t cookie_addr, cookie_size; uint64_t pg_shift, pg_size, pg_size_code; - uint64_t export_caddr, export_poff, export_psize, export_size; + uint64_t export_caddr, export_poff, export_psize, export_size; uint64_t local_ra, local_poff, local_psize; uint64_t copy_size, copied_len = 0, total_bal = 0, idx = 0; pgcnt_t npages; size_t len = *size; - int i, rv = 0; + int i, rv = 0; uint64_t chid; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_copy: invalid channel handle\n"); return (EINVAL); } @@ -984,7 +984,7 @@ ldc_mem_copy(ldc_handle_t handle, caddr_t vaddr, uint64_t off, size_t *size, copy_size, &copied_len); if (rv != 0) { - int error = EIO; + int error = EIO; uint64_t rx_hd, rx_tl; DWARN(chid, @@ -1088,17 +1088,17 @@ int ldc_mem_rdwr_cookie(ldc_handle_t handle, caddr_t vaddr, size_t *size, caddr_t paddr, uint8_t direction) { - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; uint64_t local_voff, local_valign; uint64_t pg_shift, pg_size, pg_size_code; - uint64_t target_pa, target_poff, target_psize, target_size; + uint64_t target_pa, target_poff, target_psize, target_size; uint64_t local_ra, local_poff, local_psize; uint64_t copy_size, copied_len = 0; pgcnt_t npages; size_t len = *size; - int rv = 0; + int rv = 0; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_rdwr_cookie: invalid channel handle\n"); return (EINVAL); @@ -1259,7 +1259,7 @@ i_ldc_mem_map(ldc_mem_handle_t mhandle, ldc_mem_cookie_t *cookie, { int i, j, idx, rv, retries; - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; ldc_mhdl_t *mhdl; ldc_memseg_t *memseg; caddr_t tmpaddr; @@ -1269,7 +1269,7 @@ i_ldc_mem_map(ldc_mem_handle_t mhandle, ldc_mem_cookie_t *cookie, uint64_t cookie_addr, cookie_off, cookie_size; tte_t ldc_tte; - if (mhandle == NULL) { + if (mhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_map: invalid memory handle\n"); return (EINVAL); } @@ -1519,7 +1519,7 @@ ldc_mem_unmap(ldc_mem_handle_t mhandle) { int i, rv; ldc_mhdl_t *mhdl = (ldc_mhdl_t *)mhandle; - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; ldc_memseg_t *memseg; if (mhdl == 0 || mhdl->status != LDC_MAPPED) { @@ -1586,14 +1586,14 @@ static int i_ldc_mem_acquire_release(ldc_mem_handle_t mhandle, uint8_t direction, uint64_t offset, size_t size) { - int err; + int err; ldc_mhdl_t *mhdl; ldc_chan_t *ldcp; ldc_memseg_t *memseg; caddr_t local_vaddr; size_t copy_size; - if (mhandle == NULL) { + if (mhandle == 0) { DWARN(DBG_ALL_LDCS, "i_ldc_mem_acquire_release: invalid memory handle\n"); return (EINVAL); @@ -1691,7 +1691,7 @@ ldc_mem_dring_create(uint32_t len, uint32_t dsize, ldc_dring_handle_t *dhandle) D1(DBG_ALL_LDCS, "ldc_mem_dring_create: len=0x%x, size=0x%x\n", len, dsize); - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_create: invalid dhandle\n"); return (EINVAL); } @@ -1754,7 +1754,7 @@ ldc_mem_dring_destroy(ldc_dring_handle_t dhandle) D1(DBG_ALL_LDCS, "ldc_mem_dring_destroy: entered\n"); - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_destroy: invalid desc ring handle\n"); return (EINVAL); @@ -1822,19 +1822,19 @@ ldc_mem_dring_bind(ldc_handle_t handle, ldc_dring_handle_t dhandle, uint8_t mtype, uint8_t perm, ldc_mem_cookie_t *cookie, uint32_t *ccount) { int err; - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; ldc_dring_t *dringp; ldc_mem_handle_t mhandle; /* check to see if channel is initalized */ - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_bind: invalid channel handle\n"); return (EINVAL); } ldcp = (ldc_chan_t *)handle; - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_bind: invalid desc ring handle\n"); return (EINVAL); @@ -1885,7 +1885,7 @@ ldc_mem_dring_bind(ldc_handle_t handle, ldc_dring_handle_t dhandle, /* create an memory handle */ err = ldc_mem_alloc_handle(handle, &mhandle); - if (err || mhandle == NULL) { + if (err || mhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_bind: (0x%llx) error allocating mhandle\n", ldcp->id); @@ -1914,7 +1914,7 @@ ldc_mem_dring_bind(ldc_handle_t handle, ldc_dring_handle_t dhandle, (void) ldc_mem_free_handle(mhandle); dringp->ldcp = NULL; - dringp->mhdl = NULL; + dringp->mhdl = 0; *ccount = 0; mutex_exit(&dringp->lock); @@ -1941,10 +1941,10 @@ int ldc_mem_dring_nextcookie(ldc_dring_handle_t dhandle, ldc_mem_cookie_t *cookie) { int rv = 0; - ldc_dring_t *dringp; + ldc_dring_t *dringp; ldc_chan_t *ldcp; - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_nextcookie: invalid desc ring handle\n"); return (EINVAL); @@ -1982,11 +1982,11 @@ ldc_mem_dring_nextcookie(ldc_dring_handle_t dhandle, ldc_mem_cookie_t *cookie) int ldc_mem_dring_unbind(ldc_dring_handle_t dhandle) { - ldc_dring_t *dringp; + ldc_dring_t *dringp; ldc_dring_t *tmp_dringp; ldc_chan_t *ldcp; - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_unbind: invalid desc ring handle\n"); return (EINVAL); @@ -2035,7 +2035,7 @@ ldc_mem_dring_unbind(ldc_dring_handle_t dhandle) (void) ldc_mem_free_handle((ldc_mem_handle_t)dringp->mhdl); dringp->ldcp = NULL; - dringp->mhdl = NULL; + dringp->mhdl = 0; dringp->status = LDC_UNBOUND; mutex_exit(&dringp->lock); @@ -2124,7 +2124,7 @@ ldc_mem_dring_info(ldc_dring_handle_t dhandle, ldc_mem_info_t *minfo) ldc_dring_t *dringp; int rv; - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_info: invalid desc ring handle\n"); return (EINVAL); @@ -2143,7 +2143,7 @@ ldc_mem_dring_info(ldc_dring_handle_t dhandle, ldc_mem_info_t *minfo) } } else { minfo->vaddr = dringp->base; - minfo->raddr = NULL; + minfo->raddr = 0; minfo->status = dringp->status; } @@ -2164,19 +2164,19 @@ ldc_mem_dring_map(ldc_handle_t handle, ldc_mem_cookie_t *cookie, ldc_dring_handle_t *dhandle) { int err; - ldc_chan_t *ldcp = (ldc_chan_t *)handle; + ldc_chan_t *ldcp = (ldc_chan_t *)handle; ldc_mem_handle_t mhandle; ldc_dring_t *dringp; size_t dring_size; - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_map: invalid dhandle\n"); return (EINVAL); } /* check to see if channel is initalized */ - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_map: invalid channel handle\n"); return (EINVAL); @@ -2234,7 +2234,7 @@ ldc_mem_dring_map(ldc_handle_t handle, ldc_mem_cookie_t *cookie, /* create an memory handle */ err = ldc_mem_alloc_handle(handle, &mhandle); - if (err || mhandle == NULL) { + if (err || mhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_map: cannot alloc hdl err=%d\n", err); @@ -2278,11 +2278,11 @@ ldc_mem_dring_map(ldc_handle_t handle, ldc_mem_cookie_t *cookie, int ldc_mem_dring_unmap(ldc_dring_handle_t dhandle) { - ldc_dring_t *dringp; + ldc_dring_t *dringp; ldc_dring_t *tmp_dringp; ldc_chan_t *ldcp; - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_unmap: invalid desc ring handle\n"); return (EINVAL); @@ -2356,14 +2356,14 @@ static int i_ldc_dring_acquire_release(ldc_dring_handle_t dhandle, uint8_t direction, uint64_t start, uint64_t end) { - int err; + int err; ldc_dring_t *dringp; ldc_chan_t *ldcp; ldc_mhdl_t *mhdl; uint64_t soff; size_t copy_size; - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "i_ldc_dring_acquire_release: invalid desc ring handle\n"); return (EINVAL); diff --git a/usr/src/uts/sun4v/io/mdeg.c b/usr/src/uts/sun4v/io/mdeg.c index 18441c2e3c..687ace384b 100644 --- a/usr/src/uts/sun4v/io/mdeg.c +++ b/usr/src/uts/sun4v/io/mdeg.c @@ -67,7 +67,7 @@ typedef struct mdeg_clnt { * held when modifying any client information. */ static struct mdeg { - taskq_t *taskq; /* for internal processing */ + taskq_t *taskq; /* for internal processing */ boolean_t enabled; /* enable/disable taskq processing */ kmutex_t lock; /* synchronize MD updates */ md_t *md_prev; /* previous MD */ @@ -94,8 +94,8 @@ static void mdeg_dump_table(void); #else /* DEBUG */ #define MDEG_DBG _NOTE(CONSTCOND) if (0) printf -#define MDEG_DUMP_CLNT -#define MDEG_DUMP_TABLE() +#define MDEG_DUMP_CLNT(...) +#define MDEG_DUMP_TABLE(...) #endif /* DEBUG */ @@ -334,7 +334,7 @@ mdeg_notify_client_reg(mdeg_clnt_t *clnt) */ if (clnt->pspec == NULL) { /* call the client callback */ - (*clnt->cb)(clnt->cb_arg, NULL); + (void) (*clnt->cb)(clnt->cb_arg, NULL); goto done; } @@ -387,7 +387,7 @@ mdeg_notify_client_reg(mdeg_clnt_t *clnt) mdeg_res->added.nelem = nnodes; /* call the client callback */ - (*clnt->cb)(clnt->cb_arg, mdeg_res); + (void) (*clnt->cb)(clnt->cb_arg, mdeg_res); done: mutex_exit(&mdeg.lock); @@ -602,7 +602,7 @@ mdeg_notify_client(void *arg) */ if (clnt->pspec == NULL) { /* call the client callback */ - (*clnt->cb)(clnt->cb_arg, NULL); + (void) (*clnt->cb)(clnt->cb_arg, NULL); MDEG_DBG("MDEG client callback done\n"); goto cleanup; @@ -634,7 +634,7 @@ mdeg_notify_client(void *arg) mdeg_get_diff_results(mdd, &mdeg_res); /* call the client callback */ - (*clnt->cb)(clnt->cb_arg, &mdeg_res); + (void) (*clnt->cb)(clnt->cb_arg, &mdeg_res); MDEG_DBG("MDEG client callback done\n"); @@ -658,13 +658,13 @@ mdeg_find_start_node(md_t *md, mdeg_node_spec_t *nspec) nname = md_find_name(md, nspec->namep); aname = md_find_name(md, "fwd"); - nnodes = md_scan_dag(md, NULL, nname, aname, NULL); + nnodes = md_scan_dag(md, 0, nname, aname, NULL); if (nnodes == 0) return (MDE_INVAL_ELEM_COOKIE); nodesp = kmem_alloc(sizeof (mde_cookie_t) * nnodes, KM_SLEEP); - (void) md_scan_dag(md, NULL, nname, aname, nodesp); + (void) md_scan_dag(md, 0, nname, aname, nodesp); for (idx = 0; idx < nnodes; idx++) { diff --git a/usr/src/uts/sun4v/io/n2piupc/n2piupc.h b/usr/src/uts/sun4v/io/n2piupc/n2piupc.h index b9c224618f..689d0c5ef5 100644 --- a/usr/src/uts/sun4v/io/n2piupc/n2piupc.h +++ b/usr/src/uts/sun4v/io/n2piupc/n2piupc.h @@ -31,8 +31,6 @@ * Definitions which deal with things other than registers. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -65,8 +63,8 @@ extern int n2piupc_debug; #define N2PIUPC_DBG1 if (n2piupc_debug >= 1) printf #define N2PIUPC_DBG2 if (n2piupc_debug >= 2) printf #else -#define N2PIUPC_DBG1 0 && -#define N2PIUPC_DBG2 0 && +#define N2PIUPC_DBG1(...) +#define N2PIUPC_DBG2(...) #endif /* DEBUG */ diff --git a/usr/src/uts/sun4v/io/n2piupc/n2piupc_kstats.c b/usr/src/uts/sun4v/io/n2piupc/n2piupc_kstats.c index 0b22142ea2..6881d58a20 100644 --- a/usr/src/uts/sun4v/io/n2piupc/n2piupc_kstats.c +++ b/usr/src/uts/sun4v/io/n2piupc/n2piupc_kstats.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/kstat.h> #include "n2piupc_acc.h" @@ -68,7 +66,7 @@ n2piupc_kstat_init() /* Create basic pic event-type pair. */ grp_p->name_kstats_pp = kmem_zalloc((grp_p->num_counters * - sizeof (kstat_t)), KM_SLEEP); + sizeof (kstat_t)), KM_SLEEP); if (n2piupc_create_name_kstat(grp_p) != DDI_SUCCESS) { n2piupc_kstat_fini(); N2PIUPC_DBG1("n2piupc: init: failure exit\n"); @@ -183,7 +181,7 @@ n2piupc_create_picN_kstat(char *mod_name, int pic, uint64_t ev_offset, (void) snprintf(pic_name, PIC_STR_LEN, "pic%1d", pic); if ((picN_ksp = kstat_create(mod_name, 0, pic_name, - "bus", KSTAT_TYPE_NAMED, num_ev, NULL)) == NULL) { + "bus", KSTAT_TYPE_NAMED, num_ev, 0)) == NULL) { cmn_err(CE_WARN, "%s %s : kstat create failed", mod_name, pic_name); return (NULL); diff --git a/usr/src/uts/sun4v/io/niumx/niumx.c b/usr/src/uts/sun4v/io/niumx/niumx.c index b455d287e6..76b30a3804 100644 --- a/usr/src/uts/sun4v/io/niumx/niumx.c +++ b/usr/src/uts/sun4v/io/niumx/niumx.c @@ -97,19 +97,19 @@ static struct bus_ops niumx_bus_ops = { 0, niumx_ctlops, ddi_bus_prop_op, - 0, /* (*bus_get_eventcookie)(); */ + 0, /* (*bus_get_eventcookie)(); */ 0, /* (*bus_add_eventcall)(); */ - 0, /* (*bus_remove_eventcall)(); */ + 0, /* (*bus_remove_eventcall)(); */ 0, /* (*bus_post_event)(); */ 0, /* (*bus_intr_ctl)(); */ - 0, /* (*bus_config)(); */ - 0, /* (*bus_unconfig)(); */ - niumx_fm_init_child, /* (*bus_fm_init)(); */ - 0, /* (*bus_fm_fini)(); */ + 0, /* (*bus_config)(); */ + 0, /* (*bus_unconfig)(); */ + niumx_fm_init_child, /* (*bus_fm_init)(); */ + 0, /* (*bus_fm_fini)(); */ 0, /* (*bus_enter)() */ 0, /* (*bus_exit)() */ 0, /* (*bus_power)() */ - niumx_intr_ops /* (*bus_intr_op)(); */ + niumx_intr_ops /* (*bus_intr_op)(); */ }; extern struct cb_ops niumx_cb_ops; @@ -199,7 +199,7 @@ void niumx_intr_dist(void *arg) { niumx_devstate_t *niumxds_p = (niumx_devstate_t *)arg; - kmutex_t *lock_p = &niumxds_p->niumx_mutex; + kmutex_t *lock_p = &niumxds_p->niumx_mutex; int i; niumx_ih_t *ih_p = niumxds_p->niumx_ihtable; @@ -367,13 +367,13 @@ niumx_fm_init_child(dev_info_t *dip, dev_info_t *cdip, int cap, /*ARGSUSED*/ int niumx_map(dev_info_t *dip, dev_info_t *rdip, ddi_map_req_t *mp, - off_t offset, off_t len, caddr_t *vaddrp) + off_t offset, off_t len, caddr_t *vaddrp) { struct regspec p_regspec; ddi_map_req_t p_mapreq; - niu_regspec_t *reg_p; - int i, rn = mp->map_obj.rnumber, reglen, rnglen, rngnum, ret; - niumx_ranges_t *rng_p; + niu_regspec_t *reg_p; + int i, rn = mp->map_obj.rnumber, reglen, rnglen, rngnum, ret; + niumx_ranges_t *rng_p; uint32_t reg_begin, rng_begin; @@ -453,7 +453,7 @@ err: */ int niumx_ctlops(dev_info_t *dip, dev_info_t *rdip, - ddi_ctl_enum_t ctlop, void *arg, void *result) + ddi_ctl_enum_t ctlop, void *arg, void *result) { niu_regspec_t *reg_p; int reglen, totreg; @@ -644,7 +644,7 @@ niumx_removechild(dev_info_t *dip) /*ARGSUSED*/ int niumx_dma_allochdl(dev_info_t *dip, dev_info_t *rdip, ddi_dma_attr_t *attrp, - int (*waitfp)(caddr_t), caddr_t arg, ddi_dma_handle_t *handlep) + int (*waitfp)(caddr_t), caddr_t arg, ddi_dma_handle_t *handlep) { ddi_dma_impl_t *mp; int sleep = (waitfp == DDI_DMA_SLEEP) ? KM_SLEEP : KM_NOSLEEP; @@ -671,7 +671,7 @@ niumx_dma_allochdl(dev_info_t *dip, dev_info_t *rdip, ddi_dma_attr_t *attrp, mp->dmai_fault_check = NULL; mp->dmai_fault_notify = NULL; - mp->dmai_attr = *attrp; /* set requestors attr info */ + mp->dmai_attr = *attrp; /* set requestors attr info */ DBG(NIUMX_DBG_DMA_ALLOCH, dip, "mp=%p\n", mp); @@ -714,16 +714,16 @@ niumx_dma_freehdl(dev_info_t *dip, dev_info_t *rdip, ddi_dma_handle_t handle) * dma handle members affected (set on exit): * mp->dmai_object - dmareq->dmar_object * mp->dmai_rflags - dmareq->dmar_flags - * mp->dmai_pfn0 - 1st page pfn (if va/size pair and not shadow) - * mp->dmai_roffset - initialized to starting page offset + * mp->dmai_pfn0 - 1st page pfn (if va/size pair and not shadow) + * mp->dmai_roffset - initialized to starting page offset * mp->dmai_size - # of total pages of entire object * mp->dmai_cookie - new cookie alloc'd */ /*ARGSUSED*/ int niumx_dma_bindhdl(dev_info_t *dip, dev_info_t *rdip, - ddi_dma_handle_t handle, ddi_dma_req_t *dmareq, - ddi_dma_cookie_t *cookiep, uint_t *ccountp) + ddi_dma_handle_t handle, ddi_dma_req_t *dmareq, + ddi_dma_cookie_t *cookiep, uint_t *ccountp) { int (*waitfp)(caddr_t) = dmareq->dmar_fp; ddi_dma_impl_t *mp = (ddi_dma_impl_t *)handle; @@ -921,7 +921,7 @@ niumx_set_intr(dev_info_t *dip, dev_info_t *rdip, int ret = DDI_SUCCESS; uint64_t hvret; niumx_devstate_t *niumxds_p; /* devstate pointer */ - int instance = ddi_get_instance(dip); + int instance = ddi_get_instance(dip); niumxds_p = (niumx_devstate_t *)ddi_get_soft_state(niumx_state, instance); @@ -1142,7 +1142,7 @@ niumx_rem_intr(dev_info_t *dip, dev_info_t *rdip, niumx_ih_t *ih_p; int ret = DDI_SUCCESS, state; hrtime_t start; - niusysino_t sysino; + niusysino_t sysino; niumx_devstate_t *niumxds_p; /* devstate pointer */ int instance = ddi_get_instance(dip); @@ -1175,7 +1175,8 @@ niumx_rem_intr(dev_info_t *dip, dev_info_t *rdip, ih_p->ih_sysino = 0; hdlp->ih_vector = (uint32_t)sysino; - if (hdlp->ih_vector != NULL) i_ddi_rem_ivintr(hdlp); + if (hdlp->ih_vector != 0) + i_ddi_rem_ivintr(hdlp); fail: return (ret); diff --git a/usr/src/uts/sun4v/io/ntwdt.c b/usr/src/uts/sun4v/io/ntwdt.c index 5dcace595a..ac11471533 100644 --- a/usr/src/uts/sun4v/io/ntwdt.c +++ b/usr/src/uts/sun4v/io/ntwdt.c @@ -314,7 +314,7 @@ ntwdt_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) * is initialized. */ if (ddi_create_minor_node(dip, NTWDT_MINOR_NODE, S_IFCHR, 0, - DDI_PSEUDO, NULL) == DDI_FAILURE) { + DDI_PSEUDO, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "failed to create Minor Node: %s", NTWDT_MINOR_NODE); goto err3; @@ -466,7 +466,7 @@ ntwdt_close(dev_t dev, int flag, int otyp, cred_t *credp) /*ARGSUSED*/ static int ntwdt_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { int instance = getminor(dev); int retval = 0; diff --git a/usr/src/uts/sun4v/io/vlds.c b/usr/src/uts/sun4v/io/vlds.c index a33978680e..e630328f0d 100644 --- a/usr/src/uts/sun4v/io/vlds.c +++ b/usr/src/uts/sun4v/io/vlds.c @@ -327,7 +327,7 @@ vlds_attach(dev_info_t *devi, ddi_attach_cmd_t cmd) } if (ddi_create_minor_node(devi, VLDS_NAME, S_IFCHR, - 0, DDI_PSEUDO, NULL) == DDI_FAILURE) { + 0, DDI_PSEUDO, 0) == DDI_FAILURE) { ddi_remove_minor_node(devi, NULL); return (DDI_FAILURE); } diff --git a/usr/src/uts/sun4v/io/vnet.c b/usr/src/uts/sun4v/io/vnet.c index 96fb04175d..8abeaf911b 100644 --- a/usr/src/uts/sun4v/io/vnet.c +++ b/usr/src/uts/sun4v/io/vnet.c @@ -2481,7 +2481,7 @@ vnet_rx_ring_stat(mac_ring_driver_t rdriver, uint_t stat, uint64_t *val) macp = &vresp->macreg; cbp = macp->m_callbacks; - cbp->mc_getstat(macp->m_driver, stat, val); + (void) cbp->mc_getstat(macp->m_driver, stat, val); return (0); } diff --git a/usr/src/uts/sun4v/io/vnet_gen.c b/usr/src/uts/sun4v/io/vnet_gen.c index c872b641c6..ae89f44a33 100644 --- a/usr/src/uts/sun4v/io/vnet_gen.c +++ b/usr/src/uts/sun4v/io/vnet_gen.c @@ -297,7 +297,7 @@ static char vgen_linkprop_propname[] = "linkprop"; * 1.3 VLAN and HybridIO support. * 1.4 Jumbo Frame support. * 1.5 Link State Notification support with optional support - * for Physical Link information. + * for Physical Link information. * 1.6 Support for RxDringData mode. */ static vgen_ver_t vgen_versions[VGEN_NUM_VER] = { {1, 6} }; @@ -697,7 +697,7 @@ vgen_tx(void *arg, mblk_t *mp) */ static mblk_t * vgen_vlan_frame_fixtag(vgen_port_t *portp, mblk_t *mp, boolean_t is_tagged, - uint16_t vid) + uint16_t vid) { vgen_t *vgenp; boolean_t dst_tagged; @@ -781,8 +781,8 @@ vgen_portsend(vgen_port_t *portp, mblk_t *mp) vgen_ldc_t *ldcp; int status; int rv = VGEN_SUCCESS; - vgen_t *vgenp = portp->vgenp; - vnet_t *vnetp = vgenp->vnetp; + vgen_t *vgenp; + vnet_t *vnetp; boolean_t is_tagged; boolean_t dec_refcnt = B_FALSE; uint16_t vlan_id; @@ -792,6 +792,9 @@ vgen_portsend(vgen_port_t *portp, mblk_t *mp) return (VGEN_FAILURE); } + vgenp = portp->vgenp; + vnetp = vgenp->vnetp; + if (portp->use_vsw_port) { (void) atomic_inc_32(&vgenp->vsw_port_refcnt); portp = portp->vgenp->vsw_portp; @@ -1396,8 +1399,8 @@ vgen_readmd_exit: */ static void vgen_vlan_read_ids(void *arg, int type, md_t *mdp, mde_cookie_t node, - uint16_t *pvidp, uint16_t **vidspp, uint16_t *nvidsp, - uint16_t *default_idp) + uint16_t *pvidp, uint16_t **vidspp, uint16_t *nvidsp, + uint16_t *default_idp) { vgen_t *vgenp; vnet_t *vnetp; @@ -1686,7 +1689,7 @@ vgen_mtu_read(vgen_t *vgenp, md_t *mdp, mde_cookie_t node, uint32_t *mtu) static void vgen_linkprop_read(vgen_t *vgenp, md_t *mdp, mde_cookie_t node, - boolean_t *pls) + boolean_t *pls) { int rv; uint64_t val; @@ -1714,8 +1717,8 @@ vgen_mdeg_reg(vgen_t *vgenp) mdeg_node_spec_t *parentp; uint_t templatesz; int rv; - mdeg_handle_t dev_hdl = NULL; - mdeg_handle_t port_hdl = NULL; + mdeg_handle_t dev_hdl = 0; + mdeg_handle_t port_hdl = 0; templatesz = sizeof (vgen_prop_template); pspecp = kmem_zalloc(templatesz, KM_NOSLEEP); @@ -1767,7 +1770,7 @@ vgen_mdeg_reg(vgen_t *vgenp) return (DDI_SUCCESS); mdeg_reg_fail: - if (dev_hdl != NULL) { + if (dev_hdl != 0) { (void) mdeg_unregister(dev_hdl); } KMEM_FREE(parentp); @@ -1780,13 +1783,13 @@ mdeg_reg_fail: static void vgen_mdeg_unreg(vgen_t *vgenp) { - if (vgenp->mdeg_dev_hdl != NULL) { + if (vgenp->mdeg_dev_hdl != 0) { (void) mdeg_unregister(vgenp->mdeg_dev_hdl); - vgenp->mdeg_dev_hdl = NULL; + vgenp->mdeg_dev_hdl = 0; } - if (vgenp->mdeg_port_hdl != NULL) { + if (vgenp->mdeg_port_hdl != 0) { (void) mdeg_unregister(vgenp->mdeg_port_hdl); - vgenp->mdeg_port_hdl = NULL; + vgenp->mdeg_port_hdl = 0; } if (vgenp->mdeg_parentp != NULL) { @@ -1803,7 +1806,7 @@ vgen_mdeg_port_cb(void *cb_argp, mdeg_result_t *resp) { int idx; int vsw_idx = -1; - uint64_t val; + uint64_t val; vgen_t *vgenp; if ((resp == NULL) || (cb_argp == NULL)) { @@ -2108,7 +2111,7 @@ vgen_add_port(vgen_t *vgenp, md_t *mdp, mde_cookie_t mdex) /* read properties of the port from its md node */ static int vgen_port_read_props(vgen_port_t *portp, vgen_t *vgenp, md_t *mdp, - mde_cookie_t mdex) + mde_cookie_t mdex) { uint64_t port_num; uint64_t *ldc_ids; @@ -2362,7 +2365,7 @@ vgen_port_detach_mdeg(vgen_port_t *portp) static int vgen_update_port(vgen_t *vgenp, md_t *curr_mdp, mde_cookie_t curr_mdex, - md_t *prev_mdp, mde_cookie_t prev_mdex) + md_t *prev_mdp, mde_cookie_t prev_mdex) { uint64_t cport_num; uint64_t pport_num; @@ -2454,10 +2457,10 @@ vgen_port_stat(vgen_port_t *portp, uint_t stat) static int vgen_ldc_attach(vgen_port_t *portp, uint64_t ldc_id) { - vgen_t *vgenp; - vgen_ldc_t *ldcp; - ldc_attr_t attr; - int status; + vgen_t *vgenp; + vgen_ldc_t *ldcp; + ldc_attr_t attr; + int status; ldc_status_t istatus; char kname[MAXNAMELEN]; int instance; @@ -2567,7 +2570,7 @@ static void vgen_ldc_detach(vgen_ldc_t *ldcp) { vgen_port_t *portp; - vgen_t *vgenp; + vgen_t *vgenp; ASSERT(ldcp != NULL); @@ -3000,7 +3003,7 @@ vgen_ldc_cb(uint64_t event, caddr_t arg) _NOTE(ARGUNUSED(event)) vgen_ldc_t *ldcp; vgen_t *vgenp; - ldc_status_t istatus; + ldc_status_t istatus; vgen_stats_t *statsp; uint_t ret = LDC_SUCCESS; @@ -3012,7 +3015,7 @@ vgen_ldc_cb(uint64_t event, caddr_t arg) mutex_enter(&ldcp->cblock); statsp->callbacks++; - if ((ldcp->ldc_status == LDC_INIT) || (ldcp->ldc_handle == NULL)) { + if ((ldcp->ldc_status == LDC_INIT) || (ldcp->ldc_handle == 0)) { DWARN(vgenp, ldcp, "status(%d) is LDC_INIT\n", ldcp->ldc_status); mutex_exit(&ldcp->cblock); @@ -3111,8 +3114,8 @@ vgen_handle_evt_read(vgen_ldc_t *ldcp, vgen_caller_t caller) size_t msglen; vgen_t *vgenp = LDC_TO_VGEN(ldcp); vio_msg_tag_t *tagp; - ldc_status_t istatus; - boolean_t has_data; + ldc_status_t istatus; + boolean_t has_data; DBG1(vgenp, ldcp, "enter\n"); @@ -4227,7 +4230,7 @@ vgen_handshake_done(vgen_ldc_t *ldcp) { vgen_t *vgenp = LDC_TO_VGEN(ldcp); uint32_t hphase = ldcp->hphase; - int status = 0; + int status = 0; switch (hphase) { @@ -5724,7 +5727,7 @@ vgen_check_sid(vgen_ldc_t *ldcp, vio_msg_tag_t *tagp) */ static void vgen_init_dring_reg_msg(vgen_ldc_t *ldcp, vio_dring_reg_msg_t *msg, - uint8_t option) + uint8_t option) { vio_msg_tag_t *tagp; diff --git a/usr/src/uts/sun4v/io/vsw.c b/usr/src/uts/sun4v/io/vsw.c index 6ec8f997bd..1c4738d3e6 100644 --- a/usr/src/uts/sun4v/io/vsw.c +++ b/usr/src/uts/sun4v/io/vsw.c @@ -747,7 +747,7 @@ static int vsw_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) { vsw_t **vswpp, *vswp; - int instance; + int instance; instance = ddi_get_instance(dip); vswp = ddi_get_soft_state(vsw_state, instance); @@ -1435,8 +1435,8 @@ mdeg_reg_fail: kmem_free(pspecp, templatesz); kmem_free(inst_specp, sizeof (mdeg_node_spec_t)); - vswp->mdeg_hdl = NULL; - vswp->mdeg_port_hdl = NULL; + vswp->mdeg_hdl = 0; + vswp->mdeg_port_hdl = 0; return (1); } @@ -1446,10 +1446,10 @@ vsw_mdeg_unregister(vsw_t *vswp) { D1(vswp, "vsw_mdeg_unregister: enter"); - if (vswp->mdeg_hdl != NULL) + if (vswp->mdeg_hdl != 0) (void) mdeg_unregister(vswp->mdeg_hdl); - if (vswp->mdeg_port_hdl != NULL) + if (vswp->mdeg_port_hdl != 0) (void) mdeg_unregister(vswp->mdeg_port_hdl); if (vswp->inst_spec != NULL) { @@ -1812,8 +1812,8 @@ vsw_get_initial_md_properties(vsw_t *vswp, md_t *mdp, mde_cookie_t node) */ static void vsw_vlan_read_ids(void *arg, int type, md_t *mdp, mde_cookie_t node, - uint16_t *pvidp, vsw_vlanid_t **vidspp, uint16_t *nvidsp, - uint16_t *default_idp) + uint16_t *pvidp, vsw_vlanid_t **vidspp, uint16_t *nvidsp, + uint16_t *default_idp) { vsw_t *vswp; vsw_port_t *portp; @@ -2054,7 +2054,7 @@ vsw_mtu_update(vsw_t *vswp, uint32_t mtu) static void vsw_linkprop_read(vsw_t *vswp, md_t *mdp, mde_cookie_t node, - boolean_t *pls) + boolean_t *pls) { int rv; uint64_t val; @@ -2134,7 +2134,7 @@ vsw_update_md_prop(vsw_t *vswp, md_t *mdp, mde_cookie_t node) uint_t ddi_instance; uint8_t new_smode; int i; - uint64_t macaddr = 0; + uint64_t macaddr = 0; enum {MD_init = 0x1, MD_physname = 0x2, MD_macaddr = 0x4, @@ -2449,7 +2449,7 @@ fail_update: */ static int vsw_port_read_props(vsw_port_t *portp, vsw_t *vswp, - md_t *mdp, mde_cookie_t *node) + md_t *mdp, mde_cookie_t *node) { uint64_t ldc_id; uint8_t *addrp; @@ -2597,7 +2597,7 @@ vsw_port_add(vsw_t *vswp, md_t *mdp, mde_cookie_t *node) static int vsw_port_update(vsw_t *vswp, md_t *curr_mdp, mde_cookie_t curr_mdex, - md_t *prev_mdp, mde_cookie_t prev_mdex) + md_t *prev_mdp, mde_cookie_t prev_mdex) { uint64_t cport_num; uint64_t pport_num; diff --git a/usr/src/uts/sun4v/io/vsw_ldc.c b/usr/src/uts/sun4v/io/vsw_ldc.c index ee651e692b..099bb2b42d 100644 --- a/usr/src/uts/sun4v/io/vsw_ldc.c +++ b/usr/src/uts/sun4v/io/vsw_ldc.c @@ -279,7 +279,7 @@ extern uint32_t vsw_nrbufs_factor; * 1.3 VLAN and HybridIO support. * 1.4 Jumbo Frame support. * 1.5 Link State Notification support with optional support - * for Physical Link information. + * for Physical Link information. * 1.6 Support for RxDringData mode. */ static ver_sup_t vsw_versions[] = { {1, 6} }; @@ -471,7 +471,7 @@ vsw_port_detach(vsw_t *vswp, int p_instance) void vsw_detach_ports(vsw_t *vswp) { - vsw_port_list_t *plist = &vswp->plist; + vsw_port_list_t *plist = &vswp->plist; vsw_port_t *port = NULL; D1(vswp, "%s: enter", __func__); @@ -562,11 +562,11 @@ vsw_port_delete(vsw_port_t *port) static int vsw_ldc_attach(vsw_port_t *port, uint64_t ldc_id) { - vsw_t *vswp = port->p_vswp; - vsw_ldc_t *ldcp = NULL; - ldc_attr_t attr; + vsw_t *vswp = port->p_vswp; + vsw_ldc_t *ldcp = NULL; + ldc_attr_t attr; ldc_status_t istatus; - int status = DDI_FAILURE; + int status = DDI_FAILURE; char kname[MAXNAMELEN]; enum { PROG_init = 0x0, PROG_callback = 0x1, @@ -719,8 +719,8 @@ ldc_attach_fail: static void vsw_ldc_detach(vsw_ldc_t *ldcp) { - int rv; - vsw_t *vswp = ldcp->ldc_port->p_vswp; + int rv; + vsw_t *vswp = ldcp->ldc_port->p_vswp; int retries = 0; D2(vswp, "%s: detaching channel %lld", __func__, ldcp->ldc_id); @@ -773,7 +773,7 @@ vsw_ldc_detach(vsw_ldc_t *ldcp) (void) ldc_fini(ldcp->ldc_handle); ldcp->ldc_status = LDC_INIT; - ldcp->ldc_handle = NULL; + ldcp->ldc_handle = 0; ldcp->ldc_vswp = NULL; mutex_destroy(&ldcp->msg_thr_lock); @@ -800,7 +800,7 @@ vsw_ldc_detach(vsw_ldc_t *ldcp) static int vsw_ldc_init(vsw_ldc_t *ldcp) { - vsw_t *vswp = ldcp->ldc_vswp; + vsw_t *vswp = ldcp->ldc_vswp; ldc_status_t istatus = 0; int rv; @@ -1238,7 +1238,7 @@ static uint_t vsw_ldc_cb(uint64_t event, caddr_t arg) { vsw_ldc_t *ldcp = (vsw_ldc_t *)arg; - vsw_t *vswp = ldcp->ldc_vswp; + vsw_t *vswp = ldcp->ldc_vswp; D1(vswp, "%s: enter: ldcid (%lld)\n", __func__, ldcp->ldc_id); @@ -1246,7 +1246,7 @@ vsw_ldc_cb(uint64_t event, caddr_t arg) ldcp->ldc_stats.callbacks++; mutex_enter(&ldcp->status_lock); - if ((ldcp->ldc_status == LDC_INIT) || (ldcp->ldc_handle == NULL)) { + if ((ldcp->ldc_status == LDC_INIT) || (ldcp->ldc_handle == 0)) { mutex_exit(&ldcp->status_lock); mutex_exit(&ldcp->ldc_cblock); return (LDC_SUCCESS); @@ -2075,11 +2075,11 @@ void vsw_process_pkt(void *arg) { vsw_ldc_t *ldcp = (vsw_ldc_t *)arg; - vsw_t *vswp = ldcp->ldc_vswp; + vsw_t *vswp = ldcp->ldc_vswp; size_t msglen; vio_msg_tag_t *tagp; uint64_t *ldcmsg; - int rv = 0; + int rv = 0; D1(vswp, "%s enter: ldcid (%lld)\n", __func__, ldcp->ldc_id); @@ -2145,7 +2145,7 @@ vsw_process_pkt(void *arg) */ static void vsw_dispatch_ctrl_task(vsw_ldc_t *ldcp, void *cpkt, vio_msg_tag_t *tagp, - int msglen) + int msglen) { vsw_ctrl_task_t *ctaskp = NULL; vsw_port_t *port = ldcp->ldc_port; @@ -2221,7 +2221,7 @@ vsw_process_ctrl_pkt(void *arg) { vsw_ctrl_task_t *ctaskp = (vsw_ctrl_task_t *)arg; vsw_ldc_t *ldcp = ctaskp->ldcp; - vsw_t *vswp = ldcp->ldc_vswp; + vsw_t *vswp = ldcp->ldc_vswp; vio_msg_tag_t tag; uint16_t env; @@ -2305,7 +2305,7 @@ void vsw_process_ctrl_ver_pkt(vsw_ldc_t *ldcp, void *pkt) { vio_ver_msg_t *ver_pkt; - vsw_t *vswp = ldcp->ldc_vswp; + vsw_t *vswp = ldcp->ldc_vswp; D1(vswp, "%s(%lld): enter", __func__, ldcp->ldc_id); @@ -3362,7 +3362,7 @@ vsw_process_physlink_msg(vsw_ldc_t *ldcp, void *pkt) static void vsw_process_data_pkt(vsw_ldc_t *ldcp, void *dpkt, vio_msg_tag_t *tagp, - uint32_t msglen) + uint32_t msglen) { uint16_t env = tagp->vio_subtype_env; vsw_t *vswp = ldcp->ldc_vswp; @@ -3747,7 +3747,7 @@ vsw_portsend(vsw_port_t *port, mblk_t *mp) { mblk_t *mpt; int count; - vsw_ldc_t *ldcp = port->ldcp; + vsw_ldc_t *ldcp = port->ldcp; int status = 0; count = vsw_vlan_frame_untag(port, VSW_VNETPORT, &mp, &mpt); @@ -3763,7 +3763,7 @@ vsw_portsend(vsw_port_t *port, mblk_t *mp) * priority frames is also counted and returned. * * Params: - * vswp: pointer to the instance of vsw + * vswp: pointer to the instance of vsw * np: head of packet chain to be broken * npt: tail of packet chain to be broken * @@ -3775,7 +3775,7 @@ vsw_portsend(vsw_port_t *port, mblk_t *mp) */ static uint32_t vsw_get_pri_packets(vsw_t *vswp, mblk_t **np, mblk_t **npt, - mblk_t **hp, mblk_t **hpt) + mblk_t **hp, mblk_t **hpt) { mblk_t *tmp = NULL; mblk_t *smp = NULL; @@ -3840,7 +3840,7 @@ vsw_get_pri_packets(vsw_t *vswp, mblk_t **np, mblk_t **npt, static int vsw_ldctx_pri(void *arg, mblk_t *mp, mblk_t *mpt, uint32_t count) { - vsw_ldc_t *ldcp = (vsw_ldc_t *)arg; + vsw_ldc_t *ldcp = (vsw_ldc_t *)arg; mblk_t *tmp; mblk_t *smp; mblk_t *hmp; /* high prio pkts head */ @@ -3884,7 +3884,7 @@ vsw_ldctx_pri(void *arg, mblk_t *mp, mblk_t *mpt, uint32_t count) static int vsw_ldctx(void *arg, mblk_t *mp, mblk_t *mpt, uint32_t count) { - vsw_ldc_t *ldcp = (vsw_ldc_t *)arg; + vsw_ldc_t *ldcp = (vsw_ldc_t *)arg; mblk_t *tmp = NULL; ASSERT(count != 0); @@ -3952,7 +3952,7 @@ vsw_ldcsend_pkt(vsw_ldc_t *ldcp, mblk_t *mp) vgen_stats_t *statsp = &ldcp->ldc_stats; if ((!(ldcp->lane_out.lstate & VSW_LANE_ACTIVE)) || - (ldcp->ldc_status != LDC_UP) || (ldcp->ldc_handle == NULL)) { + (ldcp->ldc_status != LDC_UP) || (ldcp->ldc_handle == 0)) { (void) atomic_inc_32(&statsp->tx_pri_fail); DWARN(vswp, "%s(%lld) status(%d) lstate(0x%llx), dropping " "packet\n", __func__, ldcp->ldc_id, ldcp->ldc_status, @@ -4121,7 +4121,7 @@ vsw_descrsend(vsw_ldc_t *ldcp, mblk_t *mp) ASSERT(mp != NULL); if ((!(ldcp->lane_out.lstate & VSW_LANE_ACTIVE)) || - (ldcp->ldc_status != LDC_UP) || (ldcp->ldc_handle == NULL)) { + (ldcp->ldc_status != LDC_UP) || (ldcp->ldc_handle == 0)) { DERR(vswp, "%s(%lld) status(%d) state (0x%llx), dropping pkt", __func__, ldcp->ldc_id, ldcp->ldc_status, ldcp->lane_out.lstate); @@ -4566,7 +4566,7 @@ vsw_map_dring_cmn(vsw_ldc_t *ldcp, vio_dring_reg_msg_t *dring_pkt) return (dp); fail: - if (dp->dring_handle != NULL) { + if (dp->dring_handle != 0) { (void) ldc_mem_dring_unmap(dp->dring_handle); } kmem_free(dp, sizeof (*dp)); @@ -4836,9 +4836,9 @@ display_state(void) { vsw_t *vswp; vsw_port_list_t *plist; - vsw_port_t *port; - vsw_ldc_t *ldcp; - extern vsw_t *vsw_head; + vsw_port_t *port; + vsw_ldc_t *ldcp; + extern vsw_t *vsw_head; cmn_err(CE_NOTE, "***** system state *****"); diff --git a/usr/src/uts/sun4v/io/vsw_rxdring.c b/usr/src/uts/sun4v/io/vsw_rxdring.c index 5661a00bd8..adbed65efc 100644 --- a/usr/src/uts/sun4v/io/vsw_rxdring.c +++ b/usr/src/uts/sun4v/io/vsw_rxdring.c @@ -415,7 +415,7 @@ vsw_destroy_rx_dring(vsw_ldc_t *ldcp) } /* Finally, free the receive descriptor ring */ - if (dp->dring_handle != NULL) { + if (dp->dring_handle != 0) { (void) ldc_mem_dring_unbind(dp->dring_handle); (void) ldc_mem_dring_destroy(dp->dring_handle); } @@ -491,7 +491,7 @@ vsw_map_tx_dring(vsw_ldc_t *ldcp, void *pkt) return (dp); fail: - if (dp->dring_handle != NULL) { + if (dp->dring_handle != 0) { (void) ldc_mem_dring_unmap(dp->dring_handle); } kmem_free(dp, sizeof (*dp)); @@ -512,10 +512,10 @@ vsw_unmap_tx_dring(vsw_ldc_t *ldcp) } /* Unmap tx data area and free data handle */ - if (dp->data_handle != NULL) { + if (dp->data_handle != 0) { (void) ldc_mem_unmap(dp->data_handle); (void) ldc_mem_free_handle(dp->data_handle); - dp->data_handle = NULL; + dp->data_handle = 0; } /* Free tx data area cookies */ @@ -527,9 +527,9 @@ vsw_unmap_tx_dring(vsw_ldc_t *ldcp) } /* Unmap peer's dring */ - if (dp->dring_handle != NULL) { + if (dp->dring_handle != 0) { (void) ldc_mem_dring_unmap(dp->dring_handle); - dp->dring_handle = NULL; + dp->dring_handle = 0; } mutex_destroy(&dp->txlock); @@ -877,7 +877,7 @@ vsw_dringsend_shm(vsw_ldc_t *ldcp, mblk_t *mp) vsw_t *vswp = ldcp->ldc_vswp; if ((!(lane_in->lstate & VSW_LANE_ACTIVE)) || - (ldcp->ldc_status != LDC_UP) || (ldcp->ldc_handle == NULL)) { + (ldcp->ldc_status != LDC_UP) || (ldcp->ldc_handle == 0)) { DWARN(vswp, "%s(%lld) status(%d) lstate(0x%llx), dropping " "packet\n", __func__, ldcp->ldc_id, ldcp->ldc_status, lane_in->lstate); diff --git a/usr/src/uts/sun4v/io/vsw_txdring.c b/usr/src/uts/sun4v/io/vsw_txdring.c index afe0e5b6e5..26a9a401a9 100644 --- a/usr/src/uts/sun4v/io/vsw_txdring.c +++ b/usr/src/uts/sun4v/io/vsw_txdring.c @@ -394,7 +394,7 @@ vsw_destroy_tx_dring(vsw_ldc_t *ldcp) */ for (i = 0; i < vsw_num_descriptors; i++) { paddr = (vsw_private_desc_t *)dp->priv_addr + i; - if (paddr->memhandle != NULL) { + if (paddr->memhandle != 0) { if (paddr->bound == 1) { if (ldc_mem_unbind_handle( paddr->memhandle) != 0) { @@ -414,7 +414,7 @@ vsw_destroy_tx_dring(vsw_ldc_t *ldcp) "at pos %d", dp, i); continue; } - paddr->memhandle = NULL; + paddr->memhandle = 0; } mutex_destroy(&paddr->dstate_lock); } @@ -425,7 +425,7 @@ vsw_destroy_tx_dring(vsw_ldc_t *ldcp) /* * Now unbind and destroy the ring itself. */ - if (dp->dring_handle != NULL) { + if (dp->dring_handle != 0) { (void) ldc_mem_dring_unbind(dp->dring_handle); (void) ldc_mem_dring_destroy(dp->dring_handle); } @@ -505,7 +505,7 @@ vsw_unmap_rx_dring(vsw_ldc_t *ldcp) vsw_destroy_rxpools, fvmp, DDI_SLEEP); } - if (dp->dring_handle != NULL) { + if (dp->dring_handle != 0) { (void) ldc_mem_dring_unmap(dp->dring_handle); } kmem_free(dp, sizeof (dring_info_t)); @@ -800,7 +800,7 @@ vsw_dringsend(vsw_ldc_t *ldcp, mblk_t *mp) /* TODO: make test a macro */ if ((!(ldcp->lane_out.lstate & VSW_LANE_ACTIVE)) || - (ldcp->ldc_status != LDC_UP) || (ldcp->ldc_handle == NULL)) { + (ldcp->ldc_status != LDC_UP) || (ldcp->ldc_handle == 0)) { DWARN(vswp, "%s(%lld) status(%d) lstate(0x%llx), dropping " "packet\n", __func__, ldcp->ldc_id, ldcp->ldc_status, ldcp->lane_out.lstate); @@ -942,7 +942,7 @@ vsw_dringsend_free_exit: */ int vsw_dring_find_free_desc(dring_info_t *dringp, - vsw_private_desc_t **priv_p, int *idx) + vsw_private_desc_t **priv_p, int *idx) { vsw_private_desc_t *addr = NULL; int num = vsw_num_descriptors; diff --git a/usr/src/uts/sun4v/kt/Makefile b/usr/src/uts/sun4v/kt/Makefile index f4721ae345..4d2d27ba15 100644 --- a/usr/src/uts/sun4v/kt/Makefile +++ b/usr/src/uts/sun4v/kt/Makefile @@ -37,7 +37,6 @@ UTSBASE = ../.. # MODULE = SPARC-T3 OBJECTS = $(NIAGARA2CPU_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(NIAGARA2CPU_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_CPU_DIR)/$(MODULE) CPU_DIR = . @@ -57,13 +56,9 @@ CLEANFILES += $(CPULIB) $(SYM_MOD) # Define targets # ALL_TARGET = $(SYM_MOD) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = def $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) -DKT_IMPL +CFLAGS += -DKT_IMPL # # The ATOMIC_BO_ENABLE_SHIFT enables backoff in atomic routines. @@ -95,12 +90,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) $(CPULIB): $(OBJECTS) diff --git a/usr/src/uts/sun4v/ldc/Makefile b/usr/src/uts/sun4v/ldc/Makefile index f1c044bb36..4e4aaba6d4 100644 --- a/usr/src/uts/sun4v/ldc/Makefile +++ b/usr/src/uts/sun4v/ldc/Makefile @@ -42,7 +42,6 @@ UTSBASE = ../.. # MODULE = ldc OBJECTS = $(LDC_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(LDC_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE) # @@ -61,23 +60,8 @@ CLEANFILES += $(MODSTUBS_O) # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - -# -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV -LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW - CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-parentheses @@ -94,12 +78,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4v/n2piupc/Makefile b/usr/src/uts/sun4v/n2piupc/Makefile index c4cd3e1b44..2577303a0b 100644 --- a/usr/src/uts/sun4v/n2piupc/Makefile +++ b/usr/src/uts/sun4v/n2piupc/Makefile @@ -41,7 +41,6 @@ UTSBASE = ../.. # MODULE = n2piupc OBJECTS = $(N2PIUPC_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(N2PIUPC_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/sun4v/io/n2piupc @@ -54,7 +53,6 @@ include $(UTSBASE)/sun4v/Makefile.sun4v # Define targets # ALL_TARGET = $(BINARY) $(SRC_CONFFILE) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # @@ -62,10 +60,6 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # INC_PATH += -I$(UTSBASE)/sun4v/io/n2piupc -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-unused-label # @@ -74,11 +68,6 @@ CERRWARN += -_gcc=-Wno-unused-label CFLAGS += -dalign -DMODULE_NAME=\"$(MODULE)\" # -# Lint needs module name too -# -LINTFLAGS += -DMODULE_NAME=\"$(MODULE)\" - -# # Default build targets. # .KEEP_STATE: @@ -91,12 +80,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4v/niagara/Makefile b/usr/src/uts/sun4v/niagara/Makefile index 713198a991..181c06f9d4 100644 --- a/usr/src/uts/sun4v/niagara/Makefile +++ b/usr/src/uts/sun4v/niagara/Makefile @@ -40,7 +40,6 @@ UTSBASE = ../.. # MODULE = SUNW,UltraSPARC-T1 OBJECTS = $(NIAGARACPU_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(NIAGARACPU_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_CPU_DIR)/$(MODULE) CPU_DIR = . @@ -60,13 +59,9 @@ CLEANFILES += $(CPULIB) $(SYM_MOD) # Define targets # ALL_TARGET = $(SYM_MOD) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = def $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) -DNIAGARA_IMPL +CFLAGS += -DNIAGARA_IMPL CERRWARN += -_gcc=-Wno-parentheses # @@ -88,12 +83,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) $(CPULIB): $(OBJECTS) diff --git a/usr/src/uts/sun4v/niagara2/Makefile b/usr/src/uts/sun4v/niagara2/Makefile index 39a01ef025..f6f4d3843e 100644 --- a/usr/src/uts/sun4v/niagara2/Makefile +++ b/usr/src/uts/sun4v/niagara2/Makefile @@ -39,7 +39,6 @@ UTSBASE = ../.. # MODULE = SUNW,UltraSPARC-T2 OBJECTS = $(NIAGARA2CPU_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(NIAGARA2CPU_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_CPU_DIR)/$(MODULE) CPU_DIR = . @@ -59,13 +58,9 @@ CLEANFILES += $(CPULIB) $(SYM_MOD) # Define targets # ALL_TARGET = $(SYM_MOD) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = def $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) -DNIAGARA2_IMPL +CFLAGS += -DNIAGARA2_IMPL # # cpu-module-specific flags @@ -97,12 +92,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) $(CPULIB): $(OBJECTS) diff --git a/usr/src/uts/sun4v/ntwdt/Makefile b/usr/src/uts/sun4v/ntwdt/Makefile index 5aae3d419a..2685934ffe 100644 --- a/usr/src/uts/sun4v/ntwdt/Makefile +++ b/usr/src/uts/sun4v/ntwdt/Makefile @@ -22,8 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of the ntwdt driver module. # # sun4v implementation architecture dependent @@ -37,9 +35,8 @@ UTSBASE = ../.. # # Define the module and object file sets. # -MODULE = ntwdt +MODULE = ntwdt OBJECTS = $(NTWDT_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(NTWDT_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/sun4v/io @@ -59,15 +56,9 @@ CLEANFILES += $(MODSTUBS_O) # Define targets # ALL_TARGET = $(BINARY) $(SRC_CONFILE) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # -# lint pass one enforcement -# -CFLAGS += -v - -# # Default build targets. # .KEEP_STATE: @@ -80,12 +71,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4v/ontario/io/tsalarm.c b/usr/src/uts/sun4v/ontario/io/tsalarm.c index ebf15565c8..7fb9577028 100644 --- a/usr/src/uts/sun4v/ontario/io/tsalarm.c +++ b/usr/src/uts/sun4v/ontario/io/tsalarm.c @@ -410,7 +410,7 @@ tsalarm_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) * the device's softc, is used to direct peculiar behavior. */ if (ddi_create_minor_node(dip, "lom", S_IFCHR, 0, - DDI_PSEUDO, NULL) == DDI_FAILURE) { + DDI_PSEUDO, 0) == DDI_FAILURE) { goto attach_failed; } @@ -749,7 +749,7 @@ glvc_alarm_get(int alarm_type, int *alarm_state, tsalarm_softc_t *sc) req_ptr->alarm_id = alarm_type; send_msg.msg_type = PCP_ALARM_CONTROL; - send_msg.sub_type = NULL; + send_msg.sub_type = 0; send_msg.msg_len = sizeof (tsal_pcp_alarm_req_t); send_msg.msg_data = (uint8_t *)req_ptr; @@ -824,7 +824,7 @@ glvc_alarm_set(int alarm_type, int new_state, tsalarm_softc_t *sc) req_ptr->alarm_id = alarm_type; send_msg.msg_type = PCP_ALARM_CONTROL; - send_msg.sub_type = NULL; + send_msg.sub_type = 0; send_msg.msg_len = sizeof (tsal_pcp_alarm_req_t); send_msg.msg_data = (uint8_t *)req_ptr; diff --git a/usr/src/uts/sun4v/pcie/Makefile b/usr/src/uts/sun4v/pcie/Makefile index 12cf0358a9..7378fe095d 100644 --- a/usr/src/uts/sun4v/pcie/Makefile +++ b/usr/src/uts/sun4v/pcie/Makefile @@ -42,8 +42,6 @@ UTSBASE = ../.. MODULE = pcie OBJECTS = $(PCIE_MISC_OBJS:%=$(OBJS_DIR)/%) \ $(PCI_STRING_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(PCIE_MISC_OBJS:%.o=$(LINTS_DIR)/%.ln) \ - $(PCI_STRING_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE) # @@ -55,7 +53,6 @@ include $(UTSBASE)/sun4v/Makefile.sun4v # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # @@ -81,12 +78,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4v/platsvc/Makefile b/usr/src/uts/sun4v/platsvc/Makefile index 0c56b38552..14315fe472 100644 --- a/usr/src/uts/sun4v/platsvc/Makefile +++ b/usr/src/uts/sun4v/platsvc/Makefile @@ -35,9 +35,8 @@ UTSBASE = ../.. # # Define the module and object file sets. # -MODULE = platsvc +MODULE = platsvc OBJECTS = $(PLATSVC_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(PLATSVC_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE) # @@ -49,13 +48,8 @@ include $(UTSBASE)/sun4v/Makefile.sun4v # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) CERRWARN += $(CNOWARN_UNINIT) # @@ -81,12 +75,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4v/sys/ldc_impl.h b/usr/src/uts/sun4v/sys/ldc_impl.h index 4acea4f84f..be381ad018 100644 --- a/usr/src/uts/sun4v/sys/ldc_impl.h +++ b/usr/src/uts/sun4v/sys/ldc_impl.h @@ -229,7 +229,7 @@ typedef struct ldc_msg { uint8_t _type; /* Message type */ uint8_t _stype; /* Message subtype */ uint8_t _ctrl; /* Control/Error Message */ - uint8_t _env; /* Message Envelope */ + uint8_t _env; /* Message Envelope */ uint32_t _seqid; /* Sequence ID */ union { @@ -285,7 +285,7 @@ typedef union { pgszc:4; /* <3:0> pgsz code */ } mte_bit; - uint64_t ll; + uint64_t ll; } ldc_mte_t; @@ -300,8 +300,8 @@ typedef union { #define mte_pgszc mte_bit.pgszc #define MTE_BSZS_SHIFT(sz) ((sz) * 3) -#define MTEBYTES(sz) (MMU_PAGESIZE << MTE_BSZS_SHIFT(sz)) -#define MTEPAGES(sz) (1 << MTE_BSZS_SHIFT(sz)) +#define MTEBYTES(sz) (MMU_PAGESIZE << MTE_BSZS_SHIFT(sz)) +#define MTEPAGES(sz) (1 << MTE_BSZS_SHIFT(sz)) #define MTE_PAGE_SHIFT(sz) (MMU_PAGESHIFT + MTE_BSZS_SHIFT(sz)) #define MTE_PAGE_OFFSET(sz) (MTEBYTES(sz) - 1) #define MTE_PAGEMASK(sz) (~MTE_PAGE_OFFSET(sz)) @@ -400,7 +400,7 @@ typedef struct ldc_dring { ldc_mem_handle_t mhdl; /* Mem handle to desc ring */ struct ldc_dring *ch_next; /* Next dring in channel */ - struct ldc_dring *next; /* Next dring overall */ + struct ldc_dring *next; /* Next dring overall */ } ldc_dring_t; @@ -493,11 +493,11 @@ struct ldc_chan { * LDC module soft state structure */ typedef struct ldc_soft_state { - kmutex_t lock; /* Protects ldc_soft_state_t */ + kmutex_t lock; /* Protects ldc_soft_state_t */ ldc_cnex_t cinfo; /* channel nexus info */ uint64_t channel_count; /* Number of channels */ uint64_t channels_open; /* Number of open channels */ - ldc_chan_t *chan_list; /* List of LDC endpoints */ + ldc_chan_t *chan_list; /* List of LDC endpoints */ ldc_dring_t *dring_list; /* Descriptor rings (for export) */ kmem_cache_t *memhdl_cache; /* Memory handle cache */ @@ -522,9 +522,9 @@ if (ldcdbg & 0x02) \ if (ldcdbg & 0x04) \ ldcdebug #else -#define D1 -#define D2 -#define DWARN +#define D1(...) +#define D2(...) +#define DWARN(...) #endif #ifdef __cplusplus diff --git a/usr/src/uts/sun4v/sys/vnet.h b/usr/src/uts/sun4v/sys/vnet.h index 81b958fedf..04d2df006a 100644 --- a/usr/src/uts/sun4v/sys/vnet.h +++ b/usr/src/uts/sun4v/sys/vnet.h @@ -90,16 +90,16 @@ typedef struct vnet_hio_kstats { kstat_named_t oerrors; /* required by kstat for MIB II objects(RFC 1213) */ - kstat_named_t rbytes; /* MIB - ifInOctets */ + kstat_named_t rbytes; /* MIB - ifInOctets */ kstat_named_t rbytes64; - kstat_named_t obytes; /* MIB - ifOutOctets */ + kstat_named_t obytes; /* MIB - ifOutOctets */ kstat_named_t obytes64; - kstat_named_t multircv; /* MIB - ifInNUcastPkts */ - kstat_named_t multixmt; /* MIB - ifOutNUcastPkts */ + kstat_named_t multircv; /* MIB - ifInNUcastPkts */ + kstat_named_t multixmt; /* MIB - ifOutNUcastPkts */ kstat_named_t brdcstrcv; /* MIB - ifInNUcastPkts */ kstat_named_t brdcstxmt; /* MIB - ifOutNUcastPkts */ - kstat_named_t norcvbuf; /* MIB - ifInDiscards */ - kstat_named_t noxmtbuf; /* MIB - ifOutDiscards */ + kstat_named_t norcvbuf; /* MIB - ifInDiscards */ + kstat_named_t noxmtbuf; /* MIB - ifOutDiscards */ } vnet_hio_kstats_t; typedef struct vnet_tx_ring_stats { @@ -348,10 +348,10 @@ enum { DBG_LEVEL1 = 0x01, DBG_LEVEL2 = 0x02, DBG_WARN = 0x04, #else -#define DBG1(...) if (0) do { } while (0) -#define DBG2(...) if (0) do { } while (0) -#define DWARN(...) if (0) do { } while (0) -#define DERR(...) if (0) do { } while (0) +#define DBG1(...) +#define DBG2(...) +#define DWARN(...) +#define DERR(...) #endif diff --git a/usr/src/uts/sun4v/trapstat/Makefile b/usr/src/uts/sun4v/trapstat/Makefile index fa735a534e..1e1c5b71b1 100644 --- a/usr/src/uts/sun4v/trapstat/Makefile +++ b/usr/src/uts/sun4v/trapstat/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of the trapstat kernel module. # # sun4v implementation architecture dependent @@ -39,7 +37,6 @@ UTSBASE = ../.. # MODULE = trapstat OBJECTS = $(TRAPSTAT_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(TRAPSTAT_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/sun4/io @@ -52,23 +49,9 @@ include $(UTSBASE)/sun4v/Makefile.sun4v # Define targets # ALL_TARGET = $(BINARY) $(SRC_CONFFILE) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - -# -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN -LINTTAGS += -erroff=E_STATIC_UNUSED - -# # Default build targets. # .KEEP_STATE: @@ -81,12 +64,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4v/vfalls/Makefile b/usr/src/uts/sun4v/vfalls/Makefile index 001654791b..57494194a4 100644 --- a/usr/src/uts/sun4v/vfalls/Makefile +++ b/usr/src/uts/sun4v/vfalls/Makefile @@ -39,7 +39,6 @@ UTSBASE = ../.. # MODULE = SUNW,UltraSPARC-T2+ OBJECTS = $(NIAGARA2CPU_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(NIAGARA2CPU_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_CPU_DIR)/$(MODULE) CPU_DIR = . @@ -59,13 +58,9 @@ CLEANFILES += $(CPULIB) $(SYM_MOD) # Define targets # ALL_TARGET = $(SYM_MOD) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = def $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) -DVFALLS_IMPL +CFLAGS += -DVFALLS_IMPL # # cpu-module-specific flags @@ -97,12 +92,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) $(CPULIB): $(OBJECTS) diff --git a/usr/src/uts/sun4v/vlds/Makefile b/usr/src/uts/sun4v/vlds/Makefile index 7ef22bfc35..4bc93801bd 100644 --- a/usr/src/uts/sun4v/vlds/Makefile +++ b/usr/src/uts/sun4v/vlds/Makefile @@ -39,7 +39,6 @@ UTSBASE = ../.. # MODULE = vlds OBJECTS = $(VLDS_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(VLDS_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -58,13 +57,8 @@ CLEANFILES += $(MODSTUBS_O) # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses # @@ -84,12 +78,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4v/vnet/Makefile b/usr/src/uts/sun4v/vnet/Makefile index 858c2c58da..21e1ea2b9c 100644 --- a/usr/src/uts/sun4v/vnet/Makefile +++ b/usr/src/uts/sun4v/vnet/Makefile @@ -42,7 +42,6 @@ UTSBASE = ../.. # MODULE = vnet OBJECTS = $(VNET_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(VNET_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -61,13 +60,8 @@ CLEANFILES += $(MODSTUBS_O) # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) CFLAGS += -DVGEN_HANDLE_LOST_PKTS # @@ -75,17 +69,6 @@ CFLAGS += -DVGEN_HANDLE_LOST_PKTS # LDFLAGS += -dy -N misc/mac -N drv/ip -N misc/ldc -N misc/platsvc -# -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN -LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV -LINTTAGS += -erroff=E_STATIC_UNUSED -LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON - CERRWARN += -_gcc=-Wno-type-limits CERRWARN += -_gcc=-Wno-clobbered CERRWARN += -_gcc=-Wno-unused-label @@ -107,12 +90,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4v/vsw/Makefile b/usr/src/uts/sun4v/vsw/Makefile index e7d0a439e7..7d012ec8a0 100644 --- a/usr/src/uts/sun4v/vsw/Makefile +++ b/usr/src/uts/sun4v/vsw/Makefile @@ -42,7 +42,6 @@ UTSBASE = ../.. # MODULE = vsw OBJECTS = $(VSW_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(VSW_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -65,26 +64,10 @@ LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - -# # Module dependencies # LDFLAGS += -dy -Nmisc/ldc -Nmisc/mac -Nmisc/platsvc -# -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN -LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV -LINTTAGS += -erroff=E_STATIC_UNUSED -LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON - CERRWARN += -_gcc=-Wno-type-limits CERRWARN += -_gcc=-Wno-clobbered CERRWARN += -_gcc=-Wno-unused-variable @@ -105,12 +88,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # |