linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Hao <haokexin@gmail.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: <linux-pci@vger.kernel.org>
Subject: [PATCH 2/3] PCI: converge the unnecessary sprinkling of pcibios_bus_to_resource in __pci_read_base
Date: Sat, 25 May 2013 19:36:26 +0800	[thread overview]
Message-ID: <1369481787-21500-3-git-send-email-haokexin@gmail.com> (raw)
In-Reply-To: <1369481787-21500-1-git-send-email-haokexin@gmail.com>

Since we will invoke pcibios_bus_to_resource unconditionally if we
don't goto fail, move it out of if/else wrap. No function change.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
v2: Split these changed into a new patch compare with the v1 patch.

 drivers/pci/probe.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 2505d5e..c57eb27 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -250,12 +250,10 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
 			pci_write_config_dword(dev, pos + 4, 0);
 			region.start = 0;
 			region.end = sz64;
-			pcibios_bus_to_resource(dev, res, &region);
 			bar_disabled = true;
 		} else {
 			region.start = l64;
 			region.end = l64 + sz64;
-			pcibios_bus_to_resource(dev, res, &region);
 		}
 	} else {
 		sz = pci_size(l, sz, mask);
@@ -265,9 +263,10 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
 
 		region.start = l;
 		region.end = l + sz;
-		pcibios_bus_to_resource(dev, res, &region);
 	}
 
+	pcibios_bus_to_resource(dev, res, &region);
+
 	goto out;
 
 
-- 
1.8.1.4


  parent reply	other threads:[~2013-05-25 11:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-25 11:36 [PATCH v2 0/3] fix the pci device malfunction if a wrong bus address is assigned by firmware Kevin Hao
2013-05-25 11:36 ` [PATCH 1/3] PCI: add 0x prefix when printing the BAR registers position in __pci_read_base Kevin Hao
2013-05-25 16:30   ` Liu Jiang
2013-05-25 23:47     ` Bjorn Helgaas
2013-05-26  0:16       ` Kevin Hao
2013-05-25 11:36 ` Kevin Hao [this message]
2013-05-25 11:36 ` [PATCH 3/3] PCI: unset the resource if a wrong bus address is assigned by firmware Kevin Hao
2013-05-25 23:46 ` [PATCH v2 0/3] fix the pci device malfunction " Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1369481787-21500-3-git-send-email-haokexin@gmail.com \
    --to=haokexin@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).