style(9) pass and type fixups.

Submitted by:	bde
This commit is contained in:
Bruce M Simpson 2003-12-16 14:13:47 +00:00
parent 2572485481
commit 5406529771
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=123564
3 changed files with 10 additions and 16 deletions

View File

@ -761,14 +761,13 @@ out: if (((m = m0)->m_flags & M_PKTHDR) && (m->m_pkthdr.len < totlen))
*/
int
m_apply(struct mbuf *m, int off, int len,
int (*f)(void *, caddr_t, unsigned int), void *arg)
int (*f)(void *, void *, u_int), void *arg)
{
unsigned int count;
u_int count;
int rval;
KASSERT(off >= 0, ("m_apply, negative off %d", off));
KASSERT(len >= 0, ("m_apply, negative len %d", len));
while (off > 0) {
KASSERT(m != NULL, ("m_apply, offset > size of mbuf chain"));
if (off < m->m_len)
@ -779,16 +778,13 @@ m_apply(struct mbuf *m, int off, int len,
while (len > 0) {
KASSERT(m != NULL, ("m_apply, offset > size of mbuf chain"));
count = min(m->m_len - off, len);
rval = (*f)(arg, mtod(m, caddr_t) + off, count);
if (rval)
return (rval);
len -= count;
off = 0;
m = m->m_next;
}
return (0);
}
@ -800,25 +796,23 @@ m_getptr(struct mbuf *m, int loc, int *off)
{
while (loc >= 0) {
/* Normal end of search */
/* Normal end of search. */
if (m->m_len > loc) {
*off = loc;
return (m);
} else {
loc -= m->m_len;
if (m->m_next == NULL) {
if (loc == 0) {
/* Point at the end of valid data */
/* Point at the end of valid data. */
*off = m->m_len;
return (m);
} else
return (NULL);
} else
m = m->m_next;
}
return (NULL);
}
m = m->m_next;
}
}
return (NULL);
}

View File

@ -453,7 +453,7 @@ swcr_authcompute(struct cryptop *crp, struct cryptodesc *crd,
break;
case CRYPTO_BUF_MBUF:
err = m_apply((struct mbuf *) buf, crd->crd_skip, crd->crd_len,
(int (*)(void *, caddr_t, unsigned int)) axf->Update,
(int (*)(void *, void *, unsigned int)) axf->Update,
(caddr_t) &ctx);
if (err)
return err;

View File

@ -436,7 +436,7 @@ extern int nsfbufs; /* Number of sendfile(2) bufs */
void _mext_free(struct mbuf *);
void m_adj(struct mbuf *, int);
int m_apply(struct mbuf *, int, int,
int (*)(void *, caddr_t, unsigned int), void *);
int (*)(void *, void *, unsigned int), void *);
void m_cat(struct mbuf *, struct mbuf *);
void m_chtype(struct mbuf *, short);
void m_clget(struct mbuf *, int);