uiomove-related caddr_t -> void * (just the low-hanging fruit)

This commit is contained in:
des 2003-03-02 15:50:23 +00:00
parent 81848f2917
commit 17df8c12f3
17 changed files with 29 additions and 35 deletions

View File

@ -2024,8 +2024,7 @@ linux_ifconf(struct thread *td, struct ifconf *uifc)
memcpy(ifr.ifr_addr.sa_data, sa->sa_data, memcpy(ifr.ifr_addr.sa_data, sa->sa_data,
sizeof(ifr.ifr_addr.sa_data)); sizeof(ifr.ifr_addr.sa_data));
error = uiomove((caddr_t)&ifr, sizeof ifr, error = uiomove(&ifr, sizeof ifr, &uio);
&uio);
if (error != 0) { if (error != 0) {
IFNET_RUNLOCK(); IFNET_RUNLOCK();
return (error); return (error);

View File

@ -361,7 +361,7 @@ iso_uiodir(idp,dp,off)
--idp->ncookies; --idp->ncookies;
} }
if ((error = uiomove((caddr_t) dp,dp->d_reclen,idp->uio)) != 0) if ((error = uiomove(dp, dp->d_reclen, idp->uio)) != 0)
return (error); return (error);
idp->uio_off = off; idp->uio_off = off;
return (0); return (0);

View File

@ -599,7 +599,7 @@ devfs_readdir(ap)
dp->d_fileno = de->de_inode; dp->d_fileno = de->de_inode;
if (off >= uio->uio_offset) { if (off >= uio->uio_offset) {
ncookies++; ncookies++;
error = uiomove((caddr_t)dp, dp->d_reclen, uio); error = uiomove(dp, dp->d_reclen, uio);
if (error) if (error)
break; break;
} }

View File

@ -476,7 +476,7 @@ fdesc_readdir(ap)
* And ship to userland * And ship to userland
*/ */
FILEDESC_UNLOCK(fdp); FILEDESC_UNLOCK(fdp);
error = uiomove((caddr_t) dp, UIO_MX, uio); error = uiomove(dp, UIO_MX, uio);
if (error) if (error)
goto done; goto done;
FILEDESC_LOCK(fdp); FILEDESC_LOCK(fdp);

View File

@ -1545,8 +1545,7 @@ msdosfs_readdir(ap)
dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf); dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf);
if (uio->uio_resid < dirbuf.d_reclen) if (uio->uio_resid < dirbuf.d_reclen)
goto out; goto out;
error = uiomove((caddr_t) &dirbuf, error = uiomove(&dirbuf, dirbuf.d_reclen, uio);
dirbuf.d_reclen, uio);
if (error) if (error)
goto out; goto out;
offset += sizeof(struct direntry); offset += sizeof(struct direntry);
@ -1668,8 +1667,7 @@ msdosfs_readdir(ap)
brelse(bp); brelse(bp);
goto out; goto out;
} }
error = uiomove((caddr_t) &dirbuf, error = uiomove(&dirbuf, dirbuf.d_reclen, uio);
dirbuf.d_reclen, uio);
if (error) { if (error) {
brelse(bp); brelse(bp);
goto out; goto out;

View File

@ -146,7 +146,7 @@ nwfs_readvdir(struct vnode *vp, struct uio *uio, struct ucred *cred) {
error = 0; error = 0;
break; break;
} }
if ((error = uiomove((caddr_t)&dp, DE_SIZE, uio))) if ((error = uiomove(&dp, DE_SIZE, uio)))
break; break;
} }

View File

@ -109,7 +109,7 @@ smbfs_readvdir(struct vnode *vp, struct uio *uio, struct ucred *cred)
de.d_name[1] = '.'; de.d_name[1] = '.';
de.d_name[offset + 1] = '\0'; de.d_name[offset + 1] = '\0';
de.d_type = DT_DIR; de.d_type = DT_DIR;
error = uiomove((caddr_t)&de, DE_SIZE, uio); error = uiomove(&de, DE_SIZE, uio);
if (error) if (error)
return error; return error;
offset++; offset++;
@ -165,7 +165,7 @@ smbfs_readvdir(struct vnode *vp, struct uio *uio, struct ucred *cred)
vput(newvp); vput(newvp);
} }
} }
error = uiomove((caddr_t)&de, DE_SIZE, uio); error = uiomove(&de, DE_SIZE, uio);
if (error) if (error)
break; break;
} }

View File

@ -406,7 +406,7 @@ udf_read(struct vop_read_args *a)
error = udf_readatoffset(node, &size, offset, &bp, &data); error = udf_readatoffset(node, &size, offset, &bp, &data);
if (error) if (error)
return (error); return (error);
error = uiomove((caddr_t)data, size, uio); error = uiomove(data, size, uio);
if (bp != NULL) if (bp != NULL)
brelse(bp); brelse(bp);
if (error) if (error)
@ -524,7 +524,7 @@ udf_uiodir(struct udf_uiodir *uiodir, int de_size, struct uio *uio, long cookie)
return (-1); return (-1);
} }
return (uiomove((caddr_t)uiodir->dirent, de_size, uio)); return (uiomove(uiodir->dirent, de_size, uio));
} }
static struct udf_dirstream * static struct udf_dirstream *

View File

@ -222,8 +222,7 @@ ext2_readdir(ap)
dp = (struct ext2_dir_entry_2 *) dp = (struct ext2_dir_entry_2 *)
((char *)dp + dp->rec_len); ((char *)dp + dp->rec_len);
error = error =
uiomove((caddr_t)&dstdp, uiomove(&dstdp, dstdp.d_reclen, uio);
dstdp.d_reclen, uio);
if (!error) if (!error)
ncookies++; ncookies++;
} else } else

View File

@ -222,8 +222,7 @@ ext2_readdir(ap)
dp = (struct ext2_dir_entry_2 *) dp = (struct ext2_dir_entry_2 *)
((char *)dp + dp->rec_len); ((char *)dp + dp->rec_len);
error = error =
uiomove((caddr_t)&dstdp, uiomove(&dstdp, dstdp.d_reclen, uio);
dstdp.d_reclen, uio);
if (!error) if (!error)
ncookies++; ncookies++;
} else } else

View File

@ -361,7 +361,7 @@ iso_uiodir(idp,dp,off)
--idp->ncookies; --idp->ncookies;
} }
if ((error = uiomove((caddr_t) dp,dp->d_reclen,idp->uio)) != 0) if ((error = uiomove(dp, dp->d_reclen, idp->uio)) != 0)
return (error); return (error);
idp->uio_off = off; idp->uio_off = off;
return (0); return (0);

View File

@ -151,7 +151,7 @@ logread(dev_t dev, struct uio *uio, int flag)
l = imin(l, uio->uio_resid); l = imin(l, uio->uio_resid);
if (l == 0) if (l == 0)
break; break;
error = uiomove((caddr_t)msgbufp->msg_ptr + mbp->msg_bufr, error = uiomove((char *)msgbufp->msg_ptr + mbp->msg_bufr,
l, uio); l, uio);
if (error) if (error)
break; break;

View File

@ -425,8 +425,7 @@ ptcread(dev, uio, flag)
if (pti->pt_send & TIOCPKT_IOCTL) { if (pti->pt_send & TIOCPKT_IOCTL) {
cc = min(uio->uio_resid, cc = min(uio->uio_resid,
sizeof(tp->t_termios)); sizeof(tp->t_termios));
uiomove((caddr_t)&tp->t_termios, cc, uiomove(&tp->t_termios, cc, uio);
uio);
} }
pti->pt_send = 0; pti->pt_send = 0;
return (0); return (0);
@ -561,7 +560,7 @@ ptcwrite(dev, uio, flag)
cc = min(uio->uio_resid, BUFSIZ); cc = min(uio->uio_resid, BUFSIZ);
cc = min(cc, TTYHOG - 1 - tp->t_canq.c_cc); cc = min(cc, TTYHOG - 1 - tp->t_canq.c_cc);
cp = locbuf; cp = locbuf;
error = uiomove((caddr_t)cp, cc, uio); error = uiomove(cp, cc, uio);
if (error) if (error)
return (error); return (error);
/* check again for safety */ /* check again for safety */
@ -596,7 +595,7 @@ ptcwrite(dev, uio, flag)
if (cc == 0) { if (cc == 0) {
cc = min(uio->uio_resid, BUFSIZ); cc = min(uio->uio_resid, BUFSIZ);
cp = locbuf; cp = locbuf;
error = uiomove((caddr_t)cp, cc, uio); error = uiomove(cp, cc, uio);
if (error) if (error)
return (error); return (error);
/* check again for safety */ /* check again for safety */

View File

@ -683,7 +683,7 @@ sosend(so, addr, uio, top, control, flags, td)
error = 0; error = 0;
else else
#endif /* ZERO_COPY_SOCKETS */ #endif /* ZERO_COPY_SOCKETS */
error = uiomove(mtod(m, caddr_t), (int)len, uio); error = uiomove(mtod(m, void *), (int)len, uio);
resid = uio->uio_resid; resid = uio->uio_resid;
m->m_len = len; m->m_len = len;
*mp = m; *mp = m;
@ -809,13 +809,13 @@ soreceive(so, psa, uio, mp0, controlp, flagsp)
if (uio->uio_offset == -1) if (uio->uio_offset == -1)
uio->uio_offset =IDX_TO_OFF(pg->pindex); uio->uio_offset =IDX_TO_OFF(pg->pindex);
error = uiomoveco(mtod(m, caddr_t), error = uiomoveco(mtod(m, void *),
min(uio->uio_resid, m->m_len), min(uio->uio_resid, m->m_len),
uio, pg->object, uio, pg->object,
disposable); disposable);
} else } else
#endif /* ZERO_COPY_SOCKETS */ #endif /* ZERO_COPY_SOCKETS */
error = uiomove(mtod(m, caddr_t), error = uiomove(mtod(m, void *),
(int) min(uio->uio_resid, m->m_len), uio); (int) min(uio->uio_resid, m->m_len), uio);
m = m_free(m); m = m_free(m);
} while (uio->uio_resid && error == 0 && m); } while (uio->uio_resid && error == 0 && m);
@ -987,12 +987,12 @@ soreceive(so, psa, uio, mp0, controlp, flagsp)
if (uio->uio_offset == -1) if (uio->uio_offset == -1)
uio->uio_offset =IDX_TO_OFF(pg->pindex); uio->uio_offset =IDX_TO_OFF(pg->pindex);
error = uiomoveco(mtod(m, caddr_t) + moff, error = uiomoveco(mtod(m, char *) + moff,
(int)len, uio,pg->object, (int)len, uio,pg->object,
disposable); disposable);
} else } else
#endif /* ZERO_COPY_SOCKETS */ #endif /* ZERO_COPY_SOCKETS */
error = uiomove(mtod(m, caddr_t) + moff, (int)len, uio); error = uiomove(mtod(m, char *) + moff, (int)len, uio);
s = splnet(); s = splnet();
if (error) if (error)
goto release; goto release;

View File

@ -228,11 +228,11 @@ bpf_movein(uio, linktype, mp, sockp, datlen)
#else #else
m->m_off += hlen; m->m_off += hlen;
#endif #endif
error = uiomove((caddr_t)sockp->sa_data, hlen, uio); error = uiomove(sockp->sa_data, hlen, uio);
if (error) if (error)
goto bad; goto bad;
} }
error = uiomove(mtod(m, caddr_t), len - hlen, uio); error = uiomove(mtod(m, void *), len - hlen, uio);
if (!error) if (!error)
return (0); return (0);
bad: bad:

View File

@ -794,7 +794,7 @@ tapread(dev, uio, flag)
if (len == 0) if (len == 0)
break; break;
error = uiomove(mtod(m, caddr_t), len, uio); error = uiomove(mtod(m, void *), len, uio);
m = m_free(m); m = m_free(m);
} }
@ -848,7 +848,7 @@ tapwrite(dev, uio, flag)
mp = &top; mp = &top;
while ((error == 0) && (uio->uio_resid > 0)) { while ((error == 0) && (uio->uio_resid > 0)) {
m->m_len = min(mlen, uio->uio_resid); m->m_len = min(mlen, uio->uio_resid);
error = uiomove(mtod(m, caddr_t), m->m_len, uio); error = uiomove(mtod(m, void *), m->m_len, uio);
*mp = m; *mp = m;
mp = &m->m_next; mp = &m->m_next;
if (uio->uio_resid > 0) { if (uio->uio_resid > 0) {

View File

@ -676,7 +676,7 @@ tunread(dev_t dev, struct uio *uio, int flag)
while (m && uio->uio_resid > 0 && error == 0) { while (m && uio->uio_resid > 0 && error == 0) {
len = min(uio->uio_resid, m->m_len); len = min(uio->uio_resid, m->m_len);
if (len != 0) if (len != 0)
error = uiomove(mtod(m, caddr_t), len, uio); error = uiomove(mtod(m, void *), len, uio);
m = m_free(m); m = m_free(m);
} }
@ -725,7 +725,7 @@ tunwrite(dev_t dev, struct uio *uio, int flag)
mp = &top; mp = &top;
while (error == 0 && uio->uio_resid > 0) { while (error == 0 && uio->uio_resid > 0) {
m->m_len = min(mlen, uio->uio_resid); m->m_len = min(mlen, uio->uio_resid);
error = uiomove(mtod (m, caddr_t), m->m_len, uio); error = uiomove(mtod(m, void *), m->m_len, uio);
*mp = m; *mp = m;
mp = &m->m_next; mp = &m->m_next;
if (uio->uio_resid > 0) { if (uio->uio_resid > 0) {