treewide: use PHYS_ADDR_MAX to avoid type casting ULLONG_MAX
With PHYS_ADDR_MAX there is now a type safe variant for all bits set. Make use of it. Patch created using a semantic patch as follows: // <smpl> @@ typedef phys_addr_t; @@ -(phys_addr_t)ULLONG_MAX +PHYS_ADDR_MAX // </smpl> Link: http://lkml.kernel.org/r/20180419214204.19322-1-stefan@agner.ch Signed-off-by: Stefan Agner <stefan@agner.ch> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Catalin Marinas <catalin.marinas@arm.com> [arm64] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
0825a6f986
commit
d7dc899abe
@@ -93,7 +93,7 @@ void __init add_memory_region(phys_addr_t start, phys_addr_t size, long type)
|
||||
* If the region reaches the top of the physical address space, adjust
|
||||
* the size slightly so that (start + size) doesn't overflow
|
||||
*/
|
||||
if (start + size - 1 == (phys_addr_t)ULLONG_MAX)
|
||||
if (start + size - 1 == PHYS_ADDR_MAX)
|
||||
--size;
|
||||
|
||||
/* Sanity check */
|
||||
@@ -376,7 +376,7 @@ static void __init bootmem_init(void)
|
||||
unsigned long reserved_end;
|
||||
unsigned long mapstart = ~0UL;
|
||||
unsigned long bootmap_size;
|
||||
phys_addr_t ramstart = (phys_addr_t)ULLONG_MAX;
|
||||
phys_addr_t ramstart = PHYS_ADDR_MAX;
|
||||
bool bootmap_valid = false;
|
||||
int i;
|
||||
|
||||
|
Reference in New Issue
Block a user