From patchwork Tue Feb 24 08:33:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 5870481 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 43C349F373 for ; Tue, 24 Feb 2015 08:33:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8BAC220650 for ; Tue, 24 Feb 2015 08:33:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ACD972060B for ; Tue, 24 Feb 2015 08:33:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752178AbbBXId1 (ORCPT ); Tue, 24 Feb 2015 03:33:27 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:36437 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751498AbbBXId0 (ORCPT ); Tue, 24 Feb 2015 03:33:26 -0500 Received: by pabkq14 with SMTP id kq14so34429677pab.3 for ; Tue, 24 Feb 2015 00:33:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=M0zpYGhPqbNqw5vRIutns7Q7OivckowBwomtRI8XXUs=; b=e6Sr3z5iOOzQXVfGzqujnPzOzMz73Ub0SkT+kvbG6sxULttAgO+72TZpabB1AQSth4 ya5xK64J93WJaqgYZvwFRRjjMXb55lIsjh/ZjfAqVqhf62CESCAxK0jM5+839pSBkp7r JmEkGxGo46CzYbJ4+/6CuXtIBCUtAYyPcaVWiA0iJiSHtu2gD7Cqum33pDZQ4M5hvTTA oeq/nDs+mOX5/xo9d9DdTt35VlntQqLuq8mCcZ+us6H/5jBfiJQazuW+z4inoyvN4/Sr Xe9wjqUHpyfqZiJAfPIhk+qeVzkzz8haaWgsNOc5M2lNyWBgkf7A5DEIzKBlxV7KAXsT QgUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=M0zpYGhPqbNqw5vRIutns7Q7OivckowBwomtRI8XXUs=; b=LRZaGsimabeGfv42JD2eveTxZNNldmXsnx/+2DbeV+rQooCMzKBnUorTuZhnxyQb05 eyBD0tMjSWkeUVYqHTH1e15AWYQ2P5P6YRJ1ZKNa4x7E2uCbtk+QdhzlDbkKm7g1IRku UHuQt/dHMHCZZvOcihyzCrqZBFrSyY/nHiUANYuCAkxkjHToHJXovjmoiRTJ77aggD++ 5ZnIIbP1539T2CCz6cIIa09ifvSpg/0H+PLzSDZLwXBc3mxQ5JzWS88ok+HwvvGonHBs tHH9/y44TBuR5RfPmFgBsAZpJyvQujuNQmf6hdweUK0Lr5+b9pm0H2YOMWtUoj1xU62x l72w== X-Gm-Message-State: ALoCoQkszH+quMYAUAKaDK+fjzzOX14QEblADaJj+euLix8cY0TDdm0vw8ba3o2pkCMQOF4iKeYg X-Received: by 10.66.122.69 with SMTP id lq5mr27319273pab.52.1424766806097; Tue, 24 Feb 2015 00:33:26 -0800 (PST) Received: from localhost ([12.23.74.29]) by mx.google.com with ESMTPSA id dr5sm34023535pdb.48.2015.02.24.00.33.25 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 24 Feb 2015 00:33:25 -0800 (PST) Subject: [PATCH v12 04/21] PCI: Index IOV resources in the conventional style To: Wei Yang , benh@au1.ibm.com, gwshan@linux.vnet.ibm.com From: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Tue, 24 Feb 2015 02:33:24 -0600 Message-ID: <20150224083324.32124.74934.stgit@bhelgaas-glaptop2.roam.corp.google.com> In-Reply-To: <20150224082939.32124.45744.stgit@bhelgaas-glaptop2.roam.corp.google.com> References: <20150224082939.32124.45744.stgit@bhelgaas-glaptop2.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Most of PCI uses "res = &dev->resource[i]", not "res = dev->resource + i". Use that style in iov.c also. No functional change. Signed-off-by: Bjorn Helgaas --- drivers/pci/iov.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 5bca0e1a2799..27b98c361823 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -95,7 +95,7 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset) virtfn->multifunction = 0; for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) { - res = dev->resource + PCI_IOV_RESOURCES + i; + res = &dev->resource[i + PCI_IOV_RESOURCES]; if (!res->parent) continue; virtfn->resource[i].name = pci_name(virtfn); @@ -212,7 +212,7 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn) nres = 0; for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) { bars |= (1 << (i + PCI_IOV_RESOURCES)); - res = dev->resource + PCI_IOV_RESOURCES + i; + res = &dev->resource[i + PCI_IOV_RESOURCES]; if (res->parent) nres++; } @@ -373,7 +373,7 @@ found: nres = 0; for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) { - res = dev->resource + PCI_IOV_RESOURCES + i; + res = &dev->resource[i + PCI_IOV_RESOURCES]; bar64 = __pci_read_base(dev, pci_bar_unknown, res, pos + PCI_SRIOV_BAR + i * 4); if (!res->flags) @@ -417,7 +417,7 @@ found: failed: for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) { - res = dev->resource + PCI_IOV_RESOURCES + i; + res = &dev->resource[i + PCI_IOV_RESOURCES]; res->flags = 0; }