ftrace: Fix build warning for ops_references_rec() not used
authorWang Jingjin <wangjingjin1@huawei.com>
Mon, 1 Aug 2022 08:47:45 +0000 (16:47 +0800)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Mon, 22 Aug 2022 13:41:12 +0000 (09:41 -0400)
commit123d6455771ec577ce65f8d1bda548fb0eb7ef21
tree18f963c88279a1792c7824d3315d20d461b6dcfd
parent1c23f9e627a7b412978b4e852793c5e3c3efc555
ftrace: Fix build warning for ops_references_rec() not used

The change that made IPMODIFY and DIRECT ops work together needed access
to the ops_references_ip() function, which it pulled out of the module
only code. But now if both CONFIG_MODULES and
CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS is not set, we get the below
warning:

    ‘ops_references_rec’ defined but not used.

Since ops_references_rec() only calls ops_references_ip() replace the
usage of ops_references_rec() with ops_references_ip() and encompass the
function with an #ifdef of DIRECT_CALLS || MODULES being defined.

Link: https://lkml.kernel.org/r/20220801084745.1187987-1-wangjingjin1@huawei.com
Fixes: 53cd885bc5c3 ("ftrace: Allow IPMODIFY and DIRECT ops on the same function")
Signed-off-by: Wang Jingjin <wangjingjin1@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ftrace.c