mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 12:30:09 +01:00
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:
parent
237ab0778e
commit
d79665066d
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue