diff mbox

[1/2] seabios: pciinit: fix 64bit bar initilization.

Message ID 2f42a5802ede9e1c96f811132a788b6f25813e62.1280120278.git.yamahata@valinux.co.jp
State New
Headers show

Commit Message

Isaku Yamahata July 26, 2010, 5:02 a.m. UTC
When 64bit bar allocation failed, leave it untouched as 32bit bar case.
There is no point to set higher bit to all 1, it is just leftover from
debug code.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 src/pciinit.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

Comments

Kevin O'Connor July 27, 2010, 1:30 a.m. UTC | #1
On Mon, Jul 26, 2010 at 02:02:45PM +0900, Isaku Yamahata wrote:
> When 64bit bar allocation failed, leave it untouched as 32bit bar case.
> There is no point to set higher bit to all 1, it is just leftover from
> debug code.

Thanks.

-Kevin
diff mbox

Patch

diff --git a/src/pciinit.c b/src/pciinit.c
index b110531..f75e552 100644
--- a/src/pciinit.c
+++ b/src/pciinit.c
@@ -116,12 +116,8 @@  static int pci_bios_allocate_region(u16 bdf, int region_num)
 
     int is_64bit = !(val & PCI_BASE_ADDRESS_SPACE_IO) &&
         (val & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == PCI_BASE_ADDRESS_MEM_TYPE_64;
-    if (is_64bit) {
-        if (size > 0) {
-            pci_config_writel(bdf, ofs + 4, 0);
-        } else {
-            pci_config_writel(bdf, ofs + 4, ~0);
-        }
+    if (is_64bit && size > 0) {
+        pci_config_writel(bdf, ofs + 4, 0);
     }
     return is_64bit;
 }