s390/ftrace: avoid pointer arithmetics with function pointers
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Fri, 6 Sep 2013 17:16:14 +0000 (19:16 +0200)
committerHeiko Carstens <heiko.carstens@de.ibm.com>
Sat, 7 Sep 2013 09:58:07 +0000 (11:58 +0200)
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>
arch/s390/kernel/ftrace.c

index 4c80720..1014ad5 100644 (file)
@@ -178,7 +178,7 @@ 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));
 }
 
@@ -186,7 +186,7 @@ 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));
 }