Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4617515pxj; Wed, 12 May 2021 09:20:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPU35wh0FJ5pR8ADVSZpFGVUjbMQx94YAcpKLzjD93oa5/rg2ZTRSX4RCDxUkiF6g62Zm/ X-Received: by 2002:a05:651c:1410:: with SMTP id u16mr30134758lje.296.1620836405434; Wed, 12 May 2021 09:20:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620836405; cv=none; d=google.com; s=arc-20160816; b=D/P0U2SqWKmZ7pcjc0ME5TdV5KiLBSAZGGNjRvIDUW1FqmECz5KTobhLvXUuxc2WSK cM6itDDHXsKSnjCKHFXfK7BGH7D+qsPDH6WZvTyuAqBG6TPoUyE38cNXDYNEcqwW/D9P 6FjqXKmH+Mt6cPTTrEQS9SlnZJjbr8yidQPeLoSY6OAFul8qhkBL1FZAGAEdPCJ8BAXn 7lziqPtZh00x1yyeznXOJ9sPWlAUP82oLWAx1hOkv12Rw5D52VCpGtjbxJVz5LfPempo BtwFMIqTHX9OhODTMZ0L7siKL0p6h7EvSPziJoriVxI3MutZImLj+O7XnkWVy6d8IVV9 qw2Q== 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=yA5WVFremrHlcCNmN2PXkVgg0va4k8CASU1IZb7byvY=; b=DshXirXC0WzneSfFB87KZbD7FPITgtLi6AXj8kQgNnkBJdtt5rEhVSv0xR9o0Mqp0E N3lMvXXpl+V4UvlNlD49d/TJB8ilwoTaaQxVmCBHLRUvh6Qbc7fEh2iTVbiYTOWCEyYH VI1cJqYZQmhKX3ybTAvUXqTt64QILK6unnk9BSLS07ns0Hhe42vYhaVKP1+u2kC4v3pU sf6D7XPlpSHxsbomt9pWef5+oGweVjXG+WE/4q99ptpePl/hdDJBkdR19lsA5XF+tO1f QOAcqk0Qa9D9P6FtXC5W9c/W1vExJLLewNDCKcXCRSm+Wzecofv7o5KM2hP1Xm9LiIpw a9fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iqzQmthJ; 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 x13si316668ljh.48.2021.05.12.09.19.35; Wed, 12 May 2021 09:20:05 -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=iqzQmthJ; 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 S240097AbhELQRH (ORCPT + 99 others); Wed, 12 May 2021 12:17:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:50038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232823AbhELPdw (ORCPT ); Wed, 12 May 2021 11:33:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 416566194D; Wed, 12 May 2021 15:17:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832629; bh=crKN/7yfo80lWtaZ+YDCa6FqTTqNAX6wJ+BANczlvUE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iqzQmthJDlKMCTLhRJiTA55siU9QOOVhsp6q6Vt1fcXdGZPAv/acAUFkpKRaur99T FmrRwcTOjlyfGbzz7gO9qo7GM0gUHJjNYdjfEDSVoJLMu+5XOXcJuHilp3iaeepS7z w/FwMOxNAM5ds3P8g0M/XwQRXZwNaC7z/jbG2PrQ= 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.10 331/530] scsi: hisi_sas: Fix IRQ checks Date: Wed, 12 May 2021 16:47:21 +0200 Message-Id: <20210512144830.684597878@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@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 22eecc89d41b..6c2a97f80b12 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c @@ -1644,7 +1644,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; @@ -1663,7 +1663,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; @@ -1681,7 +1681,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