Skip to contentSkip to conversation

x86/bugs: Remove dead code which might prevent from building

PATCH In review Andy Shevchenko 2 participants 2 messages Oct 24, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/bugs: Remove dead code which might prevent from building

Clang, in particular, is not happy about dead code:

arch/x86/kernel/cpu/bugs.c:1830:20: error: unused function 'match_option' [-Werror,-Wunused-function]
1830 | static inline bool match_option(const char *arg, int arglen, const char *opt)

      |                    ^~~~~~~~~~~~

1 error generated.

Remove a leftover from the previous cleanup.

Fixes 02ac6cc8c5a1 ("x86/bugs: Simplify SSB cmdline parsing")
---
 arch/x86/kernel/cpu/bugs.c | 7 -------
 1 file changed, 7 deletions(-)
arch/x86/kernel/cpu/bugs.c +0 -7
index e08de5b0d20b..d7fa03bf51b4 100644
@@ -1827,13 +1827,6 @@ void unpriv_ebpf_notify(int new_state)
 }
 #endif
 
-static inline bool match_option(const char *arg, int arglen, const char *opt)
-{
-	int len = strlen(opt);
-
-	return len == arglen && !strncmp(arg, opt, len);
-}
-
 /* The kernel command line selection for spectre v2 */
 enum spectre_v2_mitigation_cmd {
 	SPECTRE_V2_CMD_NONE,
Signature · 1 line
2.50.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 20 lines · Andy Shevchenko

Clang, in particular, is not happy about dead code:

arch/x86/kernel/cpu/bugs.c:1830:20: error: unused function 'match_option' [-Werror,-Wunused-function]
1830 | static inline bool match_option(const char *arg, int arglen, const char *opt)

      |                    ^~~~~~~~~~~~

1 error generated.

Remove a leftover from the previous cleanup.

Fixes 02ac6cc8c5a1 ("x86/bugs: Simplify SSB cmdline parsing")
---
 arch/x86/kernel/cpu/bugs.c | 7 -------
 1 file changed, 7 deletions(-)
arch/x86/kernel/cpu/bugs.c +0 -0
index e08de5b0d20b..d7fa03bf51b4 100644

arch/x86/kernel/cpu/bugs.c void unpriv_ebpf_notify(int new_state) · line 1835

Quoted 9 lines
arch/x86/kernel/cpu/bugs.c +0 -6
@@ -1827,13 +1827,6 @@ void unpriv_ebpf_notify(int new_state)
 }
 #endif
 
-static inline bool match_option(const char *arg, int arglen, const char *opt)
-{
-	int len = strlen(opt);
-
-	return len == arglen && !strncmp(arg, opt, len);
-}