Skip to content

Commit 6b1ca46

Browse files
author
Vasily Gorbik
committed
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>
1 parent df5a95f commit 6b1ca46

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

arch/s390/lib/test_unwind.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,19 +210,18 @@ static noinline int test_unwind_ftraced_func(struct unwindme *u)
210210

211211
static int test_unwind_ftrace(struct unwindme *u)
212212
{
213-
struct ftrace_ops *fops;
214213
int ret;
214+
#ifdef CONFIG_DYNAMIC_FTRACE
215+
struct ftrace_ops *fops;
215216

216-
#ifndef CONFIG_DYNAMIC_FTRACE
217-
kunit_skip(current_test, "requires CONFIG_DYNAMIC_FTRACE");
218-
fops = NULL; /* used */
219-
#else
220217
fops = kunit_kzalloc(current_test, sizeof(*fops), GFP_KERNEL);
221218
fops->func = test_unwind_ftrace_handler;
222219
fops->flags = FTRACE_OPS_FL_DYNAMIC |
223220
FTRACE_OPS_FL_RECURSION |
224221
FTRACE_OPS_FL_SAVE_REGS |
225222
FTRACE_OPS_FL_PERMANENT;
223+
#else
224+
kunit_skip(current_test, "requires CONFIG_DYNAMIC_FTRACE");
226225
#endif
227226

228227
ret = ftrace_set_filter_ip(fops, (unsigned long)test_unwind_ftraced_func, 0, 0);

0 commit comments

Comments
 (0)