Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4564248pxj; Wed, 12 May 2021 08:17:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRJGF+K0UDYkS3qjTvv2NX9SjaWQdybYqsN1LBDQsxlh7n87iBccZHq+sBkcmvoamJjB79 X-Received: by 2002:a17:906:7ac9:: with SMTP id k9mr38995548ejo.229.1620832621790; Wed, 12 May 2021 08:17:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620832621; cv=none; d=google.com; s=arc-20160816; b=tNszp4CHzlyfZkaChNLEHFKXhD/46vuIc5/fUV/D4bunVuU01Q+6pxzz/3y5CbFfyx 05mfLW7fUvZTK3Log4qZpllSDXwS3AD+bILvnMSNio7xb/Egf3BX6zPmjubblW8kTh2S 1TIjJWQCNc2o1NDUFso9vWrL+lBgMHcIcatH8YDmnkuBZIvwIrl9AcTP4dhqKZZPtroM VyI49K7mc1D7c+33yw6SLaNvflQm+HP+9MTlLBbdFjvf+KFUo9gOasZ7Lf0P9cA5rvqb udxvHYvDaf5UMbzYYet0wMh9mSD/0xknzt61C5Wm9clQxNmgNL6m6vzL68FYdkeIT0ya fMBg== 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=/TgpSKVxtwrUDXkaFFmaWiNGbHILAgGDiYWsiRYY4wA=; b=qXpJ8jX3fp0BnExX9OdJxz/e1gA6hoXpsgZ+gmA9VVthOaFKrhH/puQ34+OPAbUGeo ++q8aopPrM35cDseL3It2UbjwAVMGYrNTFiv8V0UmySWe5tlEOLsRJDCFOtG1k6ERu9e bVcuekPJAshMjvV8Udgio9ArpktpmOaSWw6bavtx3pxhEkmaciGnLnfOZ+KBEbYgRKPK 94OAG6BS45Y0245EQbEmXYgQ9+pQ0GZRwPIzGVsYARuTYM03Oqz3DvpGy9+7SZ+OBVTb dEWN7ClrL9MZT77TbHFYhc3SYzd+tI1KqVaHJXjAWKC2ePFsIuJnVJc9OE5l/n/QvMge epow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y1Gsl4tR; 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 z10si252379eja.84.2021.05.12.08.16.37; Wed, 12 May 2021 08:17:01 -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=Y1Gsl4tR; 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 S233599AbhELPOM (ORCPT + 99 others); Wed, 12 May 2021 11:14:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:59076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233413AbhELPFT (ORCPT ); Wed, 12 May 2021 11:05:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2D86761943; Wed, 12 May 2021 15:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620831621; bh=bH4rxIyTt8CUSlqp9N2Z7xTxp7tpOIClk0r2NOyL8X4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y1Gsl4tRLT1McQp5n/rDckK2/JTMQhgapwHoyM3KvreIPOfn5NEGMvC2Ov67ulsEQ dCJ0D+bEZ8k8Kc3nnLYEs70j6dPYBFsnaoXxf/JNIfnwbPTWlF2OcPIRaB9Z+1QUeX 3GtfSfMxqo8nyQiIKDuJMwu8x6SMjE081/CxFbgI= 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.4 159/244] scsi: hisi_sas: Fix IRQ checks Date: Wed, 12 May 2021 16:48:50 +0200 Message-Id: <20210512144748.088936296@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144743.039977287@linuxfoundation.org> References: <20210512144743.039977287@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 b861a0f14c9d..3364ae0b9bfe 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c @@ -1645,7 +1645,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; @@ -1664,7 +1664,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; @@ -1682,7 +1682,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