From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932352AbcH2VuX (ORCPT ); Mon, 29 Aug 2016 17:50:23 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:60249 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756203AbcH2VuT (ORCPT ); Mon, 29 Aug 2016 17:50:19 -0400 From: Arnd Bergmann To: Andrew Morton Cc: kernel-build-reports@lists.linaro.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Arnd Bergmann Subject: [PATCH 3/3] test/hash: Fix warning in preprocessor symbol evaluation Date: Mon, 29 Aug 2016 23:49:52 +0200 Message-Id: <20160829214952.1334674-4-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160829214952.1334674-1-arnd@arndb.de> References: <20160829214952.1334674-1-arnd@arndb.de> X-Provags-ID: V03:K0:MQNABdwl3r8OlsMY70ftGHwL1ITg57sPZoHmPn9Ttk+P/hP7Lqy PrJNlhz/l9boNpbyWjkJyITOhPfmBBYDHl1P7c3aU/MC/HmKMSkTmQtkC0EVa/V+bqKuQwV Ths9FhBLRIz4P9OvByuLNR0da9xRguOK1dylz3mh9kl4/UtshmXsY23LDiZkt1UkgKXvn3A bLfS7uc3lDO7O9N5yDYAw== X-UI-Out-Filterresults: notjunk:1;V01:K0:UyAp3Robwn0=:/YUYIm1PaGHH12X5jnuN5X 1WQQJagBGrFoYOemAzTdwf0GStscD/Ods7PZYBqP9OC1oKsR58s3Tgsll4fJqH/e0mDo6xdC9 862i5LbqS2PSWFKN8DgbMDuRfRx3ADjuF+DXqKFP0g6auyl9vN+riVYjnNDlERv2/krNZyk7C 0OVgdkVmmagnNqS1X6yHenMnapU6TlsjEoe0fRFa8zMmc2B65yeoVq8t86Bc7gl/3vGz8X74T VJoluvlocE4AVdPRaz4B6CZj7oj5rlA5QJvbL4AHl3OzJjPeq9dYUshDqN+l/gdmh5X5l5n0x OwpthvOShvu2aEaODVpnsFyZLE7UEDG47KEB/xiC9J9haHg8MjrebEkxaukmj/lPSFQN/an4I 6+qksTh8VVzamaJ36W6ZgVvcbYANQDOBrSasK/27DNwciMRRAdTTX97Q22Kk2UVSLIdXMADIf 8YRXehY1szu3dEEBG4caIoWLP0F855wXgcaBiTe5QWAEta5nxKvLS7vHLfFh5OEnV660NTAmk D3oEnXsMrDZvFzBIqNITxNnr6GSjC76JPV2HNa0kVL7jRNrQNEd8I94c0TF/zsAUjG5uJkglc GtFDC2juWv3RhK5mFBm/C/7JfFFgVB8c3lOVqrNz92fCZYYevcdtTTbQVzRHIUU60F+2uhmzi C5cFb0w/HaGDQ7VHeURNw+klGBt34EIt6bM6D7uevE/rouhHkNFasiJ9hIktRnRyoEF4= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Geert Uytterhoeven Some versions of gcc don't like tests for the value of an undefined preprocessor symbol, even in the #else branch of an #ifndef: lib/test_hash.c:224:7: warning: "HAVE_ARCH__HASH_32" is not defined [-Wundef] #elif HAVE_ARCH__HASH_32 != 1 ^ lib/test_hash.c:229:7: warning: "HAVE_ARCH_HASH_32" is not defined [-Wundef] #elif HAVE_ARCH_HASH_32 != 1 ^ lib/test_hash.c:234:7: warning: "HAVE_ARCH_HASH_64" is not defined [-Wundef] #elif HAVE_ARCH_HASH_64 != 1 ^ Seen with gcc 4.9, not seen with 4.1.2. Change the logic to only check the value inside an #ifdef to fix this. Fixes: 468a9428521e7d00 (": Add support for architecture-specific functions") Signed-off-by: Geert Uytterhoeven Acked-by: George Spelvin Signed-off-by: Arnd Bergmann --- lib/test_hash.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/test_hash.c b/lib/test_hash.c index 81702ee4c41c..cac20c5fb304 100644 --- a/lib/test_hash.c +++ b/lib/test_hash.c @@ -219,21 +219,27 @@ test_hash_init(void) } /* Issue notices about skipped tests. */ -#ifndef HAVE_ARCH__HASH_32 - pr_info("__hash_32() has no arch implementation to test."); -#elif HAVE_ARCH__HASH_32 != 1 +#ifdef HAVE_ARCH__HASH_32 +#if HAVE_ARCH__HASH_32 != 1 pr_info("__hash_32() is arch-specific; not compared to generic."); #endif -#ifndef HAVE_ARCH_HASH_32 - pr_info("hash_32() has no arch implementation to test."); -#elif HAVE_ARCH_HASH_32 != 1 +#else + pr_info("__hash_32() has no arch implementation to test."); +#endif +#ifdef HAVE_ARCH_HASH_32 +#if HAVE_ARCH_HASH_32 != 1 pr_info("hash_32() is arch-specific; not compared to generic."); #endif -#ifndef HAVE_ARCH_HASH_64 - pr_info("hash_64() has no arch implementation to test."); -#elif HAVE_ARCH_HASH_64 != 1 +#else + pr_info("hash_32() has no arch implementation to test."); +#endif +#ifdef HAVE_ARCH_HASH_64 +#if HAVE_ARCH_HASH_64 != 1 pr_info("hash_64() is arch-specific; not compared to generic."); #endif +#else + pr_info("hash_64() has no arch implementation to test."); +#endif pr_notice("%u tests passed.", tests); -- 2.9.0