From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Marco Pagani <marpagan@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/test: use kunit action wrapper macro in the gem shmem test suite
Date: Thu, 25 Jul 2024 14:59:22 +0200 [thread overview]
Message-ID: <ZqJMKvwr6nxPjb9v@phenom.ffwll.local> (raw)
In-Reply-To: <20240723191036.131286-1-marpagan@redhat.com>
On Tue, Jul 23, 2024 at 09:10:35PM +0200, Marco Pagani wrote:
> Replace deferred action function wrappers with equivalent ones defined
> using the macro introduced by commit 56778b49c9a2 ("kunit: Add a macro to
> wrap a deferred action function")
>
> Signed-off-by: Marco Pagani <marpagan@redhat.com>
Merged to drm-misc-next, thanks for your patch.
-Sima
> ---
> drivers/gpu/drm/tests/drm_gem_shmem_test.c | 27 ++++++----------------
> 1 file changed, 7 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/tests/drm_gem_shmem_test.c b/drivers/gpu/drm/tests/drm_gem_shmem_test.c
> index c3758faa1b83..f7f7d8b0f61f 100644
> --- a/drivers/gpu/drm/tests/drm_gem_shmem_test.c
> +++ b/drivers/gpu/drm/tests/drm_gem_shmem_test.c
> @@ -23,29 +23,16 @@
> #define TEST_BYTE 0xae
>
> /*
> - * Wrappers to avoid an explicit type casting when passing action
> - * functions to kunit_add_action().
> + * Wrappers to avoid cast warnings when passing action functions
> + * directly to kunit_add_action().
> */
> -static void kfree_wrapper(void *ptr)
> -{
> - const void *obj = ptr;
> -
> - kfree(obj);
> -}
> -
> -static void sg_free_table_wrapper(void *ptr)
> -{
> - struct sg_table *sgt = ptr;
> +KUNIT_DEFINE_ACTION_WRAPPER(kfree_wrapper, kfree, const void *);
>
> - sg_free_table(sgt);
> -}
> -
> -static void drm_gem_shmem_free_wrapper(void *ptr)
> -{
> - struct drm_gem_shmem_object *shmem = ptr;
> +KUNIT_DEFINE_ACTION_WRAPPER(sg_free_table_wrapper, sg_free_table,
> + struct sg_table *);
>
> - drm_gem_shmem_free(shmem);
> -}
> +KUNIT_DEFINE_ACTION_WRAPPER(drm_gem_shmem_free_wrapper, drm_gem_shmem_free,
> + struct drm_gem_shmem_object *);
>
> /*
> * Test creating a shmem GEM object backed by shmem buffer. The test
> --
> 2.45.2
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
prev parent reply other threads:[~2024-07-25 12:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-23 19:10 Marco Pagani
2024-07-25 12:59 ` Daniel Vetter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZqJMKvwr6nxPjb9v@phenom.ffwll.local \
--to=daniel.vetter@ffwll.ch \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=marpagan@redhat.com \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®