From patchwork Mon Jun 14 10:27:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 459816 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp3176696jae; Mon, 14 Jun 2021 04:06:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKFPPnIdYvLatD7i/Ewcs3OmzGMYqkU9wmvyaZnylIV/ZaoSjGTbhLtVSmGG9H5rPEsAbB X-Received: by 2002:a17:906:488f:: with SMTP id v15mr14306689ejq.428.1623668794877; Mon, 14 Jun 2021 04:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623668794; cv=none; d=google.com; s=arc-20160816; b=gmNC2kPf2EwFKxX2xaDaa9Z+o5ZA/0rOMxz15OkU8ioZu6uumj1dFzWnRJi3DU13qM TIYM9LFdNPpK87FDJVdsXe2jicg6Gy8S5SLhNopmingm2wOftf2OAmTQjMoYWuqWnDek ts+DuXRYPZjlrVCUQ6+ZdKxkJfLLC1QH90exFhrbBIf36PNzaCwnN2afuMKqsiIkPayf wAdLdAoBvb576kkuSabqSSreuxHQppwB+lAB3ERvsxaX0ruy9kkFQwBgrWQG2UC/SVCw IA247Wh00/97kLJpSc7uqxF2IxM+TmBSXU9MoRm0b9LPhRZhmnJBVrt8krJkv+OtiA4q HyiA== 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=O/yNksJ1sKRz2YYegedvo1yMDR2wIbvcI8hx43+yCDqzTPBh4kDQd1YR00muDkpQof nv9mPt/jkx+sl3T1LHJSsx3cdiW8ypRFfMkllgLpXNviuUn/6zmKqN9/a9CBQ7Rwuw+N rlaRG+90tOgnuAqVEDpThfttCsMtWZbSK+KwLMZEcJ9oowDaV9JSZU1Pw55vs00a25SC Sm6ECaCT9B0gUPs/nhDEn3xRGh5ZCJ38cDw0OQ9bNG1SQRk3+steMoeCRnPh/hCYaZlA 4e41Izka7cjdiM1VgyL75F4aulUWRIJsjFJnZLRy73RMFxrsIsrqQ2YrK8+h1iCMqEKZ 0KYQ== 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 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 du7si10710628ejc.108.2021.06.14.04.06.34; Mon, 14 Jun 2021 04:06:34 -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="n/ZLo5CX"; 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 S234965AbhFNLIc (ORCPT + 12 others); Mon, 14 Jun 2021 07:08:32 -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 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);