LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] x86: orc: fix unused-function warning
@ 2020-01-07 21:31 Arnd Bergmann
2020-01-08 0:58 ` Masami Hiramatsu
2020-01-08 10:48 ` Shile Zhang
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2020-01-07 21:31 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86, Shile Zhang,
Peter Zijlstra (Intel)
Cc: Arnd Bergmann, Josh Poimboeuf, Masahiro Yamada, linux-kbuild,
H. Peter Anvin, Masami Hiramatsu, Jann Horn, linux-kernel
The orc unwinder contains a new warning:
arch/x86/kernel/unwind_orc.c:210:12: error: 'orc_sort_cmp' defined but not used [-Werror=unused-function]
static int orc_sort_cmp(const void *_a, const void *_b)
^~~~~~~~~~~~
arch/x86/kernel/unwind_orc.c:190:13: error: 'orc_sort_swap' defined but not used [-Werror=unused-function]
static void orc_sort_swap(void *_a, void *_b, int size)
^~~~~~~~~~~~~
Move the #ifdef to hide the now unused functions.
Fixes: f14bf6a350df ("x86/unwind/orc: Remove boot-time ORC unwind tables sorting")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/x86/kernel/unwind_orc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c
index abdf8911a1fb..538152cca46b 100644
--- a/arch/x86/kernel/unwind_orc.c
+++ b/arch/x86/kernel/unwind_orc.c
@@ -187,6 +187,7 @@ static struct orc_entry *orc_find(unsigned long ip)
return orc_ftrace_find(ip);
}
+#ifdef CONFIG_MODULES
static void orc_sort_swap(void *_a, void *_b, int size)
{
struct orc_entry *orc_a, *orc_b;
@@ -229,7 +230,6 @@ static int orc_sort_cmp(const void *_a, const void *_b)
return orc_a->sp_reg == ORC_REG_UNDEFINED && !orc_a->end ? -1 : 1;
}
-#ifdef CONFIG_MODULES
void unwind_module_init(struct module *mod, void *_orc_ip, size_t orc_ip_size,
void *_orc, size_t orc_size)
{
--
2.20.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86: orc: fix unused-function warning
2020-01-07 21:31 [PATCH] x86: orc: fix unused-function warning Arnd Bergmann
@ 2020-01-08 0:58 ` Masami Hiramatsu
2020-01-08 10:48 ` Shile Zhang
1 sibling, 0 replies; 3+ messages in thread
From: Masami Hiramatsu @ 2020-01-08 0:58 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86, Shile Zhang,
Peter Zijlstra (Intel),
Josh Poimboeuf, Masahiro Yamada, linux-kbuild, H. Peter Anvin,
Masami Hiramatsu, Jann Horn, linux-kernel
On Tue, 7 Jan 2020 22:31:20 +0100
Arnd Bergmann <arnd@arndb.de> wrote:
> The orc unwinder contains a new warning:
>
> arch/x86/kernel/unwind_orc.c:210:12: error: 'orc_sort_cmp' defined but not used [-Werror=unused-function]
> static int orc_sort_cmp(const void *_a, const void *_b)
> ^~~~~~~~~~~~
> arch/x86/kernel/unwind_orc.c:190:13: error: 'orc_sort_swap' defined but not used [-Werror=unused-function]
> static void orc_sort_swap(void *_a, void *_b, int size)
> ^~~~~~~~~~~~~
>
> Move the #ifdef to hide the now unused functions.
>
> Fixes: f14bf6a350df ("x86/unwind/orc: Remove boot-time ORC unwind tables sorting")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Looks good to me.
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Thank you,
> ---
> arch/x86/kernel/unwind_orc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c
> index abdf8911a1fb..538152cca46b 100644
> --- a/arch/x86/kernel/unwind_orc.c
> +++ b/arch/x86/kernel/unwind_orc.c
> @@ -187,6 +187,7 @@ static struct orc_entry *orc_find(unsigned long ip)
> return orc_ftrace_find(ip);
> }
>
> +#ifdef CONFIG_MODULES
> static void orc_sort_swap(void *_a, void *_b, int size)
> {
> struct orc_entry *orc_a, *orc_b;
> @@ -229,7 +230,6 @@ static int orc_sort_cmp(const void *_a, const void *_b)
> return orc_a->sp_reg == ORC_REG_UNDEFINED && !orc_a->end ? -1 : 1;
> }
>
> -#ifdef CONFIG_MODULES
> void unwind_module_init(struct module *mod, void *_orc_ip, size_t orc_ip_size,
> void *_orc, size_t orc_size)
> {
> --
> 2.20.0
>
--
Masami Hiramatsu <mhiramat@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86: orc: fix unused-function warning
2020-01-07 21:31 [PATCH] x86: orc: fix unused-function warning Arnd Bergmann
2020-01-08 0:58 ` Masami Hiramatsu
@ 2020-01-08 10:48 ` Shile Zhang
1 sibling, 0 replies; 3+ messages in thread
From: Shile Zhang @ 2020-01-08 10:48 UTC (permalink / raw)
To: Arnd Bergmann, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
x86, Peter Zijlstra (Intel)
Cc: Josh Poimboeuf, Masahiro Yamada, linux-kbuild, H. Peter Anvin,
Masami Hiramatsu, Jann Horn, linux-kernel
Hi Arnd,
Thanks for you work!
But sorry for I have been fix this warning via a delta-patch as following:
https://lore.kernel.org/lkml/157838258393.30329.5371781726464192052.tip-bot2@tip-bot2/
FYI.
BRs
Shile
On 2020/1/8 05:31, Arnd Bergmann wrote:
> The orc unwinder contains a new warning:
>
> arch/x86/kernel/unwind_orc.c:210:12: error: 'orc_sort_cmp' defined but not used [-Werror=unused-function]
> static int orc_sort_cmp(const void *_a, const void *_b)
> ^~~~~~~~~~~~
> arch/x86/kernel/unwind_orc.c:190:13: error: 'orc_sort_swap' defined but not used [-Werror=unused-function]
> static void orc_sort_swap(void *_a, void *_b, int size)
> ^~~~~~~~~~~~~
>
> Move the #ifdef to hide the now unused functions.
>
> Fixes: f14bf6a350df ("x86/unwind/orc: Remove boot-time ORC unwind tables sorting")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> arch/x86/kernel/unwind_orc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c
> index abdf8911a1fb..538152cca46b 100644
> --- a/arch/x86/kernel/unwind_orc.c
> +++ b/arch/x86/kernel/unwind_orc.c
> @@ -187,6 +187,7 @@ static struct orc_entry *orc_find(unsigned long ip)
> return orc_ftrace_find(ip);
> }
>
> +#ifdef CONFIG_MODULES
> static void orc_sort_swap(void *_a, void *_b, int size)
> {
> struct orc_entry *orc_a, *orc_b;
> @@ -229,7 +230,6 @@ static int orc_sort_cmp(const void *_a, const void *_b)
> return orc_a->sp_reg == ORC_REG_UNDEFINED && !orc_a->end ? -1 : 1;
> }
>
> -#ifdef CONFIG_MODULES
> void unwind_module_init(struct module *mod, void *_orc_ip, size_t orc_ip_size,
> void *_orc, size_t orc_size)
> {
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-01-08 10:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07 21:31 [PATCH] x86: orc: fix unused-function warning Arnd Bergmann
2020-01-08 0:58 ` Masami Hiramatsu
2020-01-08 10:48 ` Shile Zhang
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).