linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] smpboot: remove inline from __always_inline'd function idle_init
@ 2021-07-15 16:40 Colin King
  2021-07-15 16:53 ` Valentin Schneider
  2021-07-16 22:44 ` Nathan Chancellor
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2021-07-15 16:40 UTC (permalink / raw)
  To: Valentin Schneider, Peter Zijlstra, Ingo Molnar
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Declaring a idle_init as inline when it is __always_inline is redundant
so this can be removed. Also swap the order of __always_inline and void
to match the more usual coding style.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 kernel/smpboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/smpboot.c b/kernel/smpboot.c
index 21b7953f8242..cf6acab78538 100644
--- a/kernel/smpboot.c
+++ b/kernel/smpboot.c
@@ -47,7 +47,7 @@ void __init idle_thread_set_boot_cpu(void)
  *
  * Creates the thread if it does not exist.
  */
-static inline void __always_inline idle_init(unsigned int cpu)
+static __always_inline void idle_init(unsigned int cpu)
 {
 	struct task_struct *tsk = per_cpu(idle_threads, cpu);
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][next] smpboot: remove inline from __always_inline'd function idle_init
  2021-07-15 16:40 [PATCH][next] smpboot: remove inline from __always_inline'd function idle_init Colin King
@ 2021-07-15 16:53 ` Valentin Schneider
  2021-07-16 22:44 ` Nathan Chancellor
  1 sibling, 0 replies; 3+ messages in thread
From: Valentin Schneider @ 2021-07-15 16:53 UTC (permalink / raw)
  To: Colin King, Peter Zijlstra, Ingo Molnar; +Cc: kernel-janitors, linux-kernel

On 15/07/21 17:40, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Declaring a idle_init as inline when it is __always_inline is redundant
> so this can be removed. Also swap the order of __always_inline and void
> to match the more usual coding style.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][next] smpboot: remove inline from __always_inline'd function idle_init
  2021-07-15 16:40 [PATCH][next] smpboot: remove inline from __always_inline'd function idle_init Colin King
  2021-07-15 16:53 ` Valentin Schneider
@ 2021-07-16 22:44 ` Nathan Chancellor
  1 sibling, 0 replies; 3+ messages in thread
From: Nathan Chancellor @ 2021-07-16 22:44 UTC (permalink / raw)
  To: Colin King
  Cc: Valentin Schneider, Peter Zijlstra, Ingo Molnar, kernel-janitors,
	linux-kernel

On Thu, Jul 15, 2021 at 05:40:18PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Declaring a idle_init as inline when it is __always_inline is redundant
> so this can be removed. Also swap the order of __always_inline and void
> to match the more usual coding style.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

This resolves a clang warning that I see:

kernel/smpboot.c:50:20: error: duplicate 'inline' declaration specifier [-Werror,-Wduplicate-decl-specifier]
static inline void __always_inline idle_init(unsigned int cpu)
                   ^
./include/linux/compiler_attributes.h:65:41: note: expanded from macro '__always_inline'
#define __always_inline                 inline __attribute__((__always_inline__))
                                        ^
./include/linux/compiler_types.h:149:16: note: expanded from macro 'inline'
#define inline inline __gnu_inline __inline_maybe_unused notrace
               ^
1 error generated.

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  kernel/smpboot.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/smpboot.c b/kernel/smpboot.c
> index 21b7953f8242..cf6acab78538 100644
> --- a/kernel/smpboot.c
> +++ b/kernel/smpboot.c
> @@ -47,7 +47,7 @@ void __init idle_thread_set_boot_cpu(void)
>   *
>   * Creates the thread if it does not exist.
>   */
> -static inline void __always_inline idle_init(unsigned int cpu)
> +static __always_inline void idle_init(unsigned int cpu)
>  {
>  	struct task_struct *tsk = per_cpu(idle_threads, cpu);
>  
> -- 
> 2.31.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-16 22:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 16:40 [PATCH][next] smpboot: remove inline from __always_inline'd function idle_init Colin King
2021-07-15 16:53 ` Valentin Schneider
2021-07-16 22:44 ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).