Skip to content

Commit f65968a

Browse files
dlatypovshuahkh
authored andcommitted
kunit: fix -Wunused-function warning for __kunit_fail_current_test
When CONFIG_KUNIT is not enabled, __kunit_fail_current_test() an empty static function. But GCC complains about unused static functions, *unless* they're static inline. So add inline to make GCC happy. Fixes: 359a376 ("kunit: support failure from dynamic analysis tools") Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Daniel Latypov <[email protected]> Reviewed-by: Brendan Higgins <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 359a376 commit f65968a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/kunit/test-bug.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ extern __printf(3, 4) void __kunit_fail_current_test(const char *file, int line,
1919

2020
#else
2121

22-
static __printf(3, 4) void __kunit_fail_current_test(const char *file, int line,
23-
const char *fmt, ...)
22+
static inline __printf(3, 4) void __kunit_fail_current_test(const char *file, int line,
23+
const char *fmt, ...)
2424
{
2525
}
2626

0 commit comments

Comments
 (0)