summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_mbuf.c
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2003-12-16 14:13:47 +0000
committerbms <bms@FreeBSD.org>2003-12-16 14:13:47 +0000
commit1b8b89ab32a670ae5569eb2305e03c563ebe89ab (patch)
tree1200da15acf451b76081b2c4b9a4e9a85928ee70 /sys/kern/uipc_mbuf.c
parent0d7845a7ec88c3df6156acd09ffd1e01a76cae8e (diff)
downloadFreeBSD-src-1b8b89ab32a670ae5569eb2305e03c563ebe89ab.zip
FreeBSD-src-1b8b89ab32a670ae5569eb2305e03c563ebe89ab.tar.gz
style(9) pass and type fixups.
Submitted by: bde
Diffstat (limited to 'sys/kern/uipc_mbuf.c')
-rw-r--r--sys/kern/uipc_mbuf.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 52b6bb1..aa6e532 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -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);
}
OpenPOWER on IntegriCloud