From 51aafa4f2b795bc41e545b776205d9b1d3d0d874 Mon Sep 17 00:00:00 2001 From: hselasky Date: Thu, 8 Jan 2015 14:58:54 +0000 Subject: [PATCH] Use the M_SIZE() macro when possible. MFC after: 3 days Suggested by: rwatson@ --- sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c | 3 +-- sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 6005a394170c..4fb39b410cd8 100644 --- a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -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); diff --git a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c index 1fe5cb060fa9..4e581ab1a962 100644 --- a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c +++ b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c @@ -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 *);