From d79665066d1202265b29c8bea7fe1b05abda17c7 Mon Sep 17 00:00:00 2001 From: "swscm, z1" Date: Tue, 26 Aug 2025 10:13:54 -0400 Subject: [PATCH] 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 Signed-off-by: Muhammad Ansari Part-of: --- src/amd/vpelib/src/core/vpelib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/vpelib/src/core/vpelib.c b/src/amd/vpelib/src/core/vpelib.c index e1bc8d858f3..9e690122efc 100644 --- a/src/amd/vpelib/src/core/vpelib.c +++ b/src/amd/vpelib/src/core/vpelib.c @@ -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);