Use the M_SIZE() macro when possible.

MFC after:	3 days
Suggested by:	rwatson@
This commit is contained in:
hselasky 2015-01-08 14:58:54 +00:00
parent 9117e0288e
commit 51aafa4f2b
2 changed files with 2 additions and 4 deletions

View File

@ -117,8 +117,7 @@ ipoib_alloc_map_mb(struct ipoib_dev_priv *priv, struct ipoib_rx_buf *rx_req,
if (mb == NULL)
return (NULL);
for (i = 0, m = mb; m != NULL; m = m->m_next, i++) {
m->m_len = (m->m_flags & M_EXT) ? m->m_ext.ext_size :
((m->m_flags & M_PKTHDR) ? MHLEN : MLEN);
m->m_len = M_SIZE(m);
mb->m_pkthdr.len += m->m_len;
rx_req->mapping[i] = ib_dma_map_single(priv->ca,
mtod(m, void *), m->m_len, DMA_FROM_DEVICE);

View File

@ -116,8 +116,7 @@ sdp_post_recv(struct sdp_sock *ssk)
return -1;
}
for (m = mb; m != NULL; m = m->m_next) {
m->m_len = (m->m_flags & M_EXT) ? m->m_ext.ext_size :
((m->m_flags & M_PKTHDR) ? MHLEN : MLEN);
m->m_len = M_SIZE(m);
mb->m_pkthdr.len += m->m_len;
}
h = mtod(mb, struct sdp_bsdh *);