Commit 2a5d6651 authored by Matt Turner's avatar Matt Turner Committed by Ralf Baechle

MIPS: Use ALIGN(x, bytes) instead of __ALIGN_MASK(x, bytes - 1)

ALIGN(x, bytes) expands to __ALIGN_MASK(x, bytes - 1), so use the one
that is most clear.
Signed-off-by: default avatarMatt Turner <mattst88@gmail.com>
To: linux-mips@linux-mips.org
Cc: David Daney <ddaney@caviumnetworks.com>
Patchwork: http://patchwork.linux-mips.org/patch/999/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent bba90760
...@@ -253,7 +253,7 @@ int64_t cvmx_bootmem_phy_alloc(uint64_t req_size, uint64_t address_min, ...@@ -253,7 +253,7 @@ int64_t cvmx_bootmem_phy_alloc(uint64_t req_size, uint64_t address_min,
* impossible requests up front. (NOP for address_min == 0) * impossible requests up front. (NOP for address_min == 0)
*/ */
if (alignment) if (alignment)
address_min = __ALIGN_MASK(address_min, (alignment - 1)); address_min = ALIGN(address_min, alignment);
/* /*
* Reject inconsistent args. We have adjusted these, so this * Reject inconsistent args. We have adjusted these, so this
...@@ -291,7 +291,7 @@ int64_t cvmx_bootmem_phy_alloc(uint64_t req_size, uint64_t address_min, ...@@ -291,7 +291,7 @@ int64_t cvmx_bootmem_phy_alloc(uint64_t req_size, uint64_t address_min,
* satisfy request. * satisfy request.
*/ */
usable_base = usable_base =
__ALIGN_MASK(max(address_min, ent_addr), alignment - 1); ALIGN(max(address_min, ent_addr), alignment);
usable_max = min(address_max, ent_addr + ent_size); usable_max = min(address_max, ent_addr + ent_size);
/* /*
* We should be able to allocate block at address * We should be able to allocate block at address
...@@ -671,7 +671,7 @@ int64_t cvmx_bootmem_phy_named_block_alloc(uint64_t size, uint64_t min_addr, ...@@ -671,7 +671,7 @@ int64_t cvmx_bootmem_phy_named_block_alloc(uint64_t size, uint64_t min_addr,
* coallesced when they are freed. The alloc routine does the * coallesced when they are freed. The alloc routine does the
* same rounding up on all allocations. * same rounding up on all allocations.
*/ */
size = __ALIGN_MASK(size, (CVMX_BOOTMEM_ALIGNMENT_SIZE - 1)); size = ALIGN(size, CVMX_BOOTMEM_ALIGNMENT_SIZE);
addr_allocated = cvmx_bootmem_phy_alloc(size, min_addr, max_addr, addr_allocated = cvmx_bootmem_phy_alloc(size, min_addr, max_addr,
alignment, alignment,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment