Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4952546ybe; Mon, 16 Sep 2019 23:26:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8jpM1gFpDA/joLJJ9JE/dCgOpUw7Xy+UnxuEJtYUfszvA5yKteLBDpJruoLtmbfSa23oL X-Received: by 2002:aa7:d40c:: with SMTP id z12mr3052467edq.30.1568701597467; Mon, 16 Sep 2019 23:26:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568701597; cv=none; d=google.com; s=arc-20160816; b=TU88K9736gi1/nEmxSg+u547b7O2J2mgWprwSDuW04NyH0R+OBt0ORaYP9fce+xECc ihB4IWgnNLTi13pfzBQMgZGm53s6H6x2aQWnb8QRYbtCFyQ0JkbmbZ25w4+bOgRleYLi R+viA1MBbWHuziLcgQ2jyjGF0vxR9zwRLyl0ZIe0zoIn64WRATiTXikpr4iA/1AFTxom 5TIN8Uq6oc3w1ETwiljJyUD3bsVHuJ1qfR2kIPByAU6T4UXgNZlSfi2MuM78eza6TgIP dgP0RswYoEHaCITvb6FvkLolbFr8ED3C6CJvn+rG8Z/tIC0L3Cw2ecI8QJ+2MoCawkaN EECQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=epEuwg1xdHKPnwPm1RSe5GQMDsYIT9iwwxBPtEKOzsY=; b=tzekb4kJn8poXvNvlRt3QP67Zm8KgM7rODTRGmw903kNbnJOAdSR+sGyWPNH8XBxKe UzN7UPziNmdkrUXzlqUNOap8kr3kW7aeRtb8I/KIQ5B6G6+hOA1gDOR7E9NolDNLFBsj vuxYpFmqBgw36UsyoeDGikNy6ejzKk1zUpeUFfES13kPY1v2TRGippwn4BSait1LxcG9 4YsDgBTr+Auh2fW6SzMc2JHgmxsPzfA9wWkozBvgYYjkDAvWwQjIFeMAJ0ULo6qArbvV MOnOrWAivX5tQJ21ASeKu4dOMa4b4Yt1TfJZhZH6o+ZAKGGquYOkep3PS7Q/koU5aUpA fMaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gy24si579965ejb.166.2019.09.16.23.26.13; Mon, 16 Sep 2019 23:26:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391565AbfIPUre (ORCPT + 99 others); Mon, 16 Sep 2019 16:47:34 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:39044 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727971AbfIPUrd (ORCPT ); Mon, 16 Sep 2019 16:47:33 -0400 Received: by mail-wr1-f66.google.com with SMTP id r3so836298wrj.6; Mon, 16 Sep 2019 13:47:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=epEuwg1xdHKPnwPm1RSe5GQMDsYIT9iwwxBPtEKOzsY=; b=VH/BPBRoJc2UtuPBlt6h893+Rb9g0zeYgYN+IGMRAoi1+e2d3EHKAr6Fgwk6fPENN6 +JXy+fEBrgtbId09z3/S3BKJQlr9XkHysn+cSrq6PhRt+U4M1Zc35IAHaw3vUxEBBubV 42C4P60Q1W2jLtiP7sr5ehVCMMbsbRqk4z10rpMJLNEgAmHjuzlEGvKxsFhx9SnTCNUV 3WSfIpOrOWzpGv/VJTKLZOCaaK4PnPtCNHQCc2Q9lgD0lSXq12TVRTBbr4VpDTWZ7Pcq 1G8ETfuPaAguNOwm8rGNfH10nJ6B1SgxyIAFevQsQ1zgaaVYZZ/0L7z7tOyuvSDC80hr EN7g== X-Gm-Message-State: APjAAAXK8slm0U3Uqb+VDWcqAMxFffDwPR+YAsnYrM6CkeqTRK+35g6s KU2jr7jm3dwEEhuOFTEMHZg= X-Received: by 2002:adf:ab0b:: with SMTP id q11mr212288wrc.336.1568666851199; Mon, 16 Sep 2019 13:47:31 -0700 (PDT) Received: from black.home (broadband-188-32-48-208.ip.moscow.rt.ru. [188.32.48.208]) by smtp.googlemail.com with ESMTPSA id x6sm231437wmf.38.2019.09.16.13.47.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 13:47:30 -0700 (PDT) From: Denis Efremov To: Bjorn Helgaas Cc: Denis Efremov , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Andrew Murray , linux-scsi@vger.kernel.org, Jack Wang , "James E.J. Bottomley" Subject: [PATCH v3 18/26] scsi: pm80xx: Use PCI_STD_NUM_BARS Date: Mon, 16 Sep 2019 23:41:50 +0300 Message-Id: <20190916204158.6889-19-efremov@linux.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190916204158.6889-1-efremov@linux.com> References: <20190916204158.6889-1-efremov@linux.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the magic constant (6) with define PCI_STD_NUM_BARS representing the number of PCI BARs. Cc: Jack Wang Cc: "James E.J. Bottomley" Signed-off-by: Denis Efremov --- drivers/scsi/pm8001/pm8001_hwi.c | 2 +- drivers/scsi/pm8001/pm8001_init.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c index 68a8217032d0..1a3661d6be06 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.c +++ b/drivers/scsi/pm8001/pm8001_hwi.c @@ -1186,7 +1186,7 @@ static void pm8001_hw_chip_rst(struct pm8001_hba_info *pm8001_ha) void pm8001_chip_iounmap(struct pm8001_hba_info *pm8001_ha) { s8 bar, logical = 0; - for (bar = 0; bar < 6; bar++) { + for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) { /* ** logical BARs for SPC: ** bar 0 and 1 - logical BAR0 diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index 3374f553c617..aca913490eb5 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c @@ -401,7 +401,7 @@ static int pm8001_ioremap(struct pm8001_hba_info *pm8001_ha) pdev = pm8001_ha->pdev; /* map pci mem (PMC pci base 0-3)*/ - for (bar = 0; bar < 6; bar++) { + for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) { /* ** logical BARs for SPC: ** bar 0 and 1 - logical BAR0 -- 2.21.0