summaryrefslogtreecommitdiff
path: root/arch/s390/lib/test_unwind.c
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2022-03-03 16:38:34 +0100
committerVasily Gorbik <gor@linux.ibm.com>2022-03-08 00:33:01 +0100
commit6b1ca46ab3aacc905eaaae0f52cb3311f76d7bd6 (patch)
tree1c79896399c033d4de2b45389a2e29203fc3d929 /arch/s390/lib/test_unwind.c
parentdf5a95f481c4ef62199fb7e25263a035b4a337d2 (diff)
s390/test_unwind: avoid build warning with W=1
Fix the following build warning with W=1 arch/s390/lib/test_unwind.c:172:21: warning: variable 'fops' set but not used [-Wunused-but-set-variable] struct ftrace_ops *fops; Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/lib/test_unwind.c')
-rw-r--r--arch/s390/lib/test_unwind.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/s390/lib/test_unwind.c b/arch/s390/lib/test_unwind.c
index b209014ce426..07ef89eeb85a 100644
--- a/arch/s390/lib/test_unwind.c
+++ b/arch/s390/lib/test_unwind.c
@@ -210,19 +210,18 @@ static noinline int test_unwind_ftraced_func(struct unwindme *u)
static int test_unwind_ftrace(struct unwindme *u)
{
- struct ftrace_ops *fops;
int ret;
+#ifdef CONFIG_DYNAMIC_FTRACE
+ struct ftrace_ops *fops;
-#ifndef CONFIG_DYNAMIC_FTRACE
- kunit_skip(current_test, "requires CONFIG_DYNAMIC_FTRACE");
- fops = NULL; /* used */
-#else
fops = kunit_kzalloc(current_test, sizeof(*fops), GFP_KERNEL);
fops->func = test_unwind_ftrace_handler;
fops->flags = FTRACE_OPS_FL_DYNAMIC |
FTRACE_OPS_FL_RECURSION |
FTRACE_OPS_FL_SAVE_REGS |
FTRACE_OPS_FL_PERMANENT;
+#else
+ kunit_skip(current_test, "requires CONFIG_DYNAMIC_FTRACE");
#endif
ret = ftrace_set_filter_ip(fops, (unsigned long)test_unwind_ftraced_func, 0, 0);