drm/tests: Use KUNIT_DEFINE_ACTION_WRAPPER()
authorDavid Gow <davidgow@google.com>
Tue, 28 Nov 2023 07:24:06 +0000 (15:24 +0800)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 18 Dec 2023 20:21:14 +0000 (13:21 -0700)
commite847934bb124b2ad14bf967d6682e43b0b94c78a
tree9f9572852cbda7c173e5121fbfdd3c9b919e34e6
parent56778b49c9a2cbc32c6b0fbd3ba1a9d64192d3af
drm/tests: Use KUNIT_DEFINE_ACTION_WRAPPER()

In order to pass functions to kunit_add_action(), they need to be of the
kunit_action_t type. While casting the function pointer can work, it
will break control-flow integrity.

drm_kunit_helpers already defines wrappers, but we now have a macro
which does this automatically. Using this greatly reduces the
boilerplate needed.

Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
drivers/gpu/drm/tests/drm_kunit_helpers.c