Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4742677pxj; Wed, 12 May 2021 12:10:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxV0RQHlbts/MzDCqIQ7gdOLPc3gMkxXRvS2XDcZMqTXb5F05kFLbwVhtc0eZG8nMhdgMhc X-Received: by 2002:a17:906:a2d1:: with SMTP id by17mr40777464ejb.426.1620846648422; Wed, 12 May 2021 12:10:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620846648; cv=none; d=google.com; s=arc-20160816; b=WkwS6WN3aElsvuaq0Cvrq0ZPBYYbBD3Jt4pCW21limM4d1VfQ/Mx5sHrDKn/3upQKY pVyM0plkVGoMSILYjDT68bFxKeu+c0XItHy9EHAoqMRHzTgwGNU5ONN+Jba7hmRwuk4b 5uN7qkleeN/bMSTLLvNcAWmc26+hGYVldnIVtJfPAUr0SUMXy3iRdD1H/Lmd/OPPVODL u4wSdJ32ZkMIRaAftrN56dUDU36Rp6yBA3N09MA4vsMQ6tk2VHvMeLRZzGLi3qew275I JgLKgUfxCACWk8aTraR/dQNA0U3aEin70fyLeNVyV1rjtO5NBzyKA3onuWu8Vt9QVyXt UYtA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fKb21st+YMDDZltVk4a50QveuPLb7zWj7a1uwl1ostA=; b=ESIvhn8hi1iSa+VScZtGErN6JG7RsD1S1ix5nTnioVfnONoHaX8/IiCuZIulud+g7o hAhB6ZZ0VVYxjgZ7WVK4u54G3klo9rZjxEu3VJnPkfFZvByxtIfBgkw6JlTHywUb5JFz x+8me5sGWNMRmfxGZm7Gveaj4lpPQGGWWzzaAAYcNX5PcQlb/OW4A+bpfLykTpDbmz4J F+q/hKX9ko6fs6JzCJs5mqrzclfHwttJUn1IhHicC5RzIelSmVSpvnDUWF03OlOeTk4i OEB+btyudnfDvKtt3xSXYe7fzAr99PtUaG58jBuiPQSAA97+9GvphwMWWobQCvn3Tzmd 6ifQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZwTXp3ba; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zl18si637436ejb.626.2021.05.12.12.10.23; Wed, 12 May 2021 12:10:48 -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=@linuxfoundation.org header.s=korg header.b=ZwTXp3ba; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358395AbhELTCL (ORCPT + 99 others); Wed, 12 May 2021 15:02:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:36542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243924AbhELQmO (ORCPT ); Wed, 12 May 2021 12:42:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 39D8861C44; Wed, 12 May 2021 16:08:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620835703; bh=qo5X3bvPHRaDyQ+A7wmJAJJO2KAhPLn2mnm/HJqmc/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZwTXp3baxXsYv8yTm8Y3YqGV1c3zR20kbnmfvXqM5BlCk0gp8JkYT27a7hGx/3mC3 fGIdbTggpnoZPfueNSUJrF1WgH8NG2SkzOOHuouZnxAoEOLkiox3ORyQWHmjwG6JE2 sPDkO4UH1U+cngQZ+v+ot+c47jbTvR39ZNSic3WA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Garry , Sergey Shtylyov , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.12 416/677] scsi: hisi_sas: Fix IRQ checks Date: Wed, 12 May 2021 16:47:42 +0200 Message-Id: <20210512144851.161610524@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144837.204217980@linuxfoundation.org> References: <20210512144837.204217980@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sergey Shtylyov [ Upstream commit 6c11dc060427e07ca144eacaccd696106b361b06 ] Commit df2d8213d9e3 ("hisi_sas: use platform_get_irq()") failed to take into account that irq_of_parse_and_map() and platform_get_irq() have a different way of indicating an error: the former returns 0 and the latter returns a negative error code. Fix up the IRQ checks! Link: https://lore.kernel.org/r/810f26d3-908b-1d6b-dc5c-40019726baca@omprussia.ru Fixes: df2d8213d9e3 ("hisi_sas: use platform_get_irq()") Acked-by: John Garry Signed-off-by: Sergey Shtylyov Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c index 7451377c4cb6..3e359ac752fd 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c @@ -1646,7 +1646,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba) idx = i * HISI_SAS_PHY_INT_NR; for (j = 0; j < HISI_SAS_PHY_INT_NR; j++, idx++) { irq = platform_get_irq(pdev, idx); - if (!irq) { + if (irq < 0) { dev_err(dev, "irq init: fail map phy interrupt %d\n", idx); return -ENOENT; @@ -1665,7 +1665,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba) idx = hisi_hba->n_phy * HISI_SAS_PHY_INT_NR; for (i = 0; i < hisi_hba->queue_count; i++, idx++) { irq = platform_get_irq(pdev, idx); - if (!irq) { + if (irq < 0) { dev_err(dev, "irq init: could not map cq interrupt %d\n", idx); return -ENOENT; @@ -1683,7 +1683,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba) idx = (hisi_hba->n_phy * HISI_SAS_PHY_INT_NR) + hisi_hba->queue_count; for (i = 0; i < HISI_SAS_FATAL_INT_NR; i++, idx++) { irq = platform_get_irq(pdev, idx); - if (!irq) { + if (irq < 0) { dev_err(dev, "irq init: could not map fatal interrupt %d\n", idx); return -ENOENT; -- 2.30.2