提交 5eb8ae50 编写于 作者: H Heiko Carstens

s390/ftrace: avoid pointer arithmetics with function pointers

Pointer arithmetics with function pointers is not really defined, but
seems to do the right thing. Let's cast to a void pointer to have a
defined behaviour, at least when using gcc.
Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
上级 63df41d6
...@@ -178,7 +178,7 @@ int ftrace_enable_ftrace_graph_caller(void) ...@@ -178,7 +178,7 @@ int ftrace_enable_ftrace_graph_caller(void)
offset = ((void *) prepare_ftrace_return - offset = ((void *) prepare_ftrace_return -
(void *) ftrace_graph_caller) / 2; (void *) ftrace_graph_caller) / 2;
return probe_kernel_write(ftrace_graph_caller + 2, return probe_kernel_write((void *) ftrace_graph_caller + 2,
&offset, sizeof(offset)); &offset, sizeof(offset));
} }
...@@ -186,7 +186,7 @@ int ftrace_disable_ftrace_graph_caller(void) ...@@ -186,7 +186,7 @@ int ftrace_disable_ftrace_graph_caller(void)
{ {
static unsigned short offset = 0x0002; static unsigned short offset = 0x0002;
return probe_kernel_write(ftrace_graph_caller + 2, return probe_kernel_write((void *) ftrace_graph_caller + 2,
&offset, sizeof(offset)); &offset, sizeof(offset));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册