Use uintptr_t alone when assigning to kvaddr_t variables.

Suggested by:	jhb
This commit is contained in:
Brooks Davis 2018-07-10 13:03:06 +00:00
parent 0b343a8d9c
commit 3a20f06a1c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336170
8 changed files with 17 additions and 19 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -2906,7 +2906,7 @@ in_pcbtoxinpcb(const struct inpcb *inp, struct xinpcb *xi)
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;

View File

@ -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)) ||

View File

@ -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;

View File

@ -153,7 +153,7 @@ pcblist_kvm(u_long count_off, u_long gencnt_off, u_long head_off, char **bufp)
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;

View File

@ -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)) {