From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [dpdk-stable] [PATCH v2] test/hash: solve unit test hash compilation error Date: Fri, 26 Oct 2018 22:24:45 +0200 Message-ID: <3800213.8SZGDA9kEc@xps> 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: Bruce Richardson , Pablo de Lara , dev@dpdk.org, honnappa.nagarahalli@arm.com, yipeng1.wang@intel.com To: Dharmik Thakkar 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) In-Reply-To: <1537298539-31403-1-git-send-email-dharmik.thakkar@arm.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" +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