summaryrefslogtreecommitdiffstats
path: root/include/kunit/test.h
diff options
context:
space:
mode:
authorDaniel Latypov <dlatypov@google.com>2022-01-13 08:59:28 -0800
committerShuah Khan <skhan@linuxfoundation.org>2022-01-25 12:49:46 -0700
commita91e9ade402c48ee35cd1e4b671e3938db798d17 (patch)
tree21a42096c0bb8c620fb9cef2215e3cf8db012c45 /include/kunit/test.h
parent4fdacef8ac5a5382eeb1bc6fc2632d71a09d52cd (diff)
downloadlinux-stable-a91e9ade402c48ee35cd1e4b671e3938db798d17.tar.gz
linux-stable-a91e9ade402c48ee35cd1e4b671e3938db798d17.tar.bz2
linux-stable-a91e9ade402c48ee35cd1e4b671e3938db798d17.zip
kunit: drop unused kunit* field in kunit_assert
The `struct kunit* test` field in kunit_assert is unused. Note: string_stream needs it, but it has its own `test` field. I assume `test` in `kunit_assert` predates this and was leftover after some refactoring. This patch removes the field and cleans up the macros to avoid needlessly passing around `test`. Signed-off-by: Daniel Latypov <dlatypov@google.com> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'include/kunit/test.h')
-rw-r--r--include/kunit/test.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/include/kunit/test.h b/include/kunit/test.h
index 12cabd15449a..25ea3bce6663 100644
--- a/include/kunit/test.h
+++ b/include/kunit/test.h
@@ -790,7 +790,7 @@ void kunit_do_failed_assertion(struct kunit *test,
KUNIT_ASSERTION(test, \
false, \
kunit_fail_assert, \
- KUNIT_INIT_FAIL_ASSERT_STRUCT(test, assert_type), \
+ KUNIT_INIT_FAIL_ASSERT_STRUCT(assert_type), \
fmt, \
##__VA_ARGS__)
@@ -820,8 +820,7 @@ void kunit_do_failed_assertion(struct kunit *test,
KUNIT_ASSERTION(test, \
!!(condition) == !!expected_true, \
kunit_unary_assert, \
- KUNIT_INIT_UNARY_ASSERT_STRUCT(test, \
- assert_type, \
+ KUNIT_INIT_UNARY_ASSERT_STRUCT(assert_type, \
#condition, \
expected_true), \
fmt, \
@@ -879,8 +878,7 @@ do { \
KUNIT_ASSERTION(test, \
__left op __right, \
assert_class, \
- ASSERT_CLASS_INIT(test, \
- assert_type, \
+ ASSERT_CLASS_INIT(assert_type, \
#op, \
#left, \
__left, \
@@ -1234,8 +1232,7 @@ do { \
KUNIT_ASSERTION(test, \
strcmp(__left, __right) op 0, \
kunit_binary_str_assert, \
- KUNIT_INIT_BINARY_STR_ASSERT_STRUCT(test, \
- assert_type, \
+ KUNIT_INIT_BINARY_STR_ASSERT_STRUCT(assert_type, \
#op, \
#left, \
__left, \
@@ -1294,8 +1291,7 @@ do { \
KUNIT_ASSERTION(test, \
!IS_ERR_OR_NULL(__ptr), \
kunit_ptr_not_err_assert, \
- KUNIT_INIT_PTR_NOT_ERR_STRUCT(test, \
- assert_type, \
+ KUNIT_INIT_PTR_NOT_ERR_STRUCT(assert_type, \
#ptr, \
__ptr), \
fmt, \