From patchwork Mon Jun 14 10:27:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 459836 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp3192265jae; Mon, 14 Jun 2021 04:26:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyX9VH5WVfPEIbRtOVDlvNfUFNR53apXjsfmVmt2PiJBlEQNkEIbkOGB++Vh4JVByiQkv50 X-Received: by 2002:a05:6402:2805:: with SMTP id h5mr16945517ede.379.1623669998042; Mon, 14 Jun 2021 04:26:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623669998; cv=none; d=google.com; s=arc-20160816; b=AoNpopDPTgAQt0gpJWrIvMgLTwgUtuEpAFGisEAdi04t+IdSPsHBjIuenl87JnLyCb o2F3rdbggtr10vv99IcP923GeclYRs0zIpQjlpLK1zWbAWitozbkvHPOZ6Ifp3JlXu6N I/iwFPVo5zbqum7V8GsqwrCb5UeZFiANAYdvdSS08GG1HM2HlGXmkNwqJOeTt+FMLvIu 6OqQ8w6g7jWjG4gWbJgdo4Gdtrc1hU4z4bAyyRELLu1GYuZjWocw/ZGMvC+bNN7UbQ8V bTroNVrfXr7jMl6SMyaPiK0Q2IRPYXLsD9GNFfppOkQjGfvbFQ5KfKWpDloDEquAZA9t SO1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=t/c6hlYFab6alrIEGjqheUz3pXOgYjxCrkxzaH+fxLI=; b=D7yx8bl3TtKPXIakJatMCwMWMknr3VejJeaEkTVdXH2b8bCGseQ+d1XqFydeIIdA5A OC96XfqK/XNv8y8VYK/ekQ2NGBBW6DbY/lR+bDa2SxhnDzG3TTju1eEJZ3KOh5Wb4C+Q 8iR18X8pXj73wJ2aWJDUYjy6J1Va93DsJLF+SayEg2T+PqKmntpTRqku+b0duPt6pRnh Lt30BKbX2pn5ZUVjiCXMtpuhN8OzC1dzuEc/yIvj2Z+gjci2QuKgwUE68X/zhQ4MlL12 8UkqaYwFdw5mDQooRtbAir+//Zs4XnRb83XMPc/rUfaD0CM4UxrETumMZSe0s9I5y5ZG 8p4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BaDW85iM; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v11si12271700edt.160.2021.06.14.04.26.37; Mon, 14 Jun 2021 04:26:38 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BaDW85iM; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235141AbhFNL2d (ORCPT + 12 others); Mon, 14 Jun 2021 07:28:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:52394 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235473AbhFNL0Z (ORCPT ); Mon, 14 Jun 2021 07:26:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 62FDD61494; Mon, 14 Jun 2021 10:54:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623668088; bh=ATX+R9iI4RWuortbgaRdIBaCq+Rva6ha+gLJi6HSKGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BaDW85iMywjjqDa5+FjpiioPxCQZAKO9Utq03qNZOa5yH6zPTW+O+1iU1mk4yLOcT Q8xuQW1C/904xQvktYgK2r4lhiFcbmVUsX7pQOdCOjxDy6vAll+6efIVVOXSJdEtYY 1bwGD4hQZ1jRdFnRD2hb3Lvk+ld3T448eRh+7+XQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Miguel Ojeda , Nick Desaulniers , Kees Cook Subject: [PATCH 5.12 142/173] ARM: cpuidle: Avoid orphan section warning Date: Mon, 14 Jun 2021 12:27:54 +0200 Message-Id: <20210614102702.886813394@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210614102658.137943264@linuxfoundation.org> References: <20210614102658.137943264@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann commit d94b93a9101573eb75b819dee94b1417acff631b upstream. Since commit 83109d5d5fba ("x86/build: Warn on orphan section placement"), we get a warning for objects in orphan sections. The cpuidle implementation for OMAP causes this when CONFIG_CPU_IDLE is disabled: arm-linux-gnueabi-ld: warning: orphan section `__cpuidle_method_of_table' from `arch/arm/mach-omap2/pm33xx-core.o' being placed in section `__cpuidle_method_of_table' arm-linux-gnueabi-ld: warning: orphan section `__cpuidle_method_of_table' from `arch/arm/mach-omap2/pm33xx-core.o' being placed in section `__cpuidle_method_of_table' arm-linux-gnueabi-ld: warning: orphan section `__cpuidle_method_of_table' from `arch/arm/mach-omap2/pm33xx-core.o' being placed in section `__cpuidle_method_of_table' Change the definition of CPUIDLE_METHOD_OF_DECLARE() to silently drop the table and all code referenced from it when CONFIG_CPU_IDLE is disabled. Fixes: 06ee7a950b6a ("ARM: OMAP2+: pm33xx-core: Add cpuidle_ops for am335x/am437x") Signed-off-by: Arnd Bergmann Reviewed-by: Miguel Ojeda Reviewed-by: Nick Desaulniers Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20201230155506.1085689-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman --- arch/arm/include/asm/cpuidle.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/arch/arm/include/asm/cpuidle.h +++ b/arch/arm/include/asm/cpuidle.h @@ -7,9 +7,11 @@ #ifdef CONFIG_CPU_IDLE extern int arm_cpuidle_simple_enter(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index); +#define __cpuidle_method_section __used __section("__cpuidle_method_of_table") #else static inline int arm_cpuidle_simple_enter(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index) { return -ENODEV; } +#define __cpuidle_method_section __maybe_unused /* drop silently */ #endif /* Common ARM WFI state */ @@ -42,8 +44,7 @@ struct of_cpuidle_method { #define CPUIDLE_METHOD_OF_DECLARE(name, _method, _ops) \ static const struct of_cpuidle_method __cpuidle_method_of_table_##name \ - __used __section("__cpuidle_method_of_table") \ - = { .method = _method, .ops = _ops } + __cpuidle_method_section = { .method = _method, .ops = _ops } extern int arm_cpuidle_suspend(int index);