From owner-svn-src-all@FreeBSD.ORG Thu Jan 8 14:58:55 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E74F7EA; Thu, 8 Jan 2015 14:58:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3254B36; Thu, 8 Jan 2015 14:58:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t08EwtbW018005; Thu, 8 Jan 2015 14:58:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t08Ewt83018003; Thu, 8 Jan 2015 14:58:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201501081458.t08Ewt83018003@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Jan 2015 14:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r276824 - in head/sys/ofed/drivers/infiniband/ulp: ipoib sdp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2015 14:58:56 -0000 Author: hselasky Date: Thu Jan 8 14:58:54 2015 New Revision: 276824 URL: https://svnweb.freebsd.org/changeset/base/276824 Log: Use the M_SIZE() macro when possible. MFC after: 3 days Suggested by: rwatson@ Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Thu Jan 8 14:45:54 2015 (r276823) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Thu Jan 8 14:58:54 2015 (r276824) @@ -117,8 +117,7 @@ ipoib_alloc_map_mb(struct ipoib_dev_priv 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); Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Thu Jan 8 14:45:54 2015 (r276823) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Thu Jan 8 14:58:54 2015 (r276824) @@ -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 *);