From owner-svn-src-head@freebsd.org Tue Jul 10 13:03:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0A641049FCA; Tue, 10 Jul 2018 13:03:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CFCF75837; Tue, 10 Jul 2018 13:03:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EF9824528; Tue, 10 Jul 2018 13:03:08 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6AD38Sp057021; Tue, 10 Jul 2018 13:03:08 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6AD37gZ057013; Tue, 10 Jul 2018 13:03:07 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201807101303.w6AD37gZ057013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 10 Jul 2018 13:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336170 - in head: sys/kern sys/netinet usr.bin/netstat usr.sbin/tcpdrop X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: sys/kern sys/netinet usr.bin/netstat usr.sbin/tcpdrop X-SVN-Commit-Revision: 336170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2018 13:03:11 -0000 Author: brooks Date: Tue Jul 10 13:03:06 2018 New Revision: 336170 URL: https://svnweb.freebsd.org/changeset/base/336170 Log: Use uintptr_t alone when assigning to kvaddr_t variables. Suggested by: jhb Modified: head/sys/kern/kern_descrip.c head/sys/kern/uipc_socket.c head/sys/kern/uipc_usrreq.c head/sys/netinet/in_pcb.c head/sys/netinet/sctp_sysctl.c head/usr.bin/netstat/inet.c head/usr.bin/netstat/unix.c head/usr.sbin/tcpdrop/tcpdrop.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Tue Jul 10 11:33:37 2018 (r336169) +++ head/sys/kern/kern_descrip.c Tue Jul 10 13:03:06 2018 (r336170) @@ -3362,10 +3362,10 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS) if ((fp = fdp->fd_ofiles[n].fde_file) == NULL) continue; xf.xf_fd = n; - xf.xf_file = (kvaddr_t)(uintptr_t)fp; - xf.xf_data = (kvaddr_t)(uintptr_t)fp->f_data; - xf.xf_vnode = (kvaddr_t)(uintptr_t)fp->f_vnode; - xf.xf_type = (kvaddr_t)(uintptr_t)fp->f_type; + xf.xf_file = (uintptr_t)fp; + xf.xf_data = (uintptr_t)fp->f_data; + xf.xf_vnode = (uintptr_t)fp->f_vnode; + xf.xf_type = (uintptr_t)fp->f_type; xf.xf_count = fp->f_count; xf.xf_msgcount = 0; xf.xf_offset = foffset_get(fp); Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Tue Jul 10 11:33:37 2018 (r336169) +++ head/sys/kern/uipc_socket.c Tue Jul 10 13:03:06 2018 (r336170) @@ -3985,12 +3985,12 @@ sotoxsocket(struct socket *so, struct xsocket *xso) { xso->xso_len = sizeof *xso; - xso->xso_so = (kvaddr_t)(uintptr_t)so; + xso->xso_so = (uintptr_t)so; xso->so_type = so->so_type; xso->so_options = so->so_options; xso->so_linger = so->so_linger; xso->so_state = so->so_state; - xso->so_pcb = (kvaddr_t)(uintptr_t)so->so_pcb; + xso->so_pcb = (uintptr_t)so->so_pcb; xso->xso_protocol = so->so_proto->pr_protocol; xso->xso_family = so->so_proto->pr_domain->dom_family; xso->so_timeo = so->so_timeo; Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue Jul 10 11:33:37 2018 (r336169) +++ head/sys/kern/uipc_usrreq.c Tue Jul 10 13:03:06 2018 (r336170) @@ -1853,7 +1853,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) if (freeunp == 0 && unp->unp_gencnt <= gencnt) { xu->xu_len = sizeof *xu; - xu->xu_unpp = (kvaddr_t)(uintptr_t)unp; + xu->xu_unpp = (uintptr_t)unp; /* * XXX - need more locking here to protect against * connect/disconnect races for SMP. @@ -1870,12 +1870,10 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) unp->unp_conn->unp_addr->sun_len); else bzero(&xu->xu_caddr, sizeof(xu->xu_caddr)); - xu->unp_vnode = (kvaddr_t)(uintptr_t)unp->unp_vnode; - xu->unp_conn = (kvaddr_t)(uintptr_t)unp->unp_conn; - xu->xu_firstref = - (kvaddr_t)(uintptr_t)LIST_FIRST(&unp->unp_refs); - xu->xu_nextref = - (kvaddr_t)(uintptr_t)LIST_NEXT(unp, unp_reflink); + xu->unp_vnode = (uintptr_t)unp->unp_vnode; + xu->unp_conn = (uintptr_t)unp->unp_conn; + xu->xu_firstref = (uintptr_t)LIST_FIRST(&unp->unp_refs); + xu->xu_nextref = (uintptr_t)LIST_NEXT(unp, unp_reflink); xu->unp_gencnt = unp->unp_gencnt; sotoxsocket(unp->unp_socket, &xu->xu_socket); UNP_PCB_UNLOCK(unp); Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Tue Jul 10 11:33:37 2018 (r336169) +++ head/sys/netinet/in_pcb.c Tue Jul 10 13:03:06 2018 (r336170) @@ -2906,7 +2906,7 @@ in_pcbtoxinpcb(const struct inpcb *inp, struct xinpcb bzero(&xi->xi_socket, sizeof(struct xsocket)); bcopy(&inp->inp_inc, &xi->inp_inc, sizeof(struct in_conninfo)); xi->inp_gencnt = inp->inp_gencnt; - xi->inp_ppcb = (kvaddr_t)(uintptr_t)inp->inp_ppcb; + xi->inp_ppcb = (uintptr_t)inp->inp_ppcb; xi->inp_flow = inp->inp_flow; xi->inp_flowid = inp->inp_flowid; xi->inp_flowtype = inp->inp_flowtype; Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Tue Jul 10 11:33:37 2018 (r336169) +++ head/sys/netinet/sctp_sysctl.c Tue Jul 10 13:03:06 2018 (r336170) @@ -409,7 +409,7 @@ sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS) xinpcb.total_recvs = inp->total_recvs; xinpcb.total_nospaces = inp->total_nospaces; xinpcb.fragmentation_point = inp->sctp_frag_point; - xinpcb.socket = (kvaddr_t)(uintptr_t)inp->sctp_socket; + xinpcb.socket = (uintptr_t)inp->sctp_socket; so = inp->sctp_socket; if ((so == NULL) || (!SCTP_IS_LISTENING(inp)) || Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Tue Jul 10 11:33:37 2018 (r336169) +++ head/usr.bin/netstat/inet.c Tue Jul 10 13:03:06 2018 (r336170) @@ -159,12 +159,12 @@ sotoxsocket(struct socket *so, struct xsocket *xso) bzero(xso, sizeof *xso); xso->xso_len = sizeof *xso; - xso->xso_so = (kvaddr_t)(long)so; + xso->xso_so = (uintptr_t)so; xso->so_type = so->so_type; xso->so_options = so->so_options; xso->so_linger = so->so_linger; xso->so_state = so->so_state; - xso->so_pcb = (kvaddr_t)(long)so->so_pcb; + xso->so_pcb = (uintptr_t)so->so_pcb; if (kread((uintptr_t)so->so_proto, &proto, sizeof(proto)) != 0) return (-1); xso->xso_protocol = proto.pr_protocol; Modified: head/usr.bin/netstat/unix.c ============================================================================== --- head/usr.bin/netstat/unix.c Tue Jul 10 11:33:37 2018 (r336169) +++ head/usr.bin/netstat/unix.c Tue Jul 10 13:03:06 2018 (r336170) @@ -153,7 +153,7 @@ pcblist_kvm(u_long count_off, u_long gencnt_off, u_lon xu.xu_len = sizeof xu; KREAD(head_off, &head, sizeof(head)); LIST_FOREACH(unp, &head, unp_link) { - xu.xu_unpp = (kvaddr_t)(long)unp; + xu.xu_unpp = (uintptr_t)unp; KREAD(unp, &unp0, sizeof (*unp)); unp = &unp0; Modified: head/usr.sbin/tcpdrop/tcpdrop.c ============================================================================== --- head/usr.sbin/tcpdrop/tcpdrop.c Tue Jul 10 11:33:37 2018 (r336169) +++ head/usr.sbin/tcpdrop/tcpdrop.c Tue Jul 10 13:03:06 2018 (r336170) @@ -235,7 +235,7 @@ tcpdropall(const char *stack, int state) head = getxpcblist("net.inet.tcp.pcblist"); #define XINP_NEXT(xinp) \ - ((struct xinpgen *)(long)((uintptr_t)(xinp) + (xinp)->xig_len)) + ((struct xinpgen *)(uintptr_t)((uintptr_t)(xinp) + (xinp)->xig_len)) for (xinp = XINP_NEXT(head); xinp->xig_len > sizeof *xinp; xinp = XINP_NEXT(xinp)) {