drm/vc4: tests: Use KUNIT_DEFINE_ACTION_WRAPPER
authorDavid Gow <davidgow@google.com>
Tue, 28 Nov 2023 07:24:07 +0000 (15:24 +0800)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 18 Dec 2023 20:21:14 +0000 (13:21 -0700)
commita08d4d6284393d44ef4e076288c31d04fc469a58
treefb4607a130b22be150bf64703cea7221156c5717
parente847934bb124b2ad14bf967d6682e43b0b94c78a
drm/vc4: 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.

vc4_mock already defines such a wrapper for drm_dev_unregister(), but it
involves less boilerplate to use the new macro, so replace the manual
implementation.

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