From: dann frazier <dannf@hp.com>
To: linux-kernel@vger.kernel.org
Cc: Yinghai Lu <yinghai@kernel.org>
Subject: [PATCH] [x86] pci: Get rid of magic number in AMD bus discovery
Date: Wed, 15 Jul 2009 18:28:22 -0600 [thread overview]
Message-ID: <20090716002821.GV11729@ldl.fc.hp.com> (raw)
The number 4 is hardcoded in a couple of loops.
Use the already-defined PCI_ROOT_NR macro instead.
Signed-off-by: dann frazier <dannf@hp.com>
---
arch/x86/pci/amd_bus.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c
index 3ffa10d..feb3e09 100644
--- a/arch/x86/pci/amd_bus.c
+++ b/arch/x86/pci/amd_bus.c
@@ -332,7 +332,7 @@ static int __init early_fill_mp_bus_info(void)
return 0;
pci_root_num = 0;
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < PCI_ROOT_NR; i++) {
int min_bus;
int max_bus;
reg = read_pci_config(bus, slot, 1, 0xe0 + (i << 2));
@@ -368,7 +368,7 @@ static int __init early_fill_mp_bus_info(void)
memset(range, 0, sizeof(range));
range[0].end = 0xffff;
/* io port resource */
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < PCI_ROOT_NR; i++) {
reg = read_pci_config(bus, slot, 1, 0xc0 + (i << 3));
if (!(reg & 3))
continue;
--
1.6.3.3
next reply other threads:[~2009-07-16 0:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-16 0:28 dann frazier [this message]
2009-07-16 10:09 ` [PATCH] [x86] pci: Get rid of magic number in AMD bus discovery Yinghai Lu
2009-07-16 14:58 ` dann frazier
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=20090716002821.GV11729@ldl.fc.hp.com \
--to=dannf@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=yinghai@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