forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ftrace: Fix -Wcast-function-type warnings on powerpc64
In order to make sure new function cast mismatches are not introduced in the kernel (to avoid tripping CFI checking), the kernel should be globally built with -Wcast-function-type. So, fix the following -Wcast-function-type warnings on powerpc64 (ppc64_defconfig): kernel/trace/ftrace.c: In function 'ftrace_ops_get_list_func': kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from 'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned int, long unsigned int, struct ftrace_ops *, struct ftrace_regs *)' [-Wcast-function-type] 128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops) | ^ kernel/trace/ftrace.c:174:10: note: in expansion of macro 'ftrace_ops_list_func' 174 | return ftrace_ops_list_func; | ^~~~~~~~~~~~~~~~~~~~ kernel/trace/ftrace.c: In function 'update_ftrace_function': kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from 'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned int, long unsigned int, struct ftrace_ops *, struct ftrace_regs *)' [-Wcast-function-type] 128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops) | ^ kernel/trace/ftrace.c:207:10: note: in expansion of macro 'ftrace_ops_list_func' 207 | func = ftrace_ops_list_func; | ^~~~~~~~~~~~~~~~~~~~ kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from 'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned int, long unsigned int, struct ftrace_ops *, struct ftrace_regs *)' [-Wcast-function-type] 128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops) | ^ kernel/trace/ftrace.c:220:14: note: in expansion of macro 'ftrace_ops_list_func' 220 | if (func == ftrace_ops_list_func) { | ^~~~~~~~~~~~~~~~~~~~ kernel/trace/ftrace.c: In function 'ftrace_modify_all_code': kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from 'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned int, long unsigned int, struct ftrace_ops *, struct ftrace_regs *)' [-Wcast-function-type] 128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops) | ^ kernel/trace/ftrace.c:2698:35: note: in expansion of macro 'ftrace_ops_list_func' 2698 | err = ftrace_update_ftrace_func(ftrace_ops_list_func); | ^~~~~~~~~~~~~~~~~~~~ kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from 'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned int, long unsigned int, struct ftrace_ops *, struct ftrace_regs *)' [-Wcast-function-type] 128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops) | ^ kernel/trace/ftrace.c:2708:41: note: in expansion of macro 'ftrace_ops_list_func' 2708 | if (update && ftrace_trace_function != ftrace_ops_list_func) { Link: KSPP#20 Link: https://lore.kernel.org/lkml/20210930095300.73be1555@canb.auug.org.au/ Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
- Loading branch information
1 parent
4110083
commit 9c10c07
Showing
7 changed files
with
37 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters