powerpc: Replace _ALIGN_UP() by ALIGN()
_ALIGN_UP() is specific to powerpc ALIGN() is generic and does the same Replace _ALIGN_UP() by ALIGN() Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Reviewed-by: Joel Stanley <joel@jms.id.au> Link: https://lore.kernel.org/r/8a6d7e45f7904c73a0af539642d3962e2a3c7268.1587407777.git.christophe.leroy@c-s.fr
This commit is contained in:

committed by
Michael Ellerman

parent
e96d904ede
commit
b711531641
@@ -534,7 +534,7 @@ struct exception_regs {
|
||||
};
|
||||
|
||||
/* ensure this structure is always sized to a multiple of the stack alignment */
|
||||
#define STACK_EXC_LVL_FRAME_SIZE _ALIGN_UP(sizeof (struct exception_regs), 16)
|
||||
#define STACK_EXC_LVL_FRAME_SIZE ALIGN(sizeof (struct exception_regs), 16)
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __HEAD_BOOKE_H__ */
|
||||
|
@@ -854,8 +854,8 @@ loff_t __init nvram_create_partition(const char *name, int sig,
|
||||
BUILD_BUG_ON(NVRAM_BLOCK_LEN != 16);
|
||||
|
||||
/* Convert sizes from bytes to blocks */
|
||||
req_size = _ALIGN_UP(req_size, NVRAM_BLOCK_LEN) / NVRAM_BLOCK_LEN;
|
||||
min_size = _ALIGN_UP(min_size, NVRAM_BLOCK_LEN) / NVRAM_BLOCK_LEN;
|
||||
req_size = ALIGN(req_size, NVRAM_BLOCK_LEN) / NVRAM_BLOCK_LEN;
|
||||
min_size = ALIGN(min_size, NVRAM_BLOCK_LEN) / NVRAM_BLOCK_LEN;
|
||||
|
||||
/* If no minimum size specified, make it the same as the
|
||||
* requested size
|
||||
|
@@ -131,7 +131,7 @@ static int pcibios_map_phb_io_space(struct pci_controller *hose)
|
||||
unsigned long io_virt_offset;
|
||||
|
||||
phys_page = ALIGN_DOWN(hose->io_base_phys, PAGE_SIZE);
|
||||
size_page = _ALIGN_UP(hose->pci_io_size, PAGE_SIZE);
|
||||
size_page = ALIGN(hose->pci_io_size, PAGE_SIZE);
|
||||
|
||||
/* Make sure IO area address is clear */
|
||||
hose->io_base_alloc = NULL;
|
||||
|
@@ -97,7 +97,7 @@ static inline int overlaps_initrd(unsigned long start, unsigned long size)
|
||||
return 0;
|
||||
|
||||
return (start + size) > ALIGN_DOWN(initrd_start, PAGE_SIZE) &&
|
||||
start <= _ALIGN_UP(initrd_end, PAGE_SIZE);
|
||||
start <= ALIGN(initrd_end, PAGE_SIZE);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
@@ -624,7 +624,7 @@ static void __init early_reserve_mem(void)
|
||||
/* Then reserve the initrd, if any */
|
||||
if (initrd_start && (initrd_end > initrd_start)) {
|
||||
memblock_reserve(ALIGN_DOWN(__pa(initrd_start), PAGE_SIZE),
|
||||
_ALIGN_UP(initrd_end, PAGE_SIZE) -
|
||||
ALIGN(initrd_end, PAGE_SIZE) -
|
||||
ALIGN_DOWN(initrd_start, PAGE_SIZE));
|
||||
}
|
||||
#endif /* CONFIG_BLK_DEV_INITRD */
|
||||
|
@@ -1449,18 +1449,18 @@ static unsigned long __init alloc_up(unsigned long size, unsigned long align)
|
||||
unsigned long addr = 0;
|
||||
|
||||
if (align)
|
||||
base = _ALIGN_UP(base, align);
|
||||
base = ALIGN(base, align);
|
||||
prom_debug("%s(%lx, %lx)\n", __func__, size, align);
|
||||
if (ram_top == 0)
|
||||
prom_panic("alloc_up() called with mem not initialized\n");
|
||||
|
||||
if (align)
|
||||
base = _ALIGN_UP(alloc_bottom, align);
|
||||
base = ALIGN(alloc_bottom, align);
|
||||
else
|
||||
base = alloc_bottom;
|
||||
|
||||
for(; (base + size) <= alloc_top;
|
||||
base = _ALIGN_UP(base + 0x100000, align)) {
|
||||
base = ALIGN(base + 0x100000, align)) {
|
||||
prom_debug(" trying: 0x%lx\n\r", base);
|
||||
addr = (unsigned long)prom_claim(base, size, 0);
|
||||
if (addr != PROM_ERROR && addr != 0)
|
||||
@@ -1587,7 +1587,7 @@ static void __init reserve_mem(u64 base, u64 size)
|
||||
* dumb and just copy this entire array to the boot params
|
||||
*/
|
||||
base = ALIGN_DOWN(base, PAGE_SIZE);
|
||||
top = _ALIGN_UP(top, PAGE_SIZE);
|
||||
top = ALIGN(top, PAGE_SIZE);
|
||||
size = top - base;
|
||||
|
||||
if (cnt >= (MEM_RESERVE_MAP_SIZE - 1))
|
||||
|
Reference in New Issue
Block a user