Skip to content

Commit

Permalink
s390/ftrace: avoid pointer arithmetics with function pointers
Browse files Browse the repository at this point in the history
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: Heiko Carstens <heiko.carstens@de.ibm.com>
  • Loading branch information
Heiko Carstens committed Sep 7, 2013
1 parent 63df41d commit 5eb8ae5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/s390/kernel/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,15 @@ int ftrace_enable_ftrace_graph_caller(void)

offset = ((void *) prepare_ftrace_return -
(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));
}

int ftrace_disable_ftrace_graph_caller(void)
{
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));
}

Expand Down

0 comments on commit 5eb8ae5

Please sign in to comment.