From patchwork Mon Aug 29 21:49:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101903 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1833576qga; Mon, 29 Aug 2016 14:50:30 -0700 (PDT) X-Received: by 10.98.63.1 with SMTP id m1mr401286pfa.14.1472507430324; Mon, 29 Aug 2016 14:50:30 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t90si41134410pfa.50.2016.08.29.14.50.28; Mon, 29 Aug 2016 14:50:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932356AbcH2VuX (ORCPT + 27 others); 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 Received: from wuerfel.lan. ([176.5.99.91]) by mrelayeu.kundenserver.de (mreue001) with ESMTPA (Nemesis) id 0LhoIM-1bIswm1uio-00n6a3; Mon, 29 Aug 2016 23:49:58 +0200 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 Precedence: bulk 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(-) -- 2.9.0 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);