diff options
author | Koby Elbaz | 2021-06-10 09:01:57 +0300 |
---|---|---|
committer | Oded Gabbay | 2021-06-18 15:23:42 +0300 |
commit | 11d5cb8b95456e2432dfee2ffcebf0623998493a (patch) | |
tree | 34fdc733dcdd25b3ccc9140e8a7387febe9d86a0 /drivers/misc | |
parent | b538888c3e49a0d1f1c59ef1b1ed2cd3d6e45db9 (diff) |
habanalabs: set rc as 'valid' in case of intentional func exit
fix the following smatch warnings:
hl_fw_static_init_cpu() warn: missing error code 'rc'
Signed-off-by: Koby Elbaz <kelbaz@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/habanalabs/common/device.c | 5 | ||||
-rw-r--r-- | drivers/misc/habanalabs/common/firmware_if.c | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c index cbdf75b24cb4..e56f5170e338 100644 --- a/drivers/misc/habanalabs/common/device.c +++ b/drivers/misc/habanalabs/common/device.c @@ -1360,8 +1360,9 @@ int hl_device_init(struct hl_device *hdev, struct class *hclass) } /* - * From this point, in case of an error, add char devices and create - * sysfs nodes as part of the error flow, to allow debugging. + * From this point, override rc (=0) in case of an error to allow + * debugging (by adding char devices and create sysfs nodes as part of + * the error flow). */ add_cdev_sysfs_on_err = true; diff --git a/drivers/misc/habanalabs/common/firmware_if.c b/drivers/misc/habanalabs/common/firmware_if.c index d5d0db7fd6ef..ce87053d4fde 100644 --- a/drivers/misc/habanalabs/common/firmware_if.c +++ b/drivers/misc/habanalabs/common/firmware_if.c @@ -2393,11 +2393,14 @@ static int hl_fw_static_init_cpu(struct hl_device *hdev, if (!(hdev->fw_components & FW_TYPE_LINUX)) { dev_info(hdev->dev, "Skip loading Linux F/W\n"); + rc = 0; goto out; } - if (status == CPU_BOOT_STATUS_SRAM_AVAIL) + if (status == CPU_BOOT_STATUS_SRAM_AVAIL) { + rc = 0; goto out; + } dev_info(hdev->dev, "Loading firmware to device, may take some time...\n"); |