From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753450AbbGBFYA (ORCPT ); Thu, 2 Jul 2015 01:24:00 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:60058 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753382AbbGBFXs (ORCPT ); Thu, 2 Jul 2015 01:23:48 -0400 X-AuditID: cbfec7f5-f794b6d000001495-17-5594cae09f77 Message-id: <5594CAE4.1070607@samsung.com> Date: Thu, 02 Jul 2015 14:23:48 +0900 From: Krzysztof Kozlowski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-version: 1.0 To: Jisheng Zhang , catalin.marinas@arm.com, will.deacon@arm.com, lorenzo.pieralisi@arm.com Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2] arm64: cpuidle: add __init section marker to arm_cpuidle_init References: <1435803288-1478-1-git-send-email-jszhang@marvell.com> <20150702125849.67160aa9@xhacker> In-reply-to: <20150702125849.67160aa9@xhacker> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRmVeSWpSXmKPExsVy+t/xa7oPT00JNbhpZ/F+WQ+jxbvju1ks Xr8wtNj0+BqrxeVdc9gs3vx+wW7x8uMJFgd2jzXz1jB6bF5S7zF54UVmj74tqxg9Pm+SC2CN 4rJJSc3JLEst0rdL4MrYvP8SU0E/X8XTN23MDYzXubsYOTkkBEwk1vQeYYewxSQu3FvPBmIL CSxllGi7wNPFyAVkP2WUWHLnI1gRr4CWxIaWc6wgNouAqsTrs0/B4mwCxhKbly8BaxYViJB4 e/kkE0S9oMSPyfdYQGwRgSKJpxM2g9nMAm4St9fPYwaxhQXCJS5NbWaEWLaWUWJ5ax8jSIJT QE9i2fJXQDYHUIOexP2LWhC98hKb17xlnsAoMAvJilkIVbOQVC1gZF7FKJpamlxQnJSea6RX nJhbXJqXrpecn7uJERLcX3cwLj1mdYhRgINRiYd3Rc2UUCHWxLLiytxDjBIczEoivNt3AYV4 UxIrq1KL8uOLSnNSiw8xSnOwKInzztz1PkRIID2xJDU7NbUgtQgmy8TBKdXAmHn6vorIhylh UXePHGFRk6+xjyxnX7QzWLYquNXmqIn73vPHp2//2Kmner5T40+pcYCp3X29ogKVxkUtV+ZM 9YjzVvE6zi8uuXFWo8+xeJ6TwaLPchYLZN+f+H1i/bqC5zmhe3jrNSJOX73JLl7H/ZMzcmXK tRfHt+8TjN0s+mFql9X2uJn/lViKMxINtZiLihMBNuUzVWoCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02.07.2015 13:58, Jisheng Zhang wrote: > Dear Krzysztof, > > On Thu, 2 Jul 2015 12:59:44 +0900 > Krzysztof Kozlowski wrote: > >> 2015-07-02 11:14 GMT+09:00 Jisheng Zhang : >>> It is not needed after booting, this patch moves the arm_cpuidle_init() >>> function to the __init section. >>> >>> Signed-off-by: Jisheng Zhang >>> --- >>> arch/arm64/include/asm/cpuidle.h | 2 +- >>> arch/arm64/kernel/cpuidle.c | 2 +- >>> 2 files changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/arch/arm64/include/asm/cpuidle.h b/arch/arm64/include/asm/cpuidle.h >>> index 0f74f05..5748d3b 100644 >>> --- a/arch/arm64/include/asm/cpuidle.h >>> +++ b/arch/arm64/include/asm/cpuidle.h >>> @@ -4,7 +4,7 @@ >>> #include >>> >>> #ifdef CONFIG_CPU_IDLE >>> -extern int arm_cpuidle_init(unsigned int cpu); >>> +extern int __init arm_cpuidle_init(unsigned int cpu); >> >> No, not here but... >> >>> extern int arm_cpuidle_suspend(int index); >>> #else >>> static inline int arm_cpuidle_init(unsigned int cpu) >> >> ... here so the stub for !CONFIG_CPU_IDLE would be marked as well. > > when !CONFIG_CPU_IDLE, arm_cpuidle_init() is inlined, and just return -EOPNOTSUPP; > Per my understanding, it will be optimized out by compiler. I'm not sure whether > there is any benefit to mark inlined function as __init. But Per my check, all > other inlined functions in linux kernel have no __init. What do you think? Yes, you're right, the inline is sufficient so this means that actually the first patch was correct. The __init is not needed in extern declaration. For both versions then: Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof