From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id BCCC41D0C7 for ; Sun, 13 May 2018 18:59:36 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 491A625ACD; Sun, 13 May 2018 12:59:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 13 May 2018 12:59:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=ezwIgA2w+2wELX46YeA+cRndDR ognbfDy0LEPMYLJwc=; b=L+f1BitWMum55+1j8TGChJBQtiNYWoHbUhXeA3PRCv SZ7H5U+hNrcg8SRdzUSbt+mSDEybzBYqfQwq6XMnBGjIU293EpBgCUZ3Pxsu544h 3LSu8NOR5xT4pRDXKGN4Tu8u9ZgrPT/YIU7iamg5MuS4ZFr8DK07qhzqnLWzKG+c w= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=ezwIgA 2w+2wELX46YeA+cRndDRognbfDy0LEPMYLJwc=; b=bpbWsTUfZDrZ2aTnMFS92G EuIxYpC50Mas7e0qlqHDPIHAZ4QpFjPB62Jp3ba8qUTHMnHlw5kQCrp73sOeIL3b rln4ZaRe3ZZEruqfx5JfpTC4J9F4niHKm3GB6+xPV+0kEqtW4nXnST7Kc2hvfhgH AfjchRKschMDCM0ZjvMKyUDxRikOnkSeSAtT1Kaa8G/HgX8pqQ6ifwyhRiEXJ36S lZlReRH2W8epgQ7RSQrJKG68QbSsQlwX0ZrUA8JMOxIZoMjlM27Jzw48liU4GYIU m2tsN++7I5p09IoJ0KTujh5+OnXc4w0ME83y1G2uC80WvaVqmk+PuFBJ9BHlv6MQ == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id B3DC6E4855; Sun, 13 May 2018 12:59:35 -0400 (EDT) From: Thomas Monjalon To: Andy Green Cc: dev@dpdk.org Date: Sun, 13 May 2018 18:59:34 +0200 Message-ID: <10112839.slRIOooWqA@xps> In-Reply-To: <152609040775.121661.12633606299514774674.stgit@localhost.localdomain> References: <152609021699.121661.5295227351721865436.stgit@localhost.localdomain> <152609040775.121661.12633606299514774674.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 17/24] rte_byteorder.h: explicit cast for return promotion 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: Sun, 13 May 2018 16:59:37 -0000 12/05/2018 04:00, Andy Green: > --- a/lib/librte_eal/common/include/generic/rte_byteorder.h > +++ b/lib/librte_eal/common/include/generic/rte_byteorder.h > @@ -123,7 +123,7 @@ typedef uint64_t rte_le64_t; /**< 64-bit little-endian value. */ > static inline uint16_t > rte_constant_bswap16(uint16_t x) > { > - return RTE_STATIC_BSWAP16(x); > + return (uint16_t)RTE_STATIC_BSWAP16((uint16_t)x); > } x is already uint16_t, and RTE_STATIC_BSWAP16 is already casting to uint16_t. So why these casts are needed? And why not in rte_constant_bswap32/64?