lkml.org 
[lkml]   [2021]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] nds32: ftrace: fix pointer comparison warning
Date
GCC 11.1.0 for nds32 (nds32le if it matters) complains:

../arch/nds32/kernel/ftrace.c: In function '_mcount':
../arch/nds32/kernel/ftrace.c:24:35: error: comparison of distinct pointer types lacks a cast [-Werror]
24 | if (ftrace_trace_function != ftrace_stub)
| ^~

Cast the second function (pointer) to (void *) to avoid the warning.

Fixes: a18082575c66 ("nds32/ftrace: Support static function tracer")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
To: Greentime Hu <green.hu@gmail.com>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Zong Li <zong@andestech.com>
Cc: Nick Hu <nickhu@andestech.com>
Cc: Vincent Chen <deanbo422@gmail.com>
---
arch/nds32/kernel/ftrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20211026.orig/arch/nds32/kernel/ftrace.c
+++ linux-next-20211026/arch/nds32/kernel/ftrace.c
@@ -21,7 +21,7 @@ noinline void _mcount(unsigned long pare

unsigned long ip = (unsigned long)__builtin_return_address(0);

- if (ftrace_trace_function != ftrace_stub)
+ if (ftrace_trace_function != (void *)ftrace_stub)
ftrace_trace_function(ip - MCOUNT_INSN_SIZE, parent_ip,
NULL, NULL);

\
 
 \ /
  Last update: 2021-10-27 07:56    [W:0.037 / U:0.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site