amd/vpelib: Ensures type-safe comparison for callback assignment

[WHY & How]
Ensures type-safe comparison for the sys_event callback assignment by
casting the NULL constant to the appropriate function pointer type.

Acked-by: Chuanyu Tseng <Chuanyu.Tseng@amd.com>
Signed-off-by: Muhammad Ansari <Muhammad.Ansari@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37504>
This commit is contained in:
swscm, z1 2025-08-26 10:13:54 -04:00 committed by Marge Bot
parent 237ab0778e
commit d79665066d

View file

@ -223,7 +223,7 @@ struct vpe *vpe_create(const struct vpe_init_data *params)
struct vpe_engine_priv *engine_priv = NULL;
if (!params || (params->funcs.zalloc == NULL) || (params->funcs.free == NULL) ||
(params->funcs.log == NULL))
(params->funcs.log == (vpe_log_func_t)NULL))
return NULL;
if (!params->engine_handle) {
@ -260,7 +260,7 @@ struct vpe *vpe_create(const struct vpe_init_data *params)
// Make sys event an optional feature but hooking up to dummy function if no
// callback is
// provided
if (vpe_priv->init.funcs.sys_event == NULL)
if (vpe_priv->init.funcs.sys_event == (vpe_sys_event_func_t)NULL)
vpe_priv->init.funcs.sys_event = dummy_sys_event;
status = vpe_construct_resource(vpe_priv, vpe_priv->pub.level, &vpe_priv->resource);