Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4607484ybe; Mon, 16 Sep 2019 15:23:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyodH4bJcCaKLKkLa9Mb8oVTK36hq6H7HFDbrBtXqVevTFIQjYZfk0GpuhUFVwrrEZI/Ph2 X-Received: by 2002:aa7:d488:: with SMTP id b8mr1669435edr.90.1568672613988; Mon, 16 Sep 2019 15:23:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568672613; cv=none; d=google.com; s=arc-20160816; b=LTFz4+QU6YjzgWBaC+fIKNpT3HIq71qoMBkNxl/hOdbCkv1PgvzozdBWsLXVlaH4Pr Yy5KWDCQMYwwbVO0g7P4tBImPV2KXZEttrWXpvfGVF8p3FccCgxBiOBPyq7vQ8rSbAyf HL0YzyZ2PmwzbgsuMV45tUy/a7WYrhl9/kLjXHL6rYI+ABBE6XsprGxm0hqgaCddo5fS diGVNi4lGKTd3BX+KLy4zqnvUVqwo6WtMKFqIR4wg0I4q6taikkBiGjNZpGU88KtiT3q TUNPAdUWVyc9p2XK0gOijfpPrFSyJpZ3TRWEFgk26//nizqaO+UDfG29IuV9jkv+sJuR Ocog== 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=oEvxZvssX49R5a8dabCLJlXPjptDKkJzN4UZVHUANFI=; b=s5DJrhz1lxpi+lx2Kq9WA/Xe939WGloajOtVfr0BXvg5bDaByEt7Y8ea1LCJGWbCsX 5x1LryiC6C5I9OBDv2DAX3/FKoxfkgSh0gS5K+H1OXpcaga3kIkIhXAfnq41XLO6+etL 4TcGBKsY1bjxT0P/DZ1ngyaFwJX3qOnEViPdauC2YAzbA7O54X3x8FAP2DyphbSiuKuD CrGbGsjcyVZjWI400OmQaX3gU9i575xxuFjt6ATaG9Dr1yC3UNKq6YCOileuOUmZhEts lE3+zg6aKTnxIH9BkrQUGpnb+tXj/1G3DJCzvzLKoOag68RHQn4nl+EovwmfNoauz59d VlEA== 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 i1si139726ejc.245.2019.09.16.15.23.10; Mon, 16 Sep 2019 15:23:33 -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 S2391476AbfIPUnj (ORCPT + 99 others); Mon, 16 Sep 2019 16:43:39 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37184 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730610AbfIPUni (ORCPT ); Mon, 16 Sep 2019 16:43:38 -0400 Received: by mail-wr1-f66.google.com with SMTP id i1so843431wro.4; Mon, 16 Sep 2019 13:43:36 -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=oEvxZvssX49R5a8dabCLJlXPjptDKkJzN4UZVHUANFI=; b=CHBypgUHaxf7cVBalNuSWPc2byC/r6Y5yDzGoGRIHv7tSnV3UT6tLe0c0xdiwKGbGo QkZpKz7FzejCnmY/WKqaCMLv82YbL+QFy1BRo5hvBEl2yjburhHJV124V6vE4LfZXTon ZS8CgNMchSN2QKEI2ocWoHeS/bIPwJw8ugXbrN/RXJw1d/Uvkub1i8zKF8lNwNx72cCt S/iX+ztSWK5oXs+K26YFnHp3GYBAiCRuNIRidwWjQMaQK+3zCsIvdL8MQsGXL6EjOv3r Om12OeMe8shwC9psKl215IB7Pa76t20tWn0CIhgCjQ919Y0Bb1RIRJ/Ndh/nuZbkuaK+ /5kg== X-Gm-Message-State: APjAAAUYsBlz4KfQzRwJCPjVgfBpMD9WyW4AfluFwTy0SRu6HpUJLpQb IuWzzZv49zQ+fLj9uwzXLPk= X-Received: by 2002:a05:6000:105:: with SMTP id o5mr203431wrx.51.1568666616192; Mon, 16 Sep 2019 13:43:36 -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.43.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 13:43:35 -0700 (PDT) From: Denis Efremov To: Bjorn Helgaas Cc: Denis Efremov , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Andrew Murray , linux-hyperv@vger.kernel.org, "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Sasha Levin Subject: [PATCH v3 02/26] PCI: hv: Use PCI_STD_NUM_BARS Date: Mon, 16 Sep 2019 23:41:34 +0300 Message-Id: <20190916204158.6889-3-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: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Sasha Levin Signed-off-by: Denis Efremov --- drivers/pci/controller/pci-hyperv.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index 40b625458afa..1665c23b649f 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -307,7 +307,7 @@ struct pci_bus_relations { struct pci_q_res_req_response { struct vmpacket_descriptor hdr; s32 status; /* negative values are failures */ - u32 probed_bar[6]; + u32 probed_bar[PCI_STD_NUM_BARS]; } __packed; struct pci_set_power { @@ -503,7 +503,7 @@ struct hv_pci_dev { * What would be observed if one wrote 0xFFFFFFFF to a BAR and then * read it back, for each of the BAR offsets within config space. */ - u32 probed_bar[6]; + u32 probed_bar[PCI_STD_NUM_BARS]; }; struct hv_pci_compl { @@ -1327,7 +1327,7 @@ static void survey_child_resources(struct hv_pcibus_device *hbus) * so it's sufficient to just add them up without tracking alignment. */ list_for_each_entry(hpdev, &hbus->children, list_entry) { - for (i = 0; i < 6; i++) { + for (i = 0; i < PCI_STD_NUM_BARS; i++) { if (hpdev->probed_bar[i] & PCI_BASE_ADDRESS_SPACE_IO) dev_err(&hbus->hdev->device, "There's an I/O BAR in this list!\n"); @@ -1401,7 +1401,7 @@ static void prepopulate_bars(struct hv_pcibus_device *hbus) /* Pick addresses for the BARs. */ do { list_for_each_entry(hpdev, &hbus->children, list_entry) { - for (i = 0; i < 6; i++) { + for (i = 0; i < PCI_STD_NUM_BARS; i++) { bar_val = hpdev->probed_bar[i]; if (bar_val == 0) continue; @@ -1558,7 +1558,7 @@ static void q_resource_requirements(void *context, struct pci_response *resp, "query resource requirements failed: %x\n", resp->status); } else { - for (i = 0; i < 6; i++) { + for (i = 0; i < PCI_STD_NUM_BARS; i++) { completion->hpdev->probed_bar[i] = q_res_req->probed_bar[i]; } -- 2.21.0