Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4681010pxj; Wed, 12 May 2021 10:45:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6FszhGPfAda2IUD9o1B0dsOFioU2Cu9SbvBqShE+v+CS6KLzHzWd1T6jq2lQj6+KGrfNX X-Received: by 2002:a05:600c:4846:: with SMTP id j6mr2984417wmo.21.1620841385294; Wed, 12 May 2021 10:43:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620841385; cv=none; d=google.com; s=arc-20160816; b=UHjmS6WJNwotmPaTCd2zrMgP8kDZ4uigBFfgnZvmXwH7XLdVio4Gxukb4NHYzSwkUj fmMCExRBJ4XVYYMvuv3iGH8l60zmaYghvE3u54haN3/KWkIoNakyhTXTiqwY1ppKXSfj BeI6JRGq8A7iyPFE6IDikfN+5qrB1MgPE3LNcjiPN+lmumOiPsMLdG/IJfpwza7xChSS yTgt3SY7Vd7CqmD7GgMH0+i71HpdZgThoUFID3j3OH2CKLk67TMDFJBjaF4y1QzBP+D+ 8HuO8ZjsMTS0NcNkqmSrY0MHuzY8bJuLwC3U/IysRaa5lUyAfCiBZDDI4irGvSVPGyD4 zcjg== 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=okcPueOZLv1Wo2Z8euksY0PifHywqPpbfypICASnl/xAfOnipUHbqAlmiDsvaag7R3 bFR69t1r6qT75QvMVR3y2HV72p3Z9eGm1vZ8D5CywsnL2UiRo1lWAFK66OeQOFnYfp5l FiFVDwhA3rtAMPxZpwlybqrVvwqciHv3tlJP8VCLSzhU2kL37Idj2wOq+unxDflXc1Q5 WYLlDBEBF1vcv/U1HU1gdPzGzSOKRwf3kJnTASzq1paQrHS5y378UPH9djvpJn1FEm3n 8N3qLkgoF4kh2jt5e02O+w0nGdn1eeVOP+6QtA9f/9Egjb083fsTCv5QZ5/mhFF3Z560 IH2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=05+jUBbT; 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 1si4272750wmf.3.2021.05.12.10.42.40; Wed, 12 May 2021 10:43: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=05+jUBbT; 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 S1348605AbhELRiD (ORCPT + 99 others); Wed, 12 May 2021 13:38:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:41990 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235572AbhELQLQ (ORCPT ); Wed, 12 May 2021 12:11:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6ECDA61D47; Wed, 12 May 2021 15:40:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620834039; bh=crKN/7yfo80lWtaZ+YDCa6FqTTqNAX6wJ+BANczlvUE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=05+jUBbTNxlCzbBkFMcXX8x1sbSgofBzCEgLPiBaIiMpCz+Z6Ma4fSdyzpeMhhlPx weYODuBGJyFTFAJ+f8vzevj6znO8nJnF/8jNL305hpSF1aDo+V82eBql4xH6zYuO6K W3d5l3+y5NoO2wHlRVacVPtlklWK4fdgcfZDvSk4= 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.11 368/601] scsi: hisi_sas: Fix IRQ checks Date: Wed, 12 May 2021 16:47:25 +0200 Message-Id: <20210512144839.918918721@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144827.811958675@linuxfoundation.org> References: <20210512144827.811958675@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