Skip to content

Commit

Permalink
x86/PCI: remove 64-bit division
Browse files Browse the repository at this point in the history
The roundup() caused a build error (undefined reference to `__udivdi3').
We're aligning to power-of-two boundaries, so it's simpler to just use
ALIGN() anyway, which avoids the division.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
Bjorn Helgaas authored and Jesse Barnes committed Nov 6, 2009
1 parent 0efea00 commit ea7f1b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/x86/pci/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@ align_resource(struct acpi_device *bridge, struct resource *res)
* that claim this address space have starting alignment and length
* constraints, so fix any obvious BIOS goofs.
*/
if (res->start & (align - 1)) {
if (!IS_ALIGNED(res->start, align)) {
dev_printk(KERN_DEBUG, &bridge->dev,
"host bridge window %pR invalid; "
"aligning start to %d-byte boundary\n", res, align);
res->start &= ~(align - 1);
}
if ((res->end + 1) & (align - 1)) {
if (!IS_ALIGNED(res->end + 1, align)) {
dev_printk(KERN_DEBUG, &bridge->dev,
"host bridge window %pR invalid; "
"aligning end to %d-byte boundary\n", res, align);
res->end = roundup(res->end, align) - 1;
res->end = ALIGN(res->end, align) - 1;
}
}

Expand Down

0 comments on commit ea7f1b6

Please sign in to comment.