Skip to contentSkip to conversation

futex: remove unused empty compat_exit_robust_list()

PATCH Applied Lukas Bulwahn 4 participants 4 messages Nov 13, 2020 – Nov 14, 2020 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 to address the -Wunused-function warning.

---
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(-)
kernel/futex.c +0 -2
index 00259c7e288e..c47d1015d759 100644
@@ -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
 
 /*
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · 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:

Quoted 7 lines

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.

Quoted 24 lines

---
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(-)
kernel/futex.c +0 -2
index 00259c7e288e..c47d1015d759 100644
@@ -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
 
 /*
Signature · 1 line
2.17.1
#2 lore raw
In reply to Lukas Bulwahn

Lukas,

Quoted 6 lines · 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.

Quoted 7 lines

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

merge bot Applied
#3 lore raw

[tip: locking/core] futex: Remove unused empty compat_exit_robust_list()

In reply to Lukas Bulwahn
The following commit has been merged into the locking/core branch of tip:

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 <[email protected]>
AuthorDate:    Fri, 13 Nov 2020 18:20:12 +01:00
Committer:     Thomas Gleixner <[email protected]>
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.

---
 kernel/futex.c | 2 --
 1 file changed, 2 deletions(-)
kernel/futex.c +0 -2
index ac32887..aee6ce2 100644
@@ -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
 
 /*