Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1146273pxv; Fri, 9 Jul 2021 19:29:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjmeFsK3UOViEeJ5fK/DGyNfezhhrzijkL+fwZ6eanVUxoklXnMAH0N+M/JW0cETpxRF+5 X-Received: by 2002:a05:6402:5114:: with SMTP id m20mr51140712edd.174.1625884155053; Fri, 09 Jul 2021 19:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884155; cv=none; d=google.com; s=arc-20160816; b=ElVu/hTinppYLcGrwQ0Rj8DPhvWk4QiovguD5lbJam4FwaVRtystQO+qSRbgVJySj7 +v1qcmIegf8CBjMPjyc+ZAeFXNpMRhApI4MN+jjYcqtmJcF7HG9lGGgw7lU+IUAZWGPJ 3Jcx12PLTm4yyPt4eNKy2YuNfbptvdX5tanCvnvUAWIsrlEYPJIeFMrv9yF5Qd2CnSRl 4isIA6vqGF31+Vp82c0gocjJ3LKiKXvB/jzYXDM/Hu751ovx2UNa/DLit1043qEapBlu EYx3EgTHlu6J+9Fm3WfjRAkog3qnhw6EzkL2Fsf/kISvDLrc6IDXRtJBa0n+aHMrYteu g7jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EyiG+hQrqFeUKfCKuJCdRifArPMegD7d8xO/BLGMOOs=; b=vLFjk9Zjh1OcQs6a2aaBMfCJoq/NPesDtW6gtGJuwvaaz4avlyYnAJNOdrXddiSi2v n3gVkAU0syP+UiPtImL1s88h2RSiRjTdMxFJdhMc9tPspVYMMY34+/qkp4DQPZKaaG/5 EY7jQm6/Yb8lC0jNVt33uKv0rFJqYbco5hhQ2XnvkxdXu0gQdkMniJEcyAHL05E03rAD TKKzOiVTi1kdZcOzXh6GUco1LlosOamypIG36qNJGuhBvG0ANClzqtRfbX60CkWs8QkJ 3yDezBO5Fs4g4bPOIW3BL4wP5AskguZG5gEXPtIti1G9DQMbwhk/vLRpROkOLztNo8RE Mk9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=idczcJ86; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si1216353ejx.283.2021.07.09.19.28.50; Fri, 09 Jul 2021 19:29:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=idczcJ86; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232919AbhGJC1z (ORCPT + 99 others); Fri, 9 Jul 2021 22:27:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:42574 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233125AbhGJC0f (ORCPT ); Fri, 9 Jul 2021 22:26:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CED6F613D1; Sat, 10 Jul 2021 02:23:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883827; bh=IMXjVUquktrG3q+4vQMwMY2LBFaGvm7PDZoGBRFpqBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=idczcJ86jA8o8TtFxDOQOwQ0qnm+c1Ts1czWuds6CGRXrEUkrJ0kINFUBX2B3CZAg DIDh8JdMghVxVOOG01DxyQfa3HjucY0b6TQcShtRXQcjBBKvAzEKJNTmA6wCz4vCf4 EFnST4eAU8fs2ho7nFNUeKmOAXOgjrwESosPatVK9EKxBqLxCsb1KC0Usc0kB6QnH+ BJCSBbk7pTEQBw1OsCbLw2m8Rwp3L3WoBQcbuGjzXRtmQvlfq/F32T3JNNPqAtThmG ILgTZw0jeG38F7PjSzo8z4qTrqelAcbx+n8d/KZ1WcjB/u2/pXSbDfUaPSka43cn3p nNTnawD0aNsgg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Koby Elbaz , Oded Gabbay , Sasha Levin Subject: [PATCH AUTOSEL 5.12 075/104] habanalabs: set rc as 'valid' in case of intentional func exit Date: Fri, 9 Jul 2021 22:21:27 -0400 Message-Id: <20210710022156.3168825-75-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022156.3168825-1-sashal@kernel.org> References: <20210710022156.3168825-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Koby Elbaz [ Upstream commit 11d5cb8b95456e2432dfee2ffcebf0623998493a ] fix the following smatch warnings: hl_fw_static_init_cpu() warn: missing error code 'rc' Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Sasha Levin --- drivers/misc/habanalabs/common/device.c | 5 +++-- 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 334009e83823..b11e9830422e 100644 --- a/drivers/misc/habanalabs/common/device.c +++ b/drivers/misc/habanalabs/common/device.c @@ -1370,8 +1370,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 09706c571e95..7a96c9753dbf 100644 --- a/drivers/misc/habanalabs/common/firmware_if.c +++ b/drivers/misc/habanalabs/common/firmware_if.c @@ -803,11 +803,14 @@ int hl_fw_init_cpu(struct hl_device *hdev, u32 cpu_boot_status_reg, if (!(hdev->fw_loading & 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"); -- 2.30.2