linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] futex: remove unused empty compat_exit_robust_list()
@ 2020-11-13 17:20 Lukas Bulwahn
  2020-11-13 18:40 ` Nathan Chancellor
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lukas Bulwahn @ 2020-11-13 17:20 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Peter Zijlstra
  Cc: Darren Hart, Arnd Bergmann, Tom Rix, Nathan Chancellor,
	Nick Desaulniers, clang-built-linux, kernel-janitors,
	linux-kernel, Lukas Bulwahn

Commit ba31c1a48538 ("futex: Move futex exit handling into futex code")
introduced compat_exit_robust_list() with a full-fledged implementation for
CONFIG_COMPAT, and an empty-body function for !CONFIG_COMPAT.
However, compat_exit_robust_list() is only used in futex_mm_release() under
ifdef CONFIG_COMPAT.

Hence for !CONFIG_COMPAT, make CC=clang W=1 warns:

  kernel/futex.c:314:20:
    warning: unused function 'compat_exit_robust_list' [-Wunused-function]

There is no need to declare the unused empty function for !CONFIG_COMPAT.
Simply, remove it to address the -Wunused-function warning.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
---
applies cleanly on current master and next-20201113

Thomas, please pick this minor non-urgent clean-up patch.

 kernel/futex.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index 00259c7e288e..c47d1015d759 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -310,8 +310,6 @@ static inline bool should_fail_futex(bool fshared)
 
 #ifdef CONFIG_COMPAT
 static void compat_exit_robust_list(struct task_struct *curr);
-#else
-static inline void compat_exit_robust_list(struct task_struct *curr) { }
 #endif
 
 /*
-- 
2.17.1


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

* Re: [PATCH] futex: remove unused empty compat_exit_robust_list()
  2020-11-13 17:20 [PATCH] futex: remove unused empty compat_exit_robust_list() Lukas Bulwahn
@ 2020-11-13 18:40 ` Nathan Chancellor
  2020-11-14  0:15 ` Thomas Gleixner
  2020-11-14  0:18 ` [tip: locking/core] futex: Remove " tip-bot2 for Lukas Bulwahn
  2 siblings, 0 replies; 4+ messages in thread
From: Nathan Chancellor @ 2020-11-13 18:40 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Darren Hart,
	Arnd Bergmann, Tom Rix, Nick Desaulniers, clang-built-linux,
	kernel-janitors, linux-kernel

On Fri, Nov 13, 2020 at 06:20:12PM +0100, Lukas Bulwahn wrote:
> Commit ba31c1a48538 ("futex: Move futex exit handling into futex code")
> introduced compat_exit_robust_list() with a full-fledged implementation for
> CONFIG_COMPAT, and an empty-body function for !CONFIG_COMPAT.
> However, compat_exit_robust_list() is only used in futex_mm_release() under
> ifdef CONFIG_COMPAT.
> 
> Hence for !CONFIG_COMPAT, make CC=clang W=1 warns:
> 
>   kernel/futex.c:314:20:
>     warning: unused function 'compat_exit_robust_list' [-Wunused-function]
> 
> There is no need to declare the unused empty function for !CONFIG_COMPAT.
> Simply, remove it to address the -Wunused-function warning.
> 
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>

Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>

> ---
> applies cleanly on current master and next-20201113
> 
> Thomas, please pick this minor non-urgent clean-up patch.
> 
>  kernel/futex.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/kernel/futex.c b/kernel/futex.c
> index 00259c7e288e..c47d1015d759 100644
> --- a/kernel/futex.c
> +++ b/kernel/futex.c
> @@ -310,8 +310,6 @@ static inline bool should_fail_futex(bool fshared)
>  
>  #ifdef CONFIG_COMPAT
>  static void compat_exit_robust_list(struct task_struct *curr);
> -#else
> -static inline void compat_exit_robust_list(struct task_struct *curr) { }
>  #endif
>  
>  /*
> -- 
> 2.17.1
> 

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

* Re: [PATCH] futex: remove unused empty compat_exit_robust_list()
  2020-11-13 17:20 [PATCH] futex: remove unused empty compat_exit_robust_list() Lukas Bulwahn
  2020-11-13 18:40 ` Nathan Chancellor
@ 2020-11-14  0:15 ` Thomas Gleixner
  2020-11-14  0:18 ` [tip: locking/core] futex: Remove " tip-bot2 for Lukas Bulwahn
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2020-11-14  0:15 UTC (permalink / raw)
  To: Lukas Bulwahn, Ingo Molnar, Peter Zijlstra
  Cc: Darren Hart, Arnd Bergmann, Tom Rix, Nathan Chancellor,
	Nick Desaulniers, clang-built-linux, kernel-janitors,
	linux-kernel, Lukas Bulwahn

Lukas,

On Fri, Nov 13 2020 at 18:20, Lukas Bulwahn wrote:
> Commit ba31c1a48538 ("futex: Move futex exit handling into futex code")
> introduced compat_exit_robust_list() with a full-fledged implementation for
> CONFIG_COMPAT, and an empty-body function for !CONFIG_COMPAT.
> However, compat_exit_robust_list() is only used in futex_mm_release() under
> ifdef CONFIG_COMPAT.
>
> Hence for !CONFIG_COMPAT, make CC=clang W=1 warns:
>
>   kernel/futex.c:314:20:
>     warning: unused function 'compat_exit_robust_list' [-Wunused-function]
>
> There is no need to declare the unused empty function for !CONFIG_COMPAT.
> Simply, remove it to address the -Wunused-function warning.

While I agree with the removal, I disagree with the reasoning.

The real argument is that the stub function is useless. Addressing the
warning is a side effect of the removal, nothing else.

Thanks,

        tglx

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

* [tip: locking/core] futex: Remove unused empty compat_exit_robust_list()
  2020-11-13 17:20 [PATCH] futex: remove unused empty compat_exit_robust_list() Lukas Bulwahn
  2020-11-13 18:40 ` Nathan Chancellor
  2020-11-14  0:15 ` Thomas Gleixner
@ 2020-11-14  0:18 ` tip-bot2 for Lukas Bulwahn
  2 siblings, 0 replies; 4+ messages in thread
From: tip-bot2 for Lukas Bulwahn @ 2020-11-14  0:18 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Lukas Bulwahn, Thomas Gleixner, Nathan Chancellor, x86, linux-kernel

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     932f8c64d38bb08f69c8c26a2216ba0c36c6daa8
Gitweb:        https://git.kernel.org/tip/932f8c64d38bb08f69c8c26a2216ba0c36c6daa8
Author:        Lukas Bulwahn <lukas.bulwahn@gmail.com>
AuthorDate:    Fri, 13 Nov 2020 18:20:12 +01:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Sat, 14 Nov 2020 01:15:35 +01:00

futex: Remove unused empty compat_exit_robust_list()

Commit ba31c1a48538 ("futex: Move futex exit handling into futex code")
introduced compat_exit_robust_list() with a full-fledged implementation for
CONFIG_COMPAT, and an empty-body function for !CONFIG_COMPAT.

However, compat_exit_robust_list() is only used in futex_mm_release() under
#ifdef CONFIG_COMPAT.

Hence for !CONFIG_COMPAT, make CC=clang W=1 warns:

  kernel/futex.c:314:20:
    warning: unused function 'compat_exit_robust_list' [-Wunused-function]

There is no need to declare the unused empty function for !CONFIG_COMPAT.

Simply remove it.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Link: https://lore.kernel.org/r/20201113172012.27221-1-lukas.bulwahn@gmail.com

---
 kernel/futex.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index ac32887..aee6ce2 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -310,8 +310,6 @@ static inline bool should_fail_futex(bool fshared)
 
 #ifdef CONFIG_COMPAT
 static void compat_exit_robust_list(struct task_struct *curr);
-#else
-static inline void compat_exit_robust_list(struct task_struct *curr) { }
 #endif
 
 /*

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

end of thread, other threads:[~2020-11-14  0:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13 17:20 [PATCH] futex: remove unused empty compat_exit_robust_list() Lukas Bulwahn
2020-11-13 18:40 ` Nathan Chancellor
2020-11-14  0:15 ` Thomas Gleixner
2020-11-14  0:18 ` [tip: locking/core] futex: Remove " tip-bot2 for Lukas Bulwahn

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).