diff options
author | imp <imp@FreeBSD.org> | 2005-12-30 19:23:32 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-12-30 19:23:32 +0000 |
commit | 9065fc399f3ffd30fbecd8f5f38ef95a8c9d2cd7 (patch) | |
tree | 5f6c8ecbc9d73ea6acf70363fa45897f9c521174 /sys/dev | |
parent | b2e56535e35be8c6f2bd79f0cb4ccdd99ad071ea (diff) | |
download | FreeBSD-src-9065fc399f3ffd30fbecd8f5f38ef95a8c9d2cd7.zip FreeBSD-src-9065fc399f3ffd30fbecd8f5f38ef95a8c9d2cd7.tar.gz |
The RID2BAR macro returns a number, not a bitmask. Fix this.
Spotted by: ru, jhb
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/cardbus/cardbus_cis.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/cardbus/cardbus_cis.c b/sys/dev/cardbus/cardbus_cis.c index 6269889..8dcf500 100644 --- a/sys/dev/cardbus/cardbus_cis.c +++ b/sys/dev/cardbus/cardbus_cis.c @@ -316,7 +316,7 @@ decode_tuple_bar(device_t cbdev, device_t child, int id, if (type == SYS_RES_MEMORY) { if (reg & TPL_BAR_REG_PREFETCHABLE) - dinfo->mprefetchable |= PCI_RID2BAR(bar); + dinfo->mprefetchable |= (1 << PCI_RID2BAR(bar)); #if 0 /* * XXX: It appears from a careful reading of the spec @@ -338,7 +338,7 @@ decode_tuple_bar(device_t cbdev, device_t child, int id, * correctness. */ if (reg & TPL_BAR_REG_BELOW1MB) - dinfo->mbelow1mb |= PCI_RID2BAR(bar); + dinfo->mbelow1mb |= (1 << PCI_RID2BAR(bar)); #endif } @@ -360,9 +360,11 @@ decode_tuple_bar(device_t cbdev, device_t child, int id, DEVPRINTF((cbdev, "Opening BAR: type=%s, bar=%02x, len=%04x%s%s\n", (type == SYS_RES_MEMORY) ? "MEM" : "IO", bar, len, - (type == SYS_RES_MEMORY && dinfo->mprefetchable & PCI_RID2BAR(bar)) ? + (type == SYS_RES_MEMORY && + dinfo->mprefetchable & (1 << PCI_RID2BAR(bar))) ? " (Prefetchable)" : "", type == SYS_RES_MEMORY ? - ((dinfo->mbelow1mb & PCI_RID2BAR(bar)) ? " (Below 1Mb)" : "") : "")); + ((dinfo->mbelow1mb & (1 << PCI_RID2BAR(bar)) ? + " (Below 1Mb)" : "") : "")); resource_list_add(&dinfo->pci.resources, type, bar, 0UL, ~0UL, len); |