From ba9bdfd959f217a96772b83468c065b48f2581f0 Mon Sep 17 00:00:00 2001 From: Venkatesh Yadav Abbarapu Date: Wed, 11 Oct 2023 08:26:47 +0530 Subject: [PATCH] drivers: firmware: Handle error case in the zynqmp_pm_feature Unhandled error coming from xilinx_pm_request() but return value is not read back that's why getting sparse warning as below: warning: variable 'ret' set but not used [-Wunused-but-set-variable]. In case of error return the "ret" value. Signed-off-by: Venkatesh Yadav Abbarapu Link: https://lore.kernel.org/r/20231011025647.17200-1-venkatesh.abbarapu@amd.com Signed-off-by: Michal Simek --- drivers/firmware/firmware-zynqmp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c index 43fb7fa778..8ea15c7ed3 100644 --- a/drivers/firmware/firmware-zynqmp.c +++ b/drivers/firmware/firmware-zynqmp.c @@ -203,6 +203,8 @@ int zynqmp_pm_feature(const u32 api_id) /* Check feature check API version */ ret = xilinx_pm_request(PM_FEATURE_CHECK, api_id, 0, 0, 0, ret_payload); + if (ret) + return ret; /* Return feature check version */ return ret_payload[1] & FIRMWARE_VERSION_MASK; -- 2.39.5