drivers: remoteproc: xlnx: Fix uninitialized variable use
authorTanmay Shah <tanmay.shah@amd.com>
Tue, 23 Apr 2024 17:02:11 +0000 (10:02 -0700)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Tue, 23 Apr 2024 19:29:04 +0000 (13:29 -0600)
Fix following warning for clang compiler with W=1 option:
initialize the variable 'ret' to silence this warning
     907 |         int ret, i;
         |                ^
         |                 = 0

Fixes: a6b974b40f94 ("drivers: remoteproc: xlnx: Add Versal and Versal-NET support")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202404231839.oHiY9Lw8-lkp@intel.com/
Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
Link: https://lore.kernel.org/r/20240423170210.1035957-1-tanmay.shah@amd.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/remoteproc/xlnx_r5_remoteproc.c

index a6d8ac7394e7aaaa6a8b092a2dd3256b2d31edc3..d98940d7ef8f9b9f1bd0ff4fac27469191b23286 100644 (file)
@@ -904,7 +904,7 @@ static int zynqmp_r5_core_init(struct zynqmp_r5_cluster *cluster,
 {
        struct device *dev = cluster->dev;
        struct zynqmp_r5_core *r5_core;
-       int ret, i;
+       int ret = -EINVAL, i;
 
        r5_core = cluster->r5_cores[0];