mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-05-02 18:17:50 -04:00
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>
This commit is contained in:
@@ -153,12 +153,9 @@ static int __build_mock(struct kunit *test, struct drm_device *drm,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void kunit_action_drm_dev_unregister(void *ptr)
|
KUNIT_DEFINE_ACTION_WRAPPER(kunit_action_drm_dev_unregister,
|
||||||
{
|
drm_dev_unregister,
|
||||||
struct drm_device *drm = ptr;
|
struct drm_device *);
|
||||||
|
|
||||||
drm_dev_unregister(drm);
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct vc4_dev *__mock_device(struct kunit *test, bool is_vc5)
|
static struct vc4_dev *__mock_device(struct kunit *test, bool is_vc5)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user