summaryrefslogtreecommitdiff
path: root/include/kunit
diff options
context:
space:
mode:
authorDaniel Latypov <dlatypov@google.com>2021-04-06 20:29:01 +0300
committerShuah Khan <skhan@linuxfoundation.org>2021-04-07 00:22:39 +0300
commitf65968ac191bd5f31091ff132191bf2ce3aed6c8 (patch)
tree9fed2ec641a5b041ec84e0c3c6db0195a231e948 /include/kunit
parent359a376081d4fadfb073e3ddeb6bd6dc94d98341 (diff)
downloadlinux-f65968ac191bd5f31091ff132191bf2ce3aed6c8.tar.xz
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: 359a376081d4 ("kunit: support failure from dynamic analysis tools") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Daniel Latypov <dlatypov@google.com> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'include/kunit')
-rw-r--r--include/kunit/test-bug.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/kunit/test-bug.h b/include/kunit/test-bug.h
index ce6f6edc7801..5fc58081d511 100644
--- a/include/kunit/test-bug.h
+++ b/include/kunit/test-bug.h
@@ -19,8 +19,8 @@ extern __printf(3, 4) void __kunit_fail_current_test(const char *file, int line,
#else
-static __printf(3, 4) void __kunit_fail_current_test(const char *file, int line,
- const char *fmt, ...)
+static inline __printf(3, 4) void __kunit_fail_current_test(const char *file, int line,
+ const char *fmt, ...)
{
}