From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 686A64F9A for ; Thu, 17 May 2018 12:53:59 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 May 2018 03:53:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,410,1520924400"; d="scan'208";a="41701725" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.55]) by orsmga007.jf.intel.com with SMTP; 17 May 2018 03:53:55 -0700 Received: by (sSMTP sendmail emulation); Thu, 17 May 2018 11:53:54 +0100 Date: Thu, 17 May 2018 11:53:54 +0100 From: Bruce Richardson To: Andy Green Cc: dev@dpdk.org Message-ID: <20180517105353.GD22048@bricha3-MOBL.ger.corp.intel.com> References: <152627436523.53156.4398253089110011263.stgit@localhost.localdomain> <152627462791.53156.5271968691770807055.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <152627462791.53156.5271968691770807055.stgit@localhost.localdomain> Organization: Intel Research and Development Ireland Ltd. User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v4 12/23] rte_mbuf.h: explicit cast for size type to uint32 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 10:53:59 -0000 On Mon, May 14, 2018 at 01:10:27PM +0800, Andy Green wrote: > Signed-off-by: Andy Green > --- > lib/librte_mbuf/rte_mbuf.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h > index 0580ec8a0..169f3d3b0 100644 > --- a/lib/librte_mbuf/rte_mbuf.h > +++ b/lib/librte_mbuf/rte_mbuf.h > @@ -1577,7 +1577,7 @@ static inline void rte_pktmbuf_detach(struct rte_mbuf *m) > __rte_pktmbuf_free_direct(m); > > priv_size = rte_pktmbuf_priv_size(mp); > - mbuf_size = sizeof(struct rte_mbuf) + priv_size; > + mbuf_size = (uint32_t)sizeof(struct rte_mbuf) + priv_size; > buf_len = rte_pktmbuf_data_room_size(mp); > > m->priv_size = priv_size; > It would be good to include the error message in the commit log. Also, for safety, is it better to have extra braces to cast the whole expression, not just the sizeof, i.e. mbuf_size = (uint32_t)(sizeof(...) + priv_size); /Bruce