Commit 11d5cb8b authored by Koby Elbaz's avatar Koby Elbaz Committed by Oded Gabbay
Browse files

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: default avatarKoby Elbaz <kelbaz@habana.ai>
Reviewed-by: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
parent b538888c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;

+4 −1
Original line number Diff line number Diff line
@@ -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");