lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ebd085d9c2100e0709c9ee7fb9685f58810c937.camel@linux.intel.com>
Date: Tue, 13 Feb 2024 11:04:23 +0100
From: Thomas Hellström <thomas.hellstrom@...ux.intel.com>
To: Arnd Bergmann <arnd@...nel.org>, Lucas De Marchi
 <lucas.demarchi@...el.com>,  Oded Gabbay <ogabbay@...nel.org>
Cc: Arnd Bergmann <arnd@...db.de>, Maarten Lankhorst
 <maarten.lankhorst@...ux.intel.com>, Maxime Ripard <mripard@...nel.org>, 
 Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>,
 Daniel Vetter <daniel@...ll.ch>, Nathan Chancellor <nathan@...nel.org>,
 Nick Desaulniers <ndesaulniers@...gle.com>, Bill Wendling
 <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>, 
 intel-xe@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org, 
 linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH] drm/xe: avoid function cast warnings

On Tue, 2024-02-13 at 10:56 +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.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@...db.de>

Thanks, will push as soon as it passes CI.

Reviewed-by: Thomas Hellström <thomas.hellstrom@...ux.intel.com>
> ---
>  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)
> +{
> +	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,
>  };


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ