mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-01 18:52:02 +00:00
kunit: string-stream-test: use KUNIT_DEFINE_ACTION_WRAPPER
Use KUNIT_DEFINE_ACTION_WRAPPER macro to define the 'kfree' and 'string_stream_destroy' wrappers for kunit_add_action. Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com> Reviewed-by: Rae Moar <rmoar@google.com> Acked-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
parent
4b513a02fd
commit
a96a394577
@ -22,18 +22,10 @@ struct string_stream_test_priv {
|
||||
};
|
||||
|
||||
/* Avoids a cast warning if kfree() is passed direct to kunit_add_action(). */
|
||||
static void kfree_wrapper(void *p)
|
||||
{
|
||||
kfree(p);
|
||||
}
|
||||
KUNIT_DEFINE_ACTION_WRAPPER(kfree_wrapper, kfree, const void *);
|
||||
|
||||
/* Avoids a cast warning if string_stream_destroy() is passed direct to kunit_add_action(). */
|
||||
static void cleanup_raw_stream(void *p)
|
||||
{
|
||||
struct string_stream *stream = p;
|
||||
|
||||
string_stream_destroy(stream);
|
||||
}
|
||||
KUNIT_DEFINE_ACTION_WRAPPER(cleanup_raw_stream, string_stream_destroy, struct string_stream *);
|
||||
|
||||
static char *get_concatenated_string(struct kunit *test, struct string_stream *stream)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user