From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Arnd Bergmann <arnd@kernel.org>,
Lucas De Marchi <lucas.demarchi@intel.com>,
Oded Gabbay <ogabbay@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
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>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH] drm/xe: avoid function cast warnings
Date: Wed, 14 Feb 2024 11:10:31 +0100 [thread overview]
Message-ID: <f0b2b4dda91ef1342fc38540bf3d453366b943e9.camel@linux.intel.com> (raw)
In-Reply-To: <20240213095719.454865-1-arnd@kernel.org>
Hi,
On Tue, 2024-02-13 at 10:56 +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> clang-16 warns about a cast between incompatible function types:
>
> drivers/gpu/drm/xe/xe_range_fence.c:155:10: error: cast from 'void
> (*)(const void *)' to 'void (*)(struct xe_range_fence *)' converts to
> incompatible function type [-Werror,-Wcast-function-type-strict]
> 155 | .free = (void (*)(struct xe_range_fence *rfence))
> kfree,
> |
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Avoid this with a trivial helper function that calls kfree() here.
>
> Fixes: 845f64bdbfc9 ("drm/xe: Introduce a range-fence utility")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/gpu/drm/xe/xe_range_fence.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_range_fence.c
> b/drivers/gpu/drm/xe/xe_range_fence.c
> index d35d9ec58e86..8510be4466eb 100644
> --- a/drivers/gpu/drm/xe/xe_range_fence.c
> +++ b/drivers/gpu/drm/xe/xe_range_fence.c
> @@ -151,6 +151,11 @@ xe_range_fence_tree_next(struct xe_range_fence
> *rfence, u64 start, u64 last)
> return xe_range_fence_tree_iter_next(rfence, start, last);
> }
>
> +static void xe_range_fence_free(struct xe_range_fence * rfence)
There's a checkpatch.pl style error above: s/* rfence/*rfence/. I can
fix that up when pushing if it's ok with you.
/Thomas
> +{
> + kfree(rfence);
> +}
> +
> const struct xe_range_fence_ops xe_range_fence_kfree_ops = {
> - .free = (void (*)(struct xe_range_fence *rfence)) kfree,
> + .free = xe_range_fence_free,
> };
next prev parent reply other threads:[~2024-02-14 10:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-13 9:56 [PATCH] drm/xe: avoid function cast warnings Arnd Bergmann
2024-02-13 10:04 ` Thomas Hellström
2024-02-13 11:27 ` ✓ CI.Patch_applied: success for " Patchwork
2024-02-13 11:27 ` ✗ CI.checkpatch: warning " Patchwork
2024-02-13 11:28 ` ✓ CI.KUnit: success " Patchwork
2024-02-13 11:39 ` ✓ CI.Build: " Patchwork
2024-02-13 11:39 ` ✓ CI.Hooks: " Patchwork
2024-02-13 11:40 ` ✓ CI.checksparse: " Patchwork
2024-02-13 12:04 ` ✓ CI.BAT: " Patchwork
2024-02-14 10:10 ` Thomas Hellström [this message]
2024-02-14 10:15 ` [PATCH] " Arnd Bergmann
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=f0b2b4dda91ef1342fc38540bf3d453366b943e9.camel@linux.intel.com \
--to=thomas.hellstrom@linux.intel.com \
--cc=airlied@gmail.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=justinstitt@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=lucas.demarchi@intel.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=morbo@google.com \
--cc=mripard@kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=ogabbay@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