Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2663036pxj; Mon, 14 Jun 2021 04:20:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5K04N3iJaZTSiP/q9KjjLiRENINg6Jj9++UKTSVn328KP5dIXkWPwnbxwUqs1hdcuwRXr X-Received: by 2002:a17:907:9801:: with SMTP id ji1mr15060793ejc.523.1623669659158; Mon, 14 Jun 2021 04:20:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623669659; cv=none; d=google.com; s=arc-20160816; b=JypMpxYybrv1vxgC3twQ0tgdruHJjiUjeOG/RrgyxXfR3rXa0LHFr17pBYwV6AxsFu tFX+yn73ascXUPP1K867Jdb3ZK409MEKTQuqHPBihZ79J/Gn08p1sDXbFhM7CtY7bLuE W0Dc2fDioiqd86fzeGh8FwISyaWQNAB783PiTN9Frsdde+F4LUXdGF2f6ASbIbyxVPUA V5hf+3KTXys4jA3igNHiV8FqPysQjyL/g4pjLSL/vuVSHnVKCJDbXa0qHVa/cD+M5iMF CSYnkm/kIZqj0i9dAJ6OPQnGJ00+5foVrimTj6cJkVrwkLFKvQTZf5n0KL0jLAH1ZRif 7bEw== 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=sDD8baAnTwkbN8g7suxBzXSNYUaCOqc0dpBiFUojsd06p3YI5KTE3t0fQu8DyigJVC Wbs/6ZxzENPR6/Yv4yr0IbREjKgdqzwEH3ZhFDyuQtIjEhdkqinzEn5UqLDey0mSeUP9 kCtvleVzfDK/3B+1sJDSX7iYzetAZOryQOWq3+RdiPgZ3oGSEa1qZxXBRjOHJWiKvKzB 751j/TOQuEuvuhst3gpinVJRaRljWohqduBkWwdEHmUjmk1lvu3snTs7VDByjk24VD7u svJohPf9dRvOaXT8lzIJTpa4xEifnR77uWyPLnkyFC1kIzYh3JR4FaBHUO1fYPGEfGWB 5EPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="n/ZLo5CX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 z5si11763769edx.70.2021.06.14.04.20.37; Mon, 14 Jun 2021 04:20:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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="n/ZLo5CX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S234285AbhFNLSv (ORCPT + 99 others); Mon, 14 Jun 2021 07:18:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:38960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233311AbhFNLGg (ORCPT ); Mon, 14 Jun 2021 07:06:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2021361928; Mon, 14 Jun 2021 10:45:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623667527; bh=ATX+R9iI4RWuortbgaRdIBaCq+Rva6ha+gLJi6HSKGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n/ZLo5CXXWk6GD1DihcdBzqHPJm8PIIVwnHTBNbe71d0HbVCIQ8zWxN41ssyJLQbF pzpXvxXUJcBBKJVEDqFpBFz8sUG0QfrHS8LIuCdzBJkrjZ8b1zd15YMSNwAkvepHw7 PcrapkDHiAHq7qSooWYPQt/RT1DDQYTKQX0QFCXE= 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.10 105/131] ARM: cpuidle: Avoid orphan section warning Date: Mon, 14 Jun 2021 12:27:46 +0200 Message-Id: <20210614102656.570135046@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210614102652.964395392@linuxfoundation.org> References: <20210614102652.964395392@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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);