From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD542C43331 for ; Sun, 10 Nov 2019 02:49:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 95A1622573 for ; Sun, 10 Nov 2019 02:49:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573354189; bh=9vHTsqmnu+cuuI3EJ+XhZIbw+Rq+l0wS6KturhsKzNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xmC4B8LLQ51Inx5sBTwNbGGk66sTVbz5nVM97T9NC4QT3+5VyVHXsiYLQZqElLVni o2q6Pu1TM0XTJSmoCVzWyKa1I+Icl2tJARD8rYdOEgjhzaTBPn0vVoMkdXMX3uTIH8 NhW6BhodQIXXmUKgdRgATFjziFjgjuISJJaqamBg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729554AbfKJCts (ORCPT ); Sat, 9 Nov 2019 21:49:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:58840 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728265AbfKJCt3 (ORCPT ); Sat, 9 Nov 2019 21:49:29 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F247E22582; Sun, 10 Nov 2019 02:49:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573354168; bh=9vHTsqmnu+cuuI3EJ+XhZIbw+Rq+l0wS6KturhsKzNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XAN0SYCrSoxO8nJt2cqznk0iYKC8w6I4sKPYZplM0CfXUFvTgV7zcHr7gwmkN/U7v AjOxwi2HmgqfNl6vroo3RNL00pBIC6ew4fGUE8SaT3cdtQKbf1T1fyNvpPmEsovhCf J6A8txm94DfuQ8J6TpcmqiTNWxAjldQu1AJ7KorQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Stefan Agner , Ard Biesheuvel , Herbert Xu , Sasha Levin , clang-built-linux@googlegroups.com Subject: [PATCH AUTOSEL 4.9 24/66] cpufeature: avoid warning when compiling with clang Date: Sat, 9 Nov 2019 21:48:03 -0500 Message-Id: <20191110024846.32598-24-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191110024846.32598-1-sashal@kernel.org> References: <20191110024846.32598-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefan Agner [ Upstream commit c785896b21dd8e156326ff660050b0074d3431df ] 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 Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- 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 986c06c88d814..84d3c81b59781 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.20.1