Commit d3f3d3bf authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc: Replace _ALIGN() by ALIGN()

_ALIGN() is specific to powerpc
ALIGN() is generic and does the same

Replace _ALIGN() by ALIGN()
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Reviewed-by: default avatarJoel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/4006d9c8e69f8eaccee954899f6b5fb76240d00b.1587407777.git.christophe.leroy@c-s.fr
parent b7115316
...@@ -188,7 +188,7 @@ int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot); ...@@ -188,7 +188,7 @@ int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot);
* memory shall not share segments. * memory shall not share segments.
*/ */
#if defined(CONFIG_STRICT_KERNEL_RWX) && defined(CONFIG_MODULES) #if defined(CONFIG_STRICT_KERNEL_RWX) && defined(CONFIG_MODULES)
#define VMALLOC_START ((_ALIGN((long)high_memory, 256L << 20) + VMALLOC_OFFSET) & \ #define VMALLOC_START ((ALIGN((long)high_memory, 256L << 20) + VMALLOC_OFFSET) & \
~(VMALLOC_OFFSET - 1)) ~(VMALLOC_OFFSET - 1))
#else #else
#define VMALLOC_START ((((long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))) #define VMALLOC_START ((((long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)))
......
...@@ -110,7 +110,7 @@ int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot); ...@@ -110,7 +110,7 @@ int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot);
*/ */
#define VMALLOC_OFFSET (0x1000000) /* 16M */ #define VMALLOC_OFFSET (0x1000000) /* 16M */
#ifdef PPC_PIN_SIZE #ifdef PPC_PIN_SIZE
#define VMALLOC_START (((_ALIGN((long)high_memory, PPC_PIN_SIZE) + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))) #define VMALLOC_START (((ALIGN((long)high_memory, PPC_PIN_SIZE) + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)))
#else #else
#define VMALLOC_START ((((long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))) #define VMALLOC_START ((((long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)))
#endif #endif
......
...@@ -2426,7 +2426,7 @@ static void __init *make_room(unsigned long *mem_start, unsigned long *mem_end, ...@@ -2426,7 +2426,7 @@ static void __init *make_room(unsigned long *mem_start, unsigned long *mem_end,
{ {
void *ret; void *ret;
*mem_start = _ALIGN(*mem_start, align); *mem_start = ALIGN(*mem_start, align);
while ((*mem_start + needed) > *mem_end) { while ((*mem_start + needed) > *mem_end) {
unsigned long room, chunk; unsigned long room, chunk;
...@@ -2562,7 +2562,7 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start, ...@@ -2562,7 +2562,7 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
*lp++ = *p; *lp++ = *p;
} }
*lp = 0; *lp = 0;
*mem_start = _ALIGN((unsigned long)lp + 1, 4); *mem_start = ALIGN((unsigned long)lp + 1, 4);
} }
/* get it again for debugging */ /* get it again for debugging */
...@@ -2608,7 +2608,7 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start, ...@@ -2608,7 +2608,7 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
/* push property content */ /* push property content */
valp = make_room(mem_start, mem_end, l, 4); valp = make_room(mem_start, mem_end, l, 4);
call_prom("getprop", 4, 1, node, pname, valp, l); call_prom("getprop", 4, 1, node, pname, valp, l);
*mem_start = _ALIGN(*mem_start, 4); *mem_start = ALIGN(*mem_start, 4);
if (!prom_strcmp(pname, "phandle")) if (!prom_strcmp(pname, "phandle"))
has_phandle = 1; has_phandle = 1;
...@@ -2667,7 +2667,7 @@ static void __init flatten_device_tree(void) ...@@ -2667,7 +2667,7 @@ static void __init flatten_device_tree(void)
prom_panic ("couldn't get device tree root\n"); prom_panic ("couldn't get device tree root\n");
/* Build header and make room for mem rsv map */ /* Build header and make room for mem rsv map */
mem_start = _ALIGN(mem_start, 4); mem_start = ALIGN(mem_start, 4);
hdr = make_room(&mem_start, &mem_end, hdr = make_room(&mem_start, &mem_end,
sizeof(struct boot_param_header), 4); sizeof(struct boot_param_header), 4);
dt_header_start = (unsigned long)hdr; dt_header_start = (unsigned long)hdr;
......
...@@ -386,7 +386,7 @@ static unsigned long __init bootx_flatten_dt(unsigned long start) ...@@ -386,7 +386,7 @@ static unsigned long __init bootx_flatten_dt(unsigned long start)
hdr->dt_strings_size = bootx_dt_strend - bootx_dt_strbase; hdr->dt_strings_size = bootx_dt_strend - bootx_dt_strbase;
/* Build structure */ /* Build structure */
mem_end = _ALIGN(mem_end, 16); mem_end = ALIGN(mem_end, 16);
DBG("Building device tree structure at: %x\n", mem_end); DBG("Building device tree structure at: %x\n", mem_end);
hdr->off_dt_struct = mem_end - mem_start; hdr->off_dt_struct = mem_end - mem_start;
bootx_scan_dt_build_struct(base, 4, &mem_end); bootx_scan_dt_build_struct(base, 4, &mem_end);
...@@ -404,7 +404,7 @@ static unsigned long __init bootx_flatten_dt(unsigned long start) ...@@ -404,7 +404,7 @@ static unsigned long __init bootx_flatten_dt(unsigned long start)
* also bump mem_reserve_cnt to cause further reservations to * also bump mem_reserve_cnt to cause further reservations to
* fail since it's too late. * fail since it's too late.
*/ */
mem_end = _ALIGN(mem_end, PAGE_SIZE); mem_end = ALIGN(mem_end, PAGE_SIZE);
DBG("End of boot params: %x\n", mem_end); DBG("End of boot params: %x\n", mem_end);
rsvmap[0] = mem_start; rsvmap[0] = mem_start;
rsvmap[1] = mem_end; rsvmap[1] = mem_end;
......
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