From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 1DF552030; Wed, 13 Dec 2017 14:22:57 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Dec 2017 05:22:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,397,1508828400"; d="scan'208";a="13116827" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.106]) by fmsmga001.fm.intel.com with SMTP; 13 Dec 2017 05:22:54 -0800 Received: by (sSMTP sendmail emulation); Wed, 13 Dec 2017 13:22:54 +0000 Date: Wed, 13 Dec 2017 13:22:53 +0000 From: Bruce Richardson To: Hemant Agrawal Cc: dev@dpdk.org, thomas@monjalon.net, Michal Kobylinski , stable@dpdk.org, Jun Yang Message-ID: <20171213132253.GA10724@bricha3-MOBL3.ger.corp.intel.com> References: <1509617335-6354-1-git-send-email-hemant.agrawal@nxp.com> <1513169578-28440-1-git-send-email-hemant.agrawal@nxp.com> <1513169578-28440-2-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1513169578-28440-2-git-send-email-hemant.agrawal@nxp.com> Organization: Intel Research and Development Ireland Ltd. User-Agent: Mutt/1.9.1 (2017-09-22) Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2 2/5] lpm: fix compilation on ARM BE X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Dec 2017 13:22:58 -0000 On Wed, Dec 13, 2017 at 06:22:55PM +0530, Hemant Agrawal wrote: > Compiling on ARM BE using Linaro toolchain caused following > error/warnings. > > rte_lpm.c: In function ‘add_depth_big_v20’: > rte_lpm.c:911:4: error: braces around scalar initializer [-Werror] > { .group_idx = (uint8_t)tbl8_group_index, }, > ^ > rte_lpm.c:911:4: note: (near initialization for > ‘new_tbl24_entry.depth’) > rte_lpm.c:911:6:error: field name not in record or union initializer > { .group_idx = (uint8_t)tbl8_group_index, }, > ^ > rte_lpm.c:911:6: note: (near initialization for > ‘new_tbl24_entry.depth’) > rte_lpm.c:914:13: error: initialized field overwritten > [-Werror=override-init] > .depth = 0, > > Fixes: dc81ebbacaeb ("lpm: extend IPv4 next hop field") > Cc: Michal Kobylinski > Cc: stable@dpdk.org > > Signed-off-by: Jun Yang > Signed-off-by: Hemant Agrawal > Acked-by: Bruce Richardson > --- > v2: added endianess check in the assignments > > lib/librte_lpm/rte_lpm.c | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c > index e1f1fad..a47c04f 100644 > --- a/lib/librte_lpm/rte_lpm.c > +++ b/lib/librte_lpm/rte_lpm.c > @@ -912,10 +912,17 @@ add_depth_big_v20(struct rte_lpm_v20 *lpm, uint32_t ip_masked, uint8_t depth, > */ > > struct rte_lpm_tbl_entry_v20 new_tbl24_entry = { > +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN > { .group_idx = (uint8_t)tbl8_group_index, }, > .valid = VALID, > .valid_group = 1, > .depth = 0, > +#else > + .depth = 0, > + .valid_group = 1, > + .valid = VALID, > + { .group_idx = (uint8_t)tbl8_group_index, }, > +#endif > }; > I'm not I'd agree with this as a "better" fix. Were the issues with the previous version of just removing the braces. All the ifdefs are rather ugly.