Message ID | 20231106172305.2857-1-rf@opensource.cirrus.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 1bddcf77ce6668692fc15e968fd0870d5524d112 |
Delegated to: | Brendan Higgins |
Headers | show |
Series | kunit: test: Avoid cast warning in when adding kfree() as an action | expand |
On 6/11/23 17:23, Richard Fitzgerald wrote: > In kunit_log_test() pass the kfree_wrapper() function to kunit_add_action() > instead of directly passing kfree(). Aargh! Sorry, noticed spurious word in commit title. Will send a V2.
diff --git a/lib/kunit/kunit-test.c b/lib/kunit/kunit-test.c index 99d2a3a528e1..de2113a58fa0 100644 --- a/lib/kunit/kunit-test.c +++ b/lib/kunit/kunit-test.c @@ -562,7 +562,7 @@ static void kunit_log_test(struct kunit *test) KUNIT_EXPECT_TRUE(test, test->log->append_newlines); full_log = string_stream_get_string(test->log); - kunit_add_action(test, (kunit_action_t *)kfree, full_log); + kunit_add_action(test, kfree_wrapper, full_log); KUNIT_EXPECT_NOT_ERR_OR_NULL(test, strstr(full_log, "put this in log.")); KUNIT_EXPECT_NOT_ERR_OR_NULL(test,