Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5392347imm; Tue, 18 Sep 2018 08:50:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY/OTq1eKVpnuFWUdXEbvGMai9uPVcR4jtNB1LRmvTV+yVw0Sbr77+T+UjCrn1EjSrhWz0/ X-Received: by 2002:a17:902:2e83:: with SMTP id r3-v6mr30197527plb.80.1537285831647; Tue, 18 Sep 2018 08:50:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537285831; cv=none; d=google.com; s=arc-20160816; b=WkZthco6KAGO7/90oIu9enQS0wekeNkh8lkEr7Li/gHCT/u3BED3wdeOQT+s1Q5lWI exBLBAkq1Gk1s258YFbMWaJK0yeULnwLixqsA8hacqz4GJAOi3O0W7MhJy2XxVRCfI89 3brx918M745upeHeXS8CUKxNQQNB6VHoHXTY0YC0XNaChElzqW99X3P/zzkPnT4wML9d DCWChM2RHsc3376+JEhn1rU2D6srEdZBjeV0U/7mZAUcExuWRXtUkmI2/5GesYWBVGF0 0ydFqdMqtr0kxkpaMvG7QIV7LAytxI5vblefid0QrVIP86Ehn/HlVmec95Kgy0Tou36D UxWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=ifG8VSzIPit15i+8vXcpkivV2jOLfhjQLDmzRCbF+fI=; b=E+6wpwMhC3yRt533DOnZxt3Fne9fNjAHubGEiMObDRYnkt87XisMeSaHOI+m9NVBLo az4vUT6u2WRcgNeopLF3TbeHWWbYTqsJQTtc+oA7DbNCPCtaGF2eW06s5QsaoMhE+yvA sp1S2UOBBbfbOQ/9R0ezYc6SheyWNSjLwVNTOubOESDevb1XOkxqSnKtgZvqYLPJbRvK WTdI2ngOHMbLhEpwuLHw1LQpAo8BkLU9anIWu4PMxmvflhX84FxbQiVp4FSoTLziEJeu Sd4aKxdXxbQEuv8ZPpLFlDPRc3vk5JRIZ9n5mUmfcbxvbgPRXhygovy3Lp7xFoF8bJSO aX2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ki/HSFDf"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f16-v6si19630093pff.13.2018.09.18.08.50.08; Tue, 18 Sep 2018 08:50:31 -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; dkim=pass header.i=@linaro.org header.s=google header.b="ki/HSFDf"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729968AbeIRVXH (ORCPT + 99 others); Tue, 18 Sep 2018 17:23:07 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:36108 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729249AbeIRVXG (ORCPT ); Tue, 18 Sep 2018 17:23:06 -0400 Received: by mail-it0-f68.google.com with SMTP id u13-v6so3660552iti.1 for ; Tue, 18 Sep 2018 08:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ifG8VSzIPit15i+8vXcpkivV2jOLfhjQLDmzRCbF+fI=; b=ki/HSFDfFKvjLtYAuNLKcs0aJaHysHkb5mcTDl/WbU10Yt7d/nmu8k+DQhOJfezHQA CYAorVBsZQw/6gV9z5tEAfa5c/zHQZuNggOnanMoRtoGNf6ROTM5bBV+HZwoBdHdvctt RrT29VFormzFA4uYwndxdd5mqCT0Zfw5bfMFw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ifG8VSzIPit15i+8vXcpkivV2jOLfhjQLDmzRCbF+fI=; b=GoDFyDboHdyUgfgU7XNyPjOCKIQ/k0pvQcHETJL4pypwKEHIwGULWwGcI62WqNLwoV INF0GtyYq0sfMtW0eZWR6CJtQ95LQI7W3lOKZRQecmZWaK98/bH3z5Mrig7gk3mS9QX3 iJnfLWHL8nF5AAA7JJefFlL5kahexdLmC4VBCgPxAA1oJL7cGrM8g26sLg+GbDx5UPVS MqOYFhdmmlvswU6v2Bkkd9jVHgjoc7kqj/868ldXMRdfNmKg3pmrwRmR5yNKdv8+wF7d 8zDV/bs0I1AKNTvSFsTWNf0kRbaJCd00xabjKgCMiMLrsqCmWUs2lIIRxPMlut+HYkxv 3rQA== X-Gm-Message-State: APzg51CpAc89+ANxfbOOb5W/MvjK5P7663ySA5c2ofkjeQ9rxn/LOWij FpNcO98Jzz36aKle2fyyyOe3V+OQjHDljEaga8tpjQ== X-Received: by 2002:a24:52cd:: with SMTP id d196-v6mr16808714itb.58.1537285791347; Tue, 18 Sep 2018 08:49:51 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:2848:0:0:0:0:0 with HTTP; Tue, 18 Sep 2018 08:49:50 -0700 (PDT) In-Reply-To: <20180916043825.23247-1-stefan@agner.ch> References: <20180916043825.23247-1-stefan@agner.ch> From: Ard Biesheuvel Date: Tue, 18 Sep 2018 08:49:50 -0700 Message-ID: Subject: Re: [PATCH 1/2] cpufeature: avoid warning when compiling with clang To: Stefan Agner Cc: Herbert Xu , "David S. Miller" , Russell King , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , linux-arm-kernel , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15 September 2018 at 21:38, Stefan Agner wrote: > The table id (second) argument to MODULE_DEVICE_TABLE is often > referenced otherwise. This is not the case for CPU features. This > leads to warnings when building the kernel with Clang: > arch/arm/crypto/aes-ce-glue.c:450:1: warning: variable > 'cpu_feature_match_AES' is not needed and will not be emitted > [-Wunneeded-internal-declaration] > module_cpu_feature_match(AES, aes_init); > ^ > > Avoid warnings by using __maybe_unused, similar to commit 1f318a8bafcf > ("modules: mark __inittest/__exittest as __maybe_unused"). > > Fixes: 67bad2fdb754 ("cpu: add generic support for CPU feature based module autoloading") > Signed-off-by: Stefan Agner Acked-by: Ard Biesheuvel > --- > include/linux/cpufeature.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/cpufeature.h b/include/linux/cpufeature.h > index 986c06c88d81..84d3c81b5978 100644 > --- a/include/linux/cpufeature.h > +++ b/include/linux/cpufeature.h > @@ -45,7 +45,7 @@ > * 'asm/cpufeature.h' of your favorite architecture. > */ > #define module_cpu_feature_match(x, __initfunc) \ > -static struct cpu_feature const cpu_feature_match_ ## x[] = \ > +static struct cpu_feature const __maybe_unused cpu_feature_match_ ## x[] = \ > { { .feature = cpu_feature(x) }, { } }; \ > MODULE_DEVICE_TABLE(cpu, cpu_feature_match_ ## x); \ > \ > -- > 2.19.0 >