From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 7C32E2965 for ; Fri, 26 Oct 2018 22:24:42 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id F40312208D; Fri, 26 Oct 2018 16:24:41 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 26 Oct 2018 16:24:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=UYvALAy/k1JL6WoFH+dudh6YRMQBuzy0mRC9dlp4Bl4=; b=LWlfRKV0sUzn utz4veJivvWmW9TYivXkhSYThx47sf23P2nYZyBgHsv4RIKjX6JCimL2yoy2LBmI Al5BladT3IwQUSGmdDAtSeYTA78gUArEVRWkX/UqNwqILbQEsKUdOTtn/AW2FtMl scq/Mii70pcG94ViFdK/e/T3QHQwEe4= 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-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=UYvALAy/k1JL6WoFH+dudh6YRMQBuzy0mRC9dlp4B l4=; b=Xv+vQphb6IL8GAr0EArS6A2LW0M3Og0GPB26AYeCJYfBCb1CpzhJwVMu6 4py8XwuaLFNK7qcQqNfDPQm4g1T/G9trT2OmehDA+1TdLW2T5j4fhw/N5TfhB8F9 utrQm9FMEnHeW80X+/9JoKw14hW+KfhhnP+R7v1Ig6yf4YdYEZBBl+WKx2rySAdc MH3OEobzOMggPRoZd2CLzPh7Sle6dgidlY8oi18SXNEjJuRu6puXUq+4BYdfO/Uc kVhq5ZF3Dwx/hnIzw8drz6Ej60M3cfAsHDmcVDsy4/Cr6nH1/DTQnqKtSObniGox fhWCw33BsAW1diqG9NjeO8G+m0ehQ== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 907B8E4408; Fri, 26 Oct 2018 16:24:40 -0400 (EDT) From: Thomas Monjalon To: Dharmik Thakkar Cc: Bruce Richardson , Pablo de Lara , dev@dpdk.org, honnappa.nagarahalli@arm.com, yipeng1.wang@intel.com Date: Fri, 26 Oct 2018 22:24:45 +0200 Message-ID: <3800213.8SZGDA9kEc@xps> In-Reply-To: <1537298539-31403-1-git-send-email-dharmik.thakkar@arm.com> References: <1535379969-19642-1-git-send-email-dharmik.thakkar@arm.com> <1537298539-31403-1-git-send-email-dharmik.thakkar@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v2] test/hash: solve unit test hash compilation error 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: Fri, 26 Oct 2018 20:24:42 -0000 +Cc Yipeng 18/09/2018 21:22, Dharmik Thakkar: > Enable print_key_info() function compilation always. Please see my first comment: you need to show the compilation error in this message. Otherwise, we don't know what you are trying to fix. > Fixes: af75078fece36 ("first public release") > Cc: stable@dpdk.org > > Suggested-by: Honnappa Nagarahalli > Signed-off-by: Dharmik Thakkar > Reviewed-by: Honnappa Nagarahalli > Reviewed-by: Gavin Hu > --- > v2: > * Fix checkpatch coding style issue > * Add "Fixes:" tag > --- > test/test/test_hash.c | 24 +++++++++--------------- > 1 file changed, 9 insertions(+), 15 deletions(-) > > diff --git a/test/test/test_hash.c b/test/test/test_hash.c > index b3db9fd10547..db6442a2b101 100644 > --- a/test/test/test_hash.c > +++ b/test/test/test_hash.c > +#define UNIT_TEST_HASH_VERBOSE 0 > /* > * Print out result of unit test hash operation. > */ > -#if defined(UNIT_TEST_HASH_VERBOSE) > static void print_key_info(const char *msg, const struct flow_key *key, > int32_t pos) > { > - uint8_t *p = (uint8_t *)key; > - unsigned i; > - > - printf("%s key:0x", msg); > - for (i = 0; i < sizeof(struct flow_key); i++) { > - printf("%02X", p[i]); > + if (UNIT_TEST_HASH_VERBOSE) { This is very suspicious. Why keeping this code if it is never called? > + const uint8_t *p = (const uint8_t *)key; > + unsigned int i; > + > + printf("%s key:0x", msg); > + for (i = 0; i < sizeof(struct flow_key); i++) > + printf("%02X", p[i]); > + printf(" @ pos %d\n", pos); > } > - printf(" @ pos %d\n", pos); > -} > -#else > -static void print_key_info(__attribute__((unused)) const char *msg, > - __attribute__((unused)) const struct flow_key *key, > - __attribute__((unused)) int32_t pos) > -{ > } > -#endif