summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_exit.c31
-rw-r--r--sys/kern/kern_lkm.c6
-rw-r--r--sys/kern/kern_malloc.c8
-rw-r--r--sys/kern/kern_physio.c6
-rw-r--r--sys/kern/kern_sig.c20
-rw-r--r--sys/kern/kern_subr.c6
-rw-r--r--sys/kern/subr_log.c9
-rw-r--r--sys/kern/sys_generic.c29
-rw-r--r--sys/kern/sysv_msg.c30
-rw-r--r--sys/kern/sysv_sem.c24
-rw-r--r--sys/kern/tty_pty.c31
-rw-r--r--sys/kern/uipc_socket.c8
-rw-r--r--sys/kern/uipc_socket2.c22
-rw-r--r--sys/kern/uipc_syscalls.c55
-rw-r--r--sys/kern/vfs_default.c4
-rw-r--r--sys/kern/vfs_lockf.c6
-rw-r--r--sys/kern/vfs_subr.c31
-rw-r--r--sys/kern/vfs_vnops.c4
-rw-r--r--sys/kern/vnode_if.src6
-rw-r--r--sys/sys/systm.h4
20 files changed, 162 insertions, 178 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index cdc8ea16639..cc8470af1c5 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exit.c,v 1.45 2003/06/21 00:42:58 tedu Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.46 2003/07/21 22:44:50 tedu Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
@@ -123,7 +123,7 @@ exit1(p, rv)
p->p_flag &= ~P_TRACED;
if (p->p_flag & P_PPWAIT) {
p->p_flag &= ~P_PPWAIT;
- wakeup((caddr_t)p->p_pptr);
+ wakeup(p->p_pptr);
}
p->p_sigignore = ~0;
p->p_siglist = 0;
@@ -205,7 +205,7 @@ exit1(p, rv)
*/
q = p->p_children.lh_first;
if (q) /* only need this if any child is S_ZOMB */
- wakeup((caddr_t)initproc);
+ wakeup(initproc);
for (; q != 0; q = nq) {
nq = q->p_sibling.le_next;
proc_reparent(q, initproc);
@@ -252,18 +252,18 @@ exit1(p, rv)
* continue.
*/
if (pp->p_children.lh_first == NULL)
- wakeup((caddr_t)pp);
+ wakeup(pp);
}
if ((p->p_flag & P_FSTRACE) == 0 && p->p_exitsig != 0)
psignal(p->p_pptr, P_EXITSIG(p));
- wakeup((caddr_t)p->p_pptr);
+ wakeup(p->p_pptr);
/*
* Notify procfs debugger
*/
if (p->p_flag & P_FSTRACE)
- wakeup((caddr_t)p);
+ wakeup(p);
/*
* Release the process's signal state.
@@ -371,7 +371,7 @@ reaper(void)
/* Wake up the parent so it can get exit status. */
psignal(p->p_pptr, SIGCHLD);
- wakeup((caddr_t)p->p_pptr);
+ wakeup(p->p_pptr);
} else {
/* Noone will wait for us. Just zap the process now */
proc_zap(p);
@@ -424,16 +424,14 @@ loop:
if (SCARG(uap, status)) {
status = p->p_xstat; /* convert to int */
- error = copyout((caddr_t)&status,
- (caddr_t)SCARG(uap, status),
- sizeof(status));
+ error = copyout(&status,
+ SCARG(uap, status), sizeof(status));
if (error)
return (error);
}
if (SCARG(uap, rusage) &&
- (error = copyout((caddr_t)p->p_ru,
- (caddr_t)SCARG(uap, rusage),
- sizeof(struct rusage))))
+ (error = copyout(p->p_ru,
+ SCARG(uap, rusage), sizeof(struct rusage))))
return (error);
/*
@@ -445,7 +443,7 @@ loop:
proc_reparent(p, t);
if (p->p_exitsig != 0)
psignal(t, P_EXITSIG(p));
- wakeup((caddr_t)t);
+ wakeup(t);
return (0);
}
@@ -464,8 +462,7 @@ loop:
if (SCARG(uap, status)) {
status = W_STOPCODE(p->p_xstat);
- error = copyout((caddr_t)&status,
- (caddr_t)SCARG(uap, status),
+ error = copyout(&status, SCARG(uap, status),
sizeof(status));
} else
error = 0;
@@ -478,7 +475,7 @@ loop:
retval[0] = 0;
return (0);
}
- if ((error = tsleep((caddr_t)q, PWAIT | PCATCH, "wait", 0)) != 0)
+ if ((error = tsleep(q, PWAIT | PCATCH, "wait", 0)) != 0)
return (error);
goto loop;
}
diff --git a/sys/kern/kern_lkm.c b/sys/kern/kern_lkm.c
index d74c1555a68..10afec4748f 100644
--- a/sys/kern/kern_lkm.c
+++ b/sys/kern/kern_lkm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_lkm.c,v 1.38 2003/04/29 07:14:11 tedu Exp $ */
+/* $OpenBSD: kern_lkm.c,v 1.39 2003/07/21 22:44:50 tedu Exp $ */
/* $NetBSD: kern_lkm.c,v 1.31 1996/03/31 21:40:27 christos Exp $ */
/*
@@ -125,7 +125,7 @@ lkmopen(dev_t dev, int flag, int devtype, struct proc *p)
* Sleep pending unlock; we use tsleep() to allow
* an alarm out of the open.
*/
- error = tsleep((caddr_t)&lkm_v, TTIPRI|PCATCH, "lkmopn", 0);
+ error = tsleep(&lkm_v, TTIPRI|PCATCH, "lkmopn", 0);
if (error)
return (error); /* leave LKM_WANT set -- no problem */
}
@@ -268,7 +268,7 @@ lkmclose(dev_t dev, int flag, int mode, struct proc *p)
lkmfree(curp);
}
lkm_v &= ~LKM_ALLOC;
- wakeup((caddr_t)&lkm_v); /* thundering herd "problem" here */
+ wakeup(&lkm_v); /* thundering herd "problem" here */
return (0);
}
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index 2ed375dde26..5fce2f4ea8c 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_malloc.c,v 1.54 2003/06/26 01:01:06 mickey Exp $ */
+/* $OpenBSD: kern_malloc.c,v 1.55 2003/07/21 22:44:50 tedu Exp $ */
/* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */
/*
@@ -162,7 +162,7 @@ malloc(size, type, flags)
}
if (ksp->ks_limblocks < 65535)
ksp->ks_limblocks++;
- tsleep((caddr_t)ksp, PSWP+2, memname[type], 0);
+ tsleep(ksp, PSWP+2, memname[type], 0);
}
ksp->ks_size |= 1 << indx;
#endif
@@ -369,7 +369,7 @@ free(addr, type)
kup->ku_pagecnt = 0;
if (ksp->ks_memuse + size >= ksp->ks_limit &&
ksp->ks_memuse < ksp->ks_limit)
- wakeup((caddr_t)ksp);
+ wakeup(ksp);
ksp->ks_inuse--;
kbp->kb_total -= 1;
#endif
@@ -415,7 +415,7 @@ free(addr, type)
ksp->ks_memuse -= size;
if (ksp->ks_memuse + size >= ksp->ks_limit &&
ksp->ks_memuse < ksp->ks_limit)
- wakeup((caddr_t)ksp);
+ wakeup(ksp);
ksp->ks_inuse--;
#endif
if (kbp->kb_next == NULL)
diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c
index fe53055178e..195d077b10f 100644
--- a/sys/kern/kern_physio.c
+++ b/sys/kern/kern_physio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_physio.c,v 1.20 2003/06/02 23:28:05 millert Exp $ */
+/* $OpenBSD: kern_physio.c,v 1.21 2003/07/21 22:44:50 tedu Exp $ */
/* $NetBSD: kern_physio.c,v 1.28 1997/05/19 10:43:28 pk Exp $ */
/*-
@@ -95,7 +95,7 @@ physio(strategy, bp, dev, flags, minphys, uio)
/* [mark the buffer wanted] */
bp->b_flags |= B_WANTED;
/* [wait until the buffer is available] */
- tsleep((caddr_t)bp, PRIBIO+1, "physbuf", 0);
+ tsleep(bp, PRIBIO+1, "physbuf", 0);
}
/* Mark it busy, so nobody else will use it. */
@@ -179,7 +179,7 @@ physio(strategy, bp, dev, flags, minphys, uio)
/* [wait for the transfer to complete] */
while ((bp->b_flags & B_DONE) == 0)
- tsleep((caddr_t) bp, PRIBIO + 1, "physio", 0);
+ tsleep(bp, PRIBIO + 1, "physio", 0);
/* Mark it busy again, so nobody else will use it. */
bp->b_flags |= B_BUSY;
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 90d7d17f8de..48b2543dd29 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.63 2003/06/02 23:28:05 millert Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.64 2003/07/21 22:44:50 tedu Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -263,14 +263,12 @@ sys_sigaction(p, v, retval)
if ((sa->sa_mask & bit) == 0)
sa->sa_flags |= SA_NODEFER;
sa->sa_mask &= ~bit;
- error = copyout((caddr_t)sa, (caddr_t)SCARG(uap, osa),
- sizeof (vec));
+ error = copyout(sa, SCARG(uap, osa), sizeof (vec));
if (error)
return (error);
}
if (SCARG(uap, nsa)) {
- error = copyin((caddr_t)SCARG(uap, nsa), (caddr_t)sa,
- sizeof (vec));
+ error = copyin(SCARG(uap, nsa), sa, sizeof (vec));
if (error)
return (error);
setsigvec(p, signum, sa);
@@ -501,7 +499,7 @@ sys_sigsuspend(p, v, retval)
ps->ps_oldmask = p->p_sigmask;
ps->ps_flags |= SAS_OLDMASK;
p->p_sigmask = SCARG(uap, mask) &~ sigcantmask;
- while (tsleep((caddr_t) ps, PPAUSE|PCATCH, "pause", 0) == 0)
+ while (tsleep(ps, PPAUSE|PCATCH, "pause", 0) == 0)
/* void */;
/* always return EINTR rather than ERESTART... */
return (EINTR);
@@ -525,12 +523,12 @@ sys_sigaltstack(p, v, retval)
psp = p->p_sigacts;
if ((psp->ps_flags & SAS_ALTSTACK) == 0)
psp->ps_sigstk.ss_flags |= SS_DISABLE;
- if (SCARG(uap, oss) && (error = copyout((caddr_t)&psp->ps_sigstk,
- (caddr_t)SCARG(uap, oss), sizeof (struct sigaltstack))))
+ if (SCARG(uap, oss) && (error = copyout(&psp->ps_sigstk,
+ SCARG(uap, oss), sizeof (struct sigaltstack))))
return (error);
if (SCARG(uap, nss) == NULL)
return (0);
- error = copyin((caddr_t)SCARG(uap, nss), (caddr_t)&ss, sizeof (ss));
+ error = copyin(SCARG(uap, nss), &ss, sizeof (ss));
if (error)
return (error);
if (ss.ss_flags & SS_DISABLE) {
@@ -1009,7 +1007,7 @@ issignal(struct proc *p)
#ifdef PROCFS
/* procfs debugging */
p->p_stat = SSTOP;
- wakeup((caddr_t)p);
+ wakeup(p);
mi_switch();
#else
panic("procfs debugging");
@@ -1132,7 +1130,7 @@ proc_stop(p)
p->p_stat = SSTOP;
p->p_flag &= ~P_WAITED;
- wakeup((caddr_t)p->p_pptr);
+ wakeup(p->p_pptr);
}
/*
diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c
index cf7b2687779..4b0c4105c9b 100644
--- a/sys/kern/kern_subr.c
+++ b/sys/kern/kern_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_subr.c,v 1.24 2003/06/02 23:28:06 millert Exp $ */
+/* $OpenBSD: kern_subr.c,v 1.25 2003/07/21 22:44:50 tedu Exp $ */
/* $NetBSD: kern_subr.c,v 1.15 1996/04/09 17:21:56 ragge Exp $ */
/*
@@ -47,7 +47,7 @@
int
uiomove(cp, n, uio)
- register caddr_t cp;
+ register void *cp;
register int n;
register struct uio *uio;
{
@@ -99,7 +99,7 @@ uiomove(cp, n, uio)
iov->iov_len -= cnt;
uio->uio_resid -= cnt;
uio->uio_offset += cnt;
- cp += cnt;
+ cp = (caddr_t)cp + cnt;
n -= cnt;
}
return (error);
diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c
index 9e40b4ece9b..292bf55e35f 100644
--- a/sys/kern/subr_log.c
+++ b/sys/kern/subr_log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_log.c,v 1.9 2003/06/02 23:28:06 millert Exp $ */
+/* $OpenBSD: subr_log.c,v 1.10 2003/07/21 22:44:50 tedu Exp $ */
/* $NetBSD: subr_log.c,v 1.11 1996/03/30 22:24:44 christos Exp $ */
/*
@@ -149,7 +149,7 @@ logread(dev, uio, flag)
return (EWOULDBLOCK);
}
logsoftc.sc_state |= LOG_RDWAIT;
- error = tsleep((caddr_t)mbp, LOG_RDPRI | PCATCH,
+ error = tsleep(mbp, LOG_RDPRI | PCATCH,
"klog", 0);
if (error) {
splx(s);
@@ -166,8 +166,7 @@ logread(dev, uio, flag)
l = min(l, uio->uio_resid);
if (l == 0)
break;
- error = uiomove((caddr_t)&mbp->msg_bufc[mbp->msg_bufr],
- (int)l, uio);
+ error = uiomove(&mbp->msg_bufc[mbp->msg_bufr], (int)l, uio);
if (error)
break;
mbp->msg_bufr += l;
@@ -253,7 +252,7 @@ logwakeup()
csignal(logsoftc.sc_pgid, SIGIO,
logsoftc.sc_siguid, logsoftc.sc_sigeuid);
if (logsoftc.sc_state & LOG_RDWAIT) {
- wakeup((caddr_t)msgbufp);
+ wakeup(msgbufp);
logsoftc.sc_state &= ~LOG_RDWAIT;
}
KNOTE(&logsoftc.sc_selp.si_note, 0);
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index ebac87a0030..a5dedcd587b 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_generic.c,v 1.43 2003/06/23 04:26:53 deraadt Exp $ */
+/* $OpenBSD: sys_generic.c,v 1.44 2003/07/21 22:44:50 tedu Exp $ */
/* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */
/*
@@ -113,7 +113,7 @@ dofileread(p, fd, fp, buf, nbyte, offset, retval)
struct iovec ktriov;
#endif
- aiov.iov_base = (caddr_t)buf;
+ aiov.iov_base = buf;
aiov.iov_len = nbyte;
auio.uio_iov = &aiov;
auio.uio_iovcnt = 1;
@@ -250,7 +250,7 @@ dofilereadv(p, fd, fp, iovp, iovcnt, offset, retval)
*/
if (KTRPOINT(p, KTR_GENIO)) {
ktriov = malloc(iovlen, M_TEMP, M_WAITOK);
- bcopy((caddr_t)auio.uio_iov, (caddr_t)ktriov, iovlen);
+ bcopy(auio.uio_iov, ktriov, iovlen);
}
#endif
cnt = auio.uio_resid;
@@ -324,7 +324,7 @@ dofilewrite(p, fd, fp, buf, nbyte, offset, retval)
struct iovec ktriov;
#endif
- aiov.iov_base = (caddr_t)buf; /* XXX kills const */
+ aiov.iov_base = (void *)buf; /* XXX kills const */
aiov.iov_len = nbyte;
auio.uio_iov = &aiov;
auio.uio_iovcnt = 1;
@@ -464,7 +464,7 @@ dofilewritev(p, fd, fp, iovp, iovcnt, offset, retval)
*/
if (KTRPOINT(p, KTR_GENIO)) {
ktriov = malloc(iovlen, M_TEMP, M_WAITOK);
- bcopy((caddr_t)auio.uio_iov, (caddr_t)ktriov, iovlen);
+ bcopy(auio.uio_iov, ktriov, iovlen);
}
#endif
cnt = auio.uio_resid;
@@ -674,7 +674,7 @@ sys_select(struct proc *p, void *v, register_t *retval)
pobits[1] = (fd_set *)&mbits[ni * 4];
pobits[2] = (fd_set *)&mbits[ni * 5];
} else {
- bzero((caddr_t)bits, sizeof(bits));
+ bzero(bits, sizeof(bits));
pibits[0] = &bits[0];
pibits[1] = &bits[1];
pibits[2] = &bits[2];
@@ -684,8 +684,8 @@ sys_select(struct proc *p, void *v, register_t *retval)
}
#define getbits(name, x) \
- if (SCARG(uap, name) && (error = copyin((caddr_t)SCARG(uap, name), \
- (caddr_t)pibits[x], ni))) \
+ if (SCARG(uap, name) && (error = copyin(SCARG(uap, name), \
+ pibits[x], ni))) \
goto done;
getbits(in, 0);
getbits(ou, 1);
@@ -693,8 +693,7 @@ sys_select(struct proc *p, void *v, register_t *retval)
#undef getbits
if (SCARG(uap, tv)) {
- error = copyin((caddr_t)SCARG(uap, tv), (caddr_t)&atv,
- sizeof (atv));
+ error = copyin(SCARG(uap, tv), &atv, sizeof (atv));
if (error)
goto done;
if (itimerfix(&atv)) {
@@ -726,7 +725,7 @@ retry:
goto retry;
}
p->p_flag &= ~P_SELECT;
- error = tsleep((caddr_t)&selwait, PSOCK | PCATCH, "select", timo);
+ error = tsleep(&selwait, PSOCK | PCATCH, "select", timo);
splx(s);
if (error == 0)
goto retry;
@@ -738,8 +737,8 @@ done:
if (error == EWOULDBLOCK)
error = 0;
#define putbits(name, x) \
- if (SCARG(uap, name) && (error2 = copyout((caddr_t)pobits[x], \
- (caddr_t)SCARG(uap, name), ni))) \
+ if (SCARG(uap, name) && (error2 = copyout(pobits[x], \
+ SCARG(uap, name), ni))) \
error = error2;
if (error == 0) {
int error2;
@@ -848,7 +847,7 @@ selwakeup(sip)
if (sip->si_flags & SI_COLL) {
nselcoll++;
sip->si_flags &= ~SI_COLL;
- wakeup((caddr_t)&selwait);
+ wakeup(&selwait);
}
p = pfind(sip->si_selpid);
sip->si_selpid = 0;
@@ -981,7 +980,7 @@ retry:
goto retry;
}
p->p_flag &= ~P_SELECT;
- error = tsleep((caddr_t)&selwait, PSOCK | PCATCH, "poll", timo);
+ error = tsleep(&selwait, PSOCK | PCATCH, "poll", timo);
splx(s);
if (error == 0)
goto retry;
diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c
index 4f0736d6ab1..effbd84f601 100644
--- a/sys/kern/sysv_msg.c
+++ b/sys/kern/sysv_msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysv_msg.c,v 1.14 2002/12/22 04:55:05 millert Exp $ */
+/* $OpenBSD: sysv_msg.c,v 1.15 2003/07/21 22:44:50 tedu Exp $ */
/* $NetBSD: sysv_msg.c,v 1.19 1996/02/09 19:00:18 christos Exp $ */
/*
@@ -228,7 +228,7 @@ sys_msgctl(p, v, retval)
msqptr->msg_qbytes = 0; /* Mark it as free */
- wakeup((caddr_t)msqptr);
+ wakeup(msqptr);
}
break;
@@ -263,7 +263,7 @@ sys_msgctl(p, v, retval)
DPRINTF(("requester doesn't have read access\n"));
return (eval);
}
- eval = copyout((caddr_t)msqptr, user_msqptr,
+ eval = copyout(msqptr, user_msqptr,
sizeof(struct msqid_ds));
break;
@@ -466,7 +466,7 @@ sys_msgsnd(p, v, retval)
we_own_it = 1;
}
DPRINTF(("goodnight\n"));
- eval = tsleep((caddr_t)msqptr, (PZERO - 4) | PCATCH,
+ eval = tsleep(msqptr, (PZERO - 4) | PCATCH,
"msgwait", 0);
DPRINTF(("good morning, eval=%d\n", eval));
if (we_own_it)
@@ -562,7 +562,7 @@ sys_msgsnd(p, v, retval)
DPRINTF(("error %d copying the message type\n", eval));
msg_freehdr(msghdr);
msqptr->msg_perm.mode &= ~MSG_LOCKED;
- wakeup((caddr_t)msqptr);
+ wakeup(msqptr);
return (eval);
}
user_msgp += sizeof(msghdr->msg_type);
@@ -574,7 +574,7 @@ sys_msgsnd(p, v, retval)
if (msghdr->msg_type < 1) {
msg_freehdr(msghdr);
msqptr->msg_perm.mode &= ~MSG_LOCKED;
- wakeup((caddr_t)msqptr);
+ wakeup(msqptr);
DPRINTF(("mtype (%d) < 1\n", msghdr->msg_type));
return (EINVAL);
}
@@ -602,7 +602,7 @@ sys_msgsnd(p, v, retval)
eval));
msg_freehdr(msghdr);
msqptr->msg_perm.mode &= ~MSG_LOCKED;
- wakeup((caddr_t)msqptr);
+ wakeup(msqptr);
return (eval);
}
msgsz -= tlen;
@@ -625,7 +625,7 @@ sys_msgsnd(p, v, retval)
if (msqptr->msg_qbytes == 0) {
msg_freehdr(msghdr);
- wakeup((caddr_t)msqptr);
+ wakeup(msqptr);
return (EIDRM);
}
@@ -647,7 +647,7 @@ sys_msgsnd(p, v, retval)
msqptr->msg_lspid = p->p_pid;
msqptr->msg_stime = time.tv_sec;
- wakeup((caddr_t)msqptr);
+ wakeup(msqptr);
*retval = 0;
return (0);
}
@@ -814,7 +814,7 @@ sys_msgrcv(p, v, retval)
*/
DPRINTF(("msgrcv: goodnight\n"));
- eval = tsleep((caddr_t)msqptr, (PZERO - 4) | PCATCH, "msgwait",
+ eval = tsleep(msqptr, (PZERO - 4) | PCATCH, "msgwait",
0);
DPRINTF(("msgrcv: good morning (eval=%d)\n", eval));
@@ -860,12 +860,12 @@ sys_msgrcv(p, v, retval)
* Return the type to the user.
*/
- eval = copyout((caddr_t)&msghdr->msg_type, user_msgp,
+ eval = copyout(&msghdr->msg_type, user_msgp,
sizeof(msghdr->msg_type));
if (eval != 0) {
DPRINTF(("error (%d) copying out message type\n", eval));
msg_freehdr(msghdr);
- wakeup((caddr_t)msqptr);
+ wakeup(msqptr);
return (eval);
}
user_msgp += sizeof(msghdr->msg_type);
@@ -888,13 +888,13 @@ sys_msgrcv(p, v, retval)
if (next >= msginfo.msgseg)
panic("next out of range #3");
#endif
- eval = copyout((caddr_t)&msgpool[next * msginfo.msgssz],
+ eval = copyout(&msgpool[next * msginfo.msgssz],
user_msgp, tlen);
if (eval != 0) {
DPRINTF(("error (%d) copying out message segment\n",
eval));
msg_freehdr(msghdr);
- wakeup((caddr_t)msqptr);
+ wakeup(msqptr);
return (eval);
}
user_msgp += tlen;
@@ -906,7 +906,7 @@ sys_msgrcv(p, v, retval)
*/
msg_freehdr(msghdr);
- wakeup((caddr_t)msqptr);
+ wakeup(msqptr);
*retval = msgsz;
return (0);
}
diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c
index fb121a996d7..6d843f3b9c5 100644
--- a/sys/kern/sysv_sem.c
+++ b/sys/kern/sysv_sem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysv_sem.c,v 1.18 2003/06/17 21:56:25 millert Exp $ */
+/* $OpenBSD: sysv_sem.c,v 1.19 2003/07/21 22:44:50 tedu Exp $ */
/* $NetBSD: sysv_sem.c,v 1.26 1996/02/09 19:00:25 christos Exp $ */
/*
@@ -296,7 +296,7 @@ sys___semctl(struct proc *p, void *v, register_t *retval)
pool_put(&sema_pool, semaptr);
sema[semid] = NULL;
semundo_clear(semid, -1);
- wakeup((caddr_t)&sema[semid]);
+ wakeup(&sema[semid]);
break;
case IPC_SET:
@@ -304,8 +304,7 @@ sys___semctl(struct proc *p, void *v, register_t *retval)
return (error);
if ((error = copyin(arg, &real_arg, sizeof(real_arg))) != 0)
return (error);
- if ((error = copyin(real_arg.buf, (caddr_t)&sbuf,
- sizeof(sbuf))) != 0)
+ if ((error = copyin(real_arg.buf, &sbuf, sizeof(sbuf))) != 0)
return (error);
semaptr->sem_perm.uid = sbuf.sem_perm.uid;
semaptr->sem_perm.gid = sbuf.sem_perm.gid;
@@ -319,8 +318,7 @@ sys___semctl(struct proc *p, void *v, register_t *retval)
return (error);
if ((error = copyin(arg, &real_arg, sizeof(real_arg))) != 0)
return (error);
- error = copyout((caddr_t)semaptr, real_arg.buf,
- sizeof(struct semid_ds));
+ error = copyout(semaptr, real_arg.buf, sizeof(struct semid_ds));
break;
case GETNCNT:
@@ -353,7 +351,7 @@ sys___semctl(struct proc *p, void *v, register_t *retval)
if ((error = copyin(arg, &real_arg, sizeof(real_arg))) != 0)
return (error);
for (i = 0; i < semaptr->sem_nsems; i++) {
- error = copyout((caddr_t)&semaptr->sem_base[i].semval,
+ error = copyout(&semaptr->sem_base[i].semval,
&real_arg.array[i], sizeof(real_arg.array[0]));
if (error != 0)
break;
@@ -377,7 +375,7 @@ sys___semctl(struct proc *p, void *v, register_t *retval)
return (error);
semaptr->sem_base[semnum].semval = real_arg.val;
semundo_clear(semid, semnum);
- wakeup((caddr_t)&sema[semid]);
+ wakeup(&sema[semid]);
break;
case SETALL:
@@ -387,13 +385,13 @@ sys___semctl(struct proc *p, void *v, register_t *retval)
return (error);
for (i = 0; i < semaptr->sem_nsems; i++) {
error = copyin(&real_arg.array[i],
- (caddr_t)&semaptr->sem_base[i].semval,
+ &semaptr->sem_base[i].semval,
sizeof(real_arg.array[0]));
if (error != 0)
break;
}
semundo_clear(semid, -1);
- wakeup((caddr_t)&sema[semid]);
+ wakeup(&sema[semid]);
break;
default:
@@ -646,7 +644,7 @@ sys_semop(struct proc *p, void *v, register_t *retval)
semptr->semncnt++;
DPRINTF(("semop: good night!\n"));
- error = tsleep((caddr_t)&sema[semid], PLOCK | PCATCH,
+ error = tsleep(&sema[semid], PLOCK | PCATCH,
"semwait", 0);
DPRINTF(("semop: good morning (error=%d)!\n", error));
@@ -740,7 +738,7 @@ done:
/* Do a wakeup if any semaphore was up'd. */
if (do_wakeup) {
DPRINTF(("semop: doing wakeup\n"));
- wakeup((caddr_t)&sema[semid]);
+ wakeup(&sema[semid]);
DPRINTF(("semop: back from wakeup\n"));
}
DPRINTF(("semop: done\n"));
@@ -813,7 +811,7 @@ semexit(struct proc *p)
else
semaptr->sem_base[semnum].semval += adjval;
- wakeup((caddr_t)&sema[semid]);
+ wakeup(&sema[semid]);
DPRINTF(("semexit: back from wakeup\n"));
}
}
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index e8b8651247e..c164df69e4d 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_pty.c,v 1.12 2003/06/14 23:14:30 mickey Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.13 2003/07/21 22:44:50 tedu Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
@@ -136,7 +136,7 @@ ptsopen(dev, flag, devtype, p)
tp->t_state |= TS_WOPEN;
if (flag&FNONBLOCK)
break;
- error = ttysleep(tp, (caddr_t)&tp->t_rawq, TTIPRI | PCATCH,
+ error = ttysleep(tp, &tp->t_rawq, TTIPRI | PCATCH,
ttopen, 0);
if (error)
return (error);
@@ -182,7 +182,7 @@ again:
p->p_flag & P_PPWAIT)
return (EIO);
pgsignal(p->p_pgrp, SIGTTIN, 1);
- error = ttysleep(tp, (caddr_t)&lbolt,
+ error = ttysleep(tp, &lbolt,
TTIPRI | PCATCH, ttybg, 0);
if (error)
return (error);
@@ -190,7 +190,7 @@ again:
if (tp->t_canq.c_cc == 0) {
if (flag & IO_NDELAY)
return (EWOULDBLOCK);
- error = ttysleep(tp, (caddr_t)&tp->t_canq,
+ error = ttysleep(tp, &tp->t_canq,
TTIPRI | PCATCH, ttyin, 0);
if (error)
return (error);
@@ -284,12 +284,12 @@ ptcwakeup(tp, flag)
if (flag & FREAD) {
selwakeup(&pti->pt_selr);
- wakeup((caddr_t)&tp->t_outq.c_cf);
+ wakeup(&tp->t_outq.c_cf);
KNOTE(&pti->pt_selr.si_note, 0);
}
if (flag & FWRITE) {
selwakeup(&pti->pt_selw);
- wakeup((caddr_t)&tp->t_rawq.c_cf);
+ wakeup(&tp->t_rawq.c_cf);
KNOTE(&pti->pt_selw.si_note, 0);
}
}
@@ -368,8 +368,7 @@ ptcread(dev, uio, flag)
if (pti->pt_send & TIOCPKT_IOCTL) {
cc = min(uio->uio_resid,
sizeof(tp->t_termios));
- uiomove((caddr_t) &tp->t_termios,
- cc, uio);
+ uiomove(&tp->t_termios, cc, uio);
}
pti->pt_send = 0;
return (0);
@@ -388,7 +387,7 @@ ptcread(dev, uio, flag)
return (0); /* EOF */
if (flag & IO_NDELAY)
return (EWOULDBLOCK);
- error = tsleep((caddr_t)&tp->t_outq.c_cf, TTIPRI | PCATCH,
+ error = tsleep(&tp->t_outq.c_cf, TTIPRI | PCATCH,
ttyin, 0);
if (error)
return (error);
@@ -404,7 +403,7 @@ ptcread(dev, uio, flag)
if (tp->t_outq.c_cc <= tp->t_lowat) {
if (tp->t_state&TS_ASLEEP) {
tp->t_state &= ~TS_ASLEEP;
- wakeup((caddr_t)&tp->t_outq);
+ wakeup(&tp->t_outq);
}
selwakeup(&tp->t_wsel);
}
@@ -437,7 +436,7 @@ again:
cc = min(uio->uio_resid, BUFSIZ);
cc = min(cc, TTYHOG - 1 - tp->t_canq.c_cc);
cp = locbuf;
- error = uiomove((caddr_t)cp, cc, uio);
+ error = uiomove(cp, cc, uio);
if (error)
return (error);
/* check again for safety */
@@ -450,14 +449,14 @@ again:
}
(void) putc(0, &tp->t_canq);
ttwakeup(tp);
- wakeup((caddr_t)&tp->t_canq);
+ wakeup(&tp->t_canq);
return (0);
}
while (uio->uio_resid > 0) {
if (cc == 0) {
cc = min(uio->uio_resid, BUFSIZ);
cp = locbuf;
- error = uiomove((caddr_t)cp, cc, uio);
+ error = uiomove(cp, cc, uio);
if (error)
return (error);
/* check again for safety */
@@ -467,7 +466,7 @@ again:
while (cc > 0) {
if ((tp->t_rawq.c_cc + tp->t_canq.c_cc) >= TTYHOG - 2 &&
(tp->t_canq.c_cc > 0 || !ISSET(tp->t_lflag, ICANON))) {
- wakeup((caddr_t)&tp->t_rawq);
+ wakeup(&tp->t_rawq);
goto block;
}
(*linesw[tp->t_line].l_rint)(*cp++, tp);
@@ -491,7 +490,7 @@ block:
return (EWOULDBLOCK);
return (0);
}
- error = tsleep((caddr_t)&tp->t_rawq.c_cf, TTOPRI | PCATCH,
+ error = tsleep(&tp->t_rawq.c_cf, TTOPRI | PCATCH,
ttyout, 0);
if (error) {
/* adjust for data copied in but not written */
@@ -643,7 +642,7 @@ ptckqfilter(dev_t dev, struct knote *kn)
return (1);
}
- kn->kn_hook = (caddr_t)pti;
+ kn->kn_hook = pti;
s = spltty();
SLIST_INSERT_HEAD(klist, kn, kn_selnext);
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 3a037839ba0..dd9ccc822b8 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.50 2003/06/02 23:28:07 millert Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.51 2003/07/21 22:44:50 tedu Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -108,7 +108,7 @@ socreate(dom, aso, type, proto)
return (EPROTOTYPE);
s = splsoftnet();
so = pool_get(&socket_pool, PR_WAITOK);
- bzero((caddr_t)so, sizeof(*so));
+ bzero(so, sizeof(*so));
TAILQ_INIT(&so->so_q0);
TAILQ_INIT(&so->so_q);
so->so_type = type;
@@ -236,7 +236,7 @@ soclose(so)
(so->so_state & SS_NBIO))
goto drop;
while (so->so_state & SS_ISCONNECTED) {
- error = tsleep((caddr_t)&so->so_timeo,
+ error = tsleep(&so->so_timeo,
PSOCK | PCATCH, netcls,
so->so_linger * hz);
if (error)
@@ -969,7 +969,7 @@ sorflush(so)
socantrcvmore(so);
sbunlock(sb);
asb = *sb;
- bzero((caddr_t)sb, sizeof (*sb));
+ bzero(sb, sizeof (*sb));
/* XXX - the bzero stumps all over so_rcv */
if (asb.sb_flags & SB_KNOTE) {
sb->sb_sel.si_note = asb.sb_sel.si_note;
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c
index f953a299690..f26cd314958 100644
--- a/sys/kern/uipc_socket2.c
+++ b/sys/kern/uipc_socket2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket2.c,v 1.34 2003/06/02 23:28:07 millert Exp $ */
+/* $OpenBSD: uipc_socket2.c,v 1.35 2003/07/21 22:44:50 tedu Exp $ */
/* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */
/*
@@ -107,9 +107,9 @@ soisconnected(so)
if (head && soqremque(so, 0)) {
soqinsque(head, so, 1);
sorwakeup(head);
- wakeup_one((caddr_t)&head->so_timeo);
+ wakeup_one(&head->so_timeo);
} else {
- wakeup((caddr_t)&so->so_timeo);
+ wakeup(&so->so_timeo);
sorwakeup(so);
sowwakeup(so);
}
@@ -122,7 +122,7 @@ soisdisconnecting(so)
so->so_state &= ~SS_ISCONNECTING;
so->so_state |= (SS_ISDISCONNECTING|SS_CANTRCVMORE|SS_CANTSENDMORE);
- wakeup((caddr_t)&so->so_timeo);
+ wakeup(&so->so_timeo);
sowwakeup(so);
sorwakeup(so);
}
@@ -134,7 +134,7 @@ soisdisconnected(so)
so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING);
so->so_state |= (SS_CANTRCVMORE|SS_CANTSENDMORE|SS_ISDISCONNECTED);
- wakeup((caddr_t)&so->so_timeo);
+ wakeup(&so->so_timeo);
sowwakeup(so);
sorwakeup(so);
}
@@ -162,7 +162,7 @@ sonewconn(struct socket *head, int connstatus)
so = pool_get(&socket_pool, PR_NOWAIT);
if (so == NULL)
return ((struct socket *)0);
- bzero((caddr_t)so, sizeof(*so));
+ bzero(so, sizeof(*so));
so->so_type = head->so_type;
so->so_options = head->so_options &~ SO_ACCEPTCONN;
so->so_linger = head->so_linger;
@@ -186,7 +186,7 @@ sonewconn(struct socket *head, int connstatus)
}
if (connstatus) {
sorwakeup(head);
- wakeup((caddr_t)&head->so_timeo);
+ wakeup(&head->so_timeo);
so->so_state |= connstatus;
}
return (so);
@@ -270,7 +270,7 @@ sbwait(sb)
{
sb->sb_flags |= SB_WAIT;
- return (tsleep((caddr_t)&sb->sb_cc,
+ return (tsleep(&sb->sb_cc,
(sb->sb_flags & SB_NOINTR) ? PSOCK : PSOCK | PCATCH, netio,
sb->sb_timeo));
}
@@ -287,7 +287,7 @@ sb_lock(sb)
while (sb->sb_flags & SB_LOCK) {
sb->sb_flags |= SB_WANT;
- error = tsleep((caddr_t)&sb->sb_flags,
+ error = tsleep(&sb->sb_flags,
(sb->sb_flags & SB_NOINTR) ?
PSOCK : PSOCK|PCATCH, netlck, 0);
if (error)
@@ -311,7 +311,7 @@ sowakeup(so, sb)
sb->sb_flags &= ~SB_SEL;
if (sb->sb_flags & SB_WAIT) {
sb->sb_flags &= ~SB_WAIT;
- wakeup((caddr_t)&sb->sb_cc);
+ wakeup(&sb->sb_cc);
}
if (so->so_state & SS_ASYNC)
csignal(so->so_pgid, SIGIO, so->so_siguid, so->so_sigeuid);
@@ -678,7 +678,7 @@ sbappendaddr(struct sockbuf *sb, struct sockaddr *asa, struct mbuf *m0,
if (m == 0)
return (0);
m->m_len = asa->sa_len;
- bcopy((caddr_t)asa, mtod(m, caddr_t), asa->sa_len);
+ bcopy(asa, mtod(m, caddr_t), asa->sa_len);
if (n)
n->m_next = m0; /* concatenate data to control */
else
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 9408b10cc27..e311bb859eb 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_syscalls.c,v 1.54 2003/06/02 23:28:07 millert Exp $ */
+/* $OpenBSD: uipc_syscalls.c,v 1.55 2003/07/21 22:44:50 tedu Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */
/*
@@ -86,7 +86,7 @@ sys_socket(p, v, retval)
fdremove(fdp, fd);
closef(fp, p);
} else {
- fp->f_data = (caddr_t)so;
+ fp->f_data = so;
FILE_SET_MATURE(fp);
*retval = fd;
}
@@ -160,8 +160,8 @@ sys_accept(p, v, retval)
struct socket *head, *so;
int nflag;
- if (SCARG(uap, name) && (error = copyin((caddr_t)SCARG(uap, anamelen),
- (caddr_t)&namelen, sizeof (namelen))))
+ if (SCARG(uap, name) && (error = copyin(SCARG(uap, anamelen),
+ &namelen, sizeof (namelen))))
return (error);
if ((error = getsock(p->p_fd, SCARG(uap, s), &fp)) != 0)
return (error);
@@ -181,8 +181,7 @@ sys_accept(p, v, retval)
head->so_error = ECONNABORTED;
break;
}
- error = tsleep((caddr_t)&head->so_timeo, PSOCK | PCATCH,
- netcon, 0);
+ error = tsleep(&head->so_timeo, PSOCK | PCATCH, netcon, 0);
if (error) {
goto bad;
}
@@ -229,7 +228,7 @@ sys_accept(p, v, retval)
fp->f_type = DTYPE_SOCKET;
fp->f_flag = FREAD | FWRITE | nflag;
fp->f_ops = &socketops;
- fp->f_data = (caddr_t)so;
+ fp->f_data = so;
nam = m_get(M_WAIT, MT_SONAME);
error = soaccept(so, nam);
if (!error && SCARG(uap, name)) {
@@ -237,9 +236,8 @@ sys_accept(p, v, retval)
namelen = nam->m_len;
/* SHOULD COPY OUT A CHAIN HERE */
if ((error = copyout(mtod(nam, caddr_t),
- (caddr_t)SCARG(uap, name), namelen)) == 0)
- error = copyout((caddr_t)&namelen,
- (caddr_t)SCARG(uap, anamelen),
+ SCARG(uap, name), namelen)) == 0)
+ error = copyout(&namelen, SCARG(uap, anamelen),
sizeof (*SCARG(uap, anamelen)));
}
/* if an error occurred, free the file descriptor */
@@ -294,7 +292,7 @@ sys_connect(p, v, retval)
}
s = splsoftnet();
while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) {
- error = tsleep((caddr_t)&so->so_timeo, PSOCK | PCATCH,
+ error = tsleep(&so->so_timeo, PSOCK | PCATCH,
netcon, 0);
if (error)
break;
@@ -345,13 +343,13 @@ sys_socketpair(p, v, retval)
fp1->f_flag = FREAD|FWRITE;
fp1->f_type = DTYPE_SOCKET;
fp1->f_ops = &socketops;
- fp1->f_data = (caddr_t)so1;
+ fp1->f_data = so1;
if ((error = falloc(p, &fp2, &fd)) != 0)
goto free3;
fp2->f_flag = FREAD|FWRITE;
fp2->f_type = DTYPE_SOCKET;
fp2->f_ops = &socketops;
- fp2->f_data = (caddr_t)so2;
+ fp2->f_data = so2;
sv[1] = fd;
if ((error = soconnect2(so1, so2)) != 0)
goto free4;
@@ -362,8 +360,7 @@ sys_socketpair(p, v, retval)
if ((error = soconnect2(so2, so1)) != 0)
goto free4;
}
- error = copyout((caddr_t)sv, (caddr_t)SCARG(uap, rsv),
- 2 * sizeof (int));
+ error = copyout(sv, SCARG(uap, rsv), 2 * sizeof (int));
if (error == 0) {
FILE_SET_MATURE(fp1);
FILE_SET_MATURE(fp2);
@@ -431,7 +428,7 @@ sys_sendmsg(p, v, retval)
struct iovec aiov[UIO_SMALLIOV], *iov;
int error;
- error = copyin(SCARG(uap, msg), (caddr_t)&msg, sizeof (msg));
+ error = copyin(SCARG(uap, msg), &msg, sizeof (msg));
if (error)
return (error);
if (msg.msg_iovlen < 0 || msg.msg_iovlen > IOV_MAX)
@@ -442,8 +439,8 @@ sys_sendmsg(p, v, retval)
else
iov = aiov;
if (msg.msg_iovlen &&
- (error = copyin((caddr_t)msg.msg_iov, (caddr_t)iov,
- (unsigned)(msg.msg_iovlen * sizeof (struct iovec)))))
+ (error = copyin(msg.msg_iov, iov,
+ (unsigned)(msg.msg_iovlen * sizeof (struct iovec)))))
goto done;
msg.msg_iov = iov;
#ifdef COMPAT_OLDSOCK
@@ -531,7 +528,7 @@ sendit(p, s, mp, flags, retsize)
int iovlen = auio.uio_iovcnt * sizeof (struct iovec);
ktriov = malloc(iovlen, M_TEMP, M_WAITOK);
- bcopy((caddr_t)auio.uio_iov, (caddr_t)ktriov, iovlen);
+ bcopy(auio.uio_iov, ktriov, iovlen);
}
#endif
len = auio.uio_resid;
@@ -579,8 +576,8 @@ sys_recvfrom(p, v, retval)
int error;
if (SCARG(uap, fromlenaddr)) {
- error = copyin((caddr_t)SCARG(uap, fromlenaddr),
- (caddr_t)&msg.msg_namelen, sizeof (msg.msg_namelen));
+ error = copyin(SCARG(uap, fromlenaddr),
+ &msg.msg_namelen, sizeof (msg.msg_namelen));
if (error)
return (error);
} else
@@ -611,8 +608,7 @@ sys_recvmsg(p, v, retval)
struct iovec aiov[UIO_SMALLIOV], *uiov, *iov;
int error;
- error = copyin((caddr_t)SCARG(uap, msg), (caddr_t)&msg,
- sizeof (msg));
+ error = copyin(SCARG(uap, msg), &msg, sizeof (msg));
if (error)
return (error);
if (msg.msg_iovlen < 0 || msg.msg_iovlen > IOV_MAX)
@@ -628,17 +624,16 @@ sys_recvmsg(p, v, retval)
msg.msg_flags = SCARG(uap, flags);
#endif
if (msg.msg_iovlen > 0) {
- error = copyin((caddr_t)msg.msg_iov, (caddr_t)iov,
+ error = copyin(msg.msg_iov, iov,
(unsigned)(msg.msg_iovlen * sizeof (struct iovec)));
if (error)
goto done;
}
uiov = msg.msg_iov;
msg.msg_iov = iov;
- if ((error = recvit(p, SCARG(uap, s), &msg, (caddr_t)0, retval)) == 0) {
+ if ((error = recvit(p, SCARG(uap, s), &msg, NULL, retval)) == 0) {
msg.msg_iov = uiov;
- error = copyout((caddr_t)&msg, (caddr_t)SCARG(uap, msg),
- sizeof(msg));
+ error = copyout(&msg, SCARG(uap, msg), sizeof(msg));
}
done:
if (iov != aiov)
@@ -688,7 +683,7 @@ recvit(p, s, mp, namelenp, retsize)
int iovlen = auio.uio_iovcnt * sizeof (struct iovec);
ktriov = malloc(iovlen, M_TEMP, M_WAITOK);
- bcopy((caddr_t)auio.uio_iov, (caddr_t)ktriov, iovlen);
+ bcopy(auio.uio_iov, ktriov, iovlen);
}
#endif
len = auio.uio_resid;
@@ -728,13 +723,13 @@ recvit(p, s, mp, namelenp, retsize)
mtod(from, struct sockaddr *)->sa_family;
#endif
error = copyout(mtod(from, caddr_t),
- (caddr_t)mp->msg_name, alen);
+ mp->msg_name, alen);
if (error)
goto out;
}
mp->msg_namelen = alen;
if (namelenp &&
- (error = copyout((caddr_t)&alen, namelenp, sizeof(alen)))) {
+ (error = copyout(&alen, namelenp, sizeof(alen)))) {
#ifdef COMPAT_OLDSOCK
if (mp->msg_flags & MSG_COMPAT)
error = 0; /* old recvfrom didn't check */
diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c
index 7f40b9f9bb7..de53acc4882 100644
--- a/sys/kern/vfs_default.c
+++ b/sys/kern/vfs_default.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_default.c,v 1.20 2003/06/02 23:28:07 millert Exp $ */
+/* $OpenBSD: vfs_default.c,v 1.21 2003/07/21 22:44:50 tedu Exp $ */
/*
* Portions of this code are:
@@ -84,7 +84,7 @@ vop_generic_revoke(v)
if (vp->v_flag & VXLOCK) {
vp->v_flag |= VXWANT;
simple_unlock(&vp->v_interlock);
- tsleep((caddr_t)vp, PINOD, "vop_generic_revokeall", 0);
+ tsleep(vp, PINOD, "vop_generic_revokeall", 0);
return(0);
}
/*
diff --git a/sys/kern/vfs_lockf.c b/sys/kern/vfs_lockf.c
index e6bf5f96618..69195ee9dec 100644
--- a/sys/kern/vfs_lockf.c
+++ b/sys/kern/vfs_lockf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_lockf.c,v 1.6 2003/06/02 23:28:07 millert Exp $ */
+/* $OpenBSD: vfs_lockf.c,v 1.7 2003/07/21 22:44:50 tedu Exp $ */
/* $NetBSD: vfs_lockf.c,v 1.7 1996/02/04 02:18:21 christos Exp $ */
/*
@@ -256,7 +256,7 @@ lf_setlock(lock)
}
#endif /* LOCKF_DEBUG */
TAILQ_INSERT_TAIL(&block->lf_blkhd, lock, lf_block);
- error = tsleep((caddr_t)lock, priority, lockstr, 0);
+ error = tsleep(lock, priority, lockstr, 0);
#if 0
if (error) {
/*
@@ -664,7 +664,7 @@ lf_split(lock1, lock2)
* the encompassing lock
*/
MALLOC(splitlock, struct lockf *, sizeof *splitlock, M_LOCKF, M_WAITOK);
- memcpy((caddr_t)splitlock, (caddr_t)lock1, sizeof (*splitlock));
+ memcpy(splitlock, lock1, sizeof (*splitlock));
splitlock->lf_start = lock2->lf_end + 1;
splitlock->lf_block.tqe_next = NULL;
TAILQ_INIT(&splitlock->lf_blkhd);
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 7701435f8df..54e92f6bf62 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.94 2003/06/02 23:28:07 millert Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.95 2003/07/21 22:44:50 tedu Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -676,7 +676,7 @@ vget(vp, flags, p)
if (vp->v_flag & VXLOCK) {
vp->v_flag |= VXWANT;
simple_unlock(&vp->v_interlock);
- tsleep((caddr_t)vp, PINOD, "vget", 0);
+ tsleep(vp, PINOD, "vget", 0);
return (ENOENT);
}
if (vp->v_usecount == 0 &&
@@ -1082,7 +1082,7 @@ vclean(vp, flags, p)
#endif
if (vp->v_flag & VXWANT) {
vp->v_flag &= ~VXWANT;
- wakeup((caddr_t)vp);
+ wakeup(vp);
}
}
@@ -1143,7 +1143,7 @@ vgonel(vp, p)
if (vp->v_flag & VXLOCK) {
vp->v_flag |= VXWANT;
simple_unlock(&vp->v_interlock);
- tsleep((caddr_t)vp, PINOD, "vgone", 0);
+ tsleep(vp, PINOD, "vgone", 0);
return;
}
/*
@@ -1473,10 +1473,10 @@ again:
vfs_unbusy(mp, p);
return (ENOMEM);
}
- if ((error = copyout((caddr_t)&vp,
+ if ((error = copyout(&vp,
&((struct e_vnode *)bp)->vptr,
sizeof(struct vnode *))) ||
- (error = copyout((caddr_t)vp,
+ (error = copyout(vp,
&((struct e_vnode *)bp)->vnode,
sizeof(struct vnode)))) {
vfs_unbusy(mp, p);
@@ -1558,16 +1558,16 @@ vfs_hang_addrlist(mp, nep, argp)
return (EINVAL);
i = sizeof(struct netcred) + argp->ex_addrlen + argp->ex_masklen;
np = (struct netcred *)malloc(i, M_NETADDR, M_WAITOK);
- bzero((caddr_t)np, i);
+ bzero(np, i);
saddr = (struct sockaddr *)(np + 1);
- error = copyin(argp->ex_addr, (caddr_t)saddr, argp->ex_addrlen);
+ error = copyin(argp->ex_addr, saddr, argp->ex_addrlen);
if (error)
goto out;
if (saddr->sa_len > argp->ex_addrlen)
saddr->sa_len = argp->ex_addrlen;
if (argp->ex_masklen) {
smask = (struct sockaddr *)((caddr_t)saddr + argp->ex_addrlen);
- error = copyin(argp->ex_mask, (caddr_t)smask, argp->ex_masklen);
+ error = copyin(argp->ex_mask, smask, argp->ex_masklen);
if (error)
goto out;
if (smask->sa_len > argp->ex_masklen)
@@ -1618,7 +1618,7 @@ vfs_free_netcred(rn, w)
register struct radix_node_head *rnh = (struct radix_node_head *)w;
(*rnh->rnh_deladdr)(rn->rn_key, rn->rn_mask, rnh);
- free((caddr_t)rn, M_NETADDR);
+ free(rn, M_NETADDR);
return (0);
}
@@ -1635,7 +1635,7 @@ vfs_free_addrlist(nep)
for (i = 0; i <= AF_MAX; i++)
if ((rnh = nep->ne_rtable[i]) != NULL) {
(*rnh->rnh_walktree)(rnh, vfs_free_netcred, rnh);
- free((caddr_t)rnh, M_RTABLE);
+ free(rnh, M_RTABLE);
nep->ne_rtable[i] = 0;
}
}
@@ -1936,7 +1936,7 @@ vwaitforio(vp, slpflag, wmesg, timeo)
while (vp->v_numoutput) {
vp->v_bioflag |= VBIOWAIT;
- error = tsleep((caddr_t)&vp->v_numoutput,
+ error = tsleep(&vp->v_numoutput,
slpflag | (PRIBIO + 1), wmesg, timeo);
if (error)
break;
@@ -1962,7 +1962,7 @@ vwakeup(vp)
panic("vwakeup: neg numoutput");
if ((vp->v_bioflag & VBIOWAIT) && vp->v_numoutput == 0) {
vp->v_bioflag &= ~VBIOWAIT;
- wakeup((caddr_t)&vp->v_numoutput);
+ wakeup(&vp->v_numoutput);
}
}
}
@@ -2017,9 +2017,8 @@ loop:
continue;
if (bp->b_flags & B_BUSY) {
bp->b_flags |= B_WANTED;
- error = tsleep((caddr_t)bp,
- slpflag | (PRIBIO + 1), "vinvalbuf",
- slptimeo);
+ error = tsleep(bp, slpflag | (PRIBIO + 1),
+ "vinvalbuf", slptimeo);
if (error) {
splx(s);
return (error);
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 62c37d27026..04354256017 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_vnops.c,v 1.42 2003/06/02 23:28:07 millert Exp $ */
+/* $OpenBSD: vfs_vnops.c,v 1.43 2003/07/21 22:44:50 tedu Exp $ */
/* $NetBSD: vfs_vnops.c,v 1.20 1996/02/04 02:18:41 christos Exp $ */
/*
@@ -498,7 +498,7 @@ vn_lock(struct vnode *vp, int flags, struct proc *p)
if (vp->v_flag & VXLOCK) {
vp->v_flag |= VXWANT;
simple_unlock(&vp->v_interlock);
- tsleep((caddr_t)vp, PINOD, "vn_lock", 0);
+ tsleep(vp, PINOD, "vn_lock", 0);
error = ENOENT;
} else {
error = VOP_LOCK(vp, flags | LK_INTERLOCK, p);
diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src
index 220eb4b0fb0..8b8c002574e 100644
--- a/sys/kern/vnode_if.src
+++ b/sys/kern/vnode_if.src
@@ -1,4 +1,4 @@
-# $OpenBSD: vnode_if.src,v 1.21 2003/06/02 23:28:07 millert Exp $
+# $OpenBSD: vnode_if.src,v 1.22 2003/07/21 22:44:50 tedu Exp $
# $NetBSD: vnode_if.src,v 1.10 1996/05/11 18:26:27 mycroft Exp $
#
# Copyright (c) 1992, 1993
@@ -203,7 +203,7 @@ vop_lease {
vop_ioctl {
IN struct vnode *vp;
IN u_long command;
- IN caddr_t data;
+ IN void *data;
IN int fflag;
IN struct ucred *cred;
IN struct proc *p;
@@ -433,7 +433,7 @@ vop_pathconf {
#
vop_advlock {
IN struct vnode *vp;
- IN caddr_t id;
+ IN void *id;
IN int op;
IN struct flock *fl;
IN int flags;
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index 9844f351062..77cde4d86c0 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: systm.h,v 1.56 2003/06/02 23:28:22 millert Exp $ */
+/* $OpenBSD: systm.h,v 1.57 2003/07/21 22:44:49 tedu Exp $ */
/* $NetBSD: systm.h,v 1.50 1996/06/09 04:55:09 briggs Exp $ */
/*-
@@ -267,7 +267,7 @@ void dopowerhooks(int);
#define PWR_STANDBY 2
struct uio;
-int uiomove(caddr_t, int, struct uio *);
+int uiomove(void *, int, struct uio *);
int setjmp(label_t *);
void longjmp(label_t *);