]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
xtensa: One function call less in bootmem_init()
authorMarkus Elfring <elfring@users.sourceforge.net>
Fri, 5 Jul 2019 16:33:58 +0000 (18:33 +0200)
committerMax Filippov <jcmvbkbc@gmail.com>
Fri, 5 Jul 2019 19:02:37 +0000 (12:02 -0700)
Avoid an extra function call by using a ternary operator instead of
a conditional statement for a setting selection.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Message-Id: <495c9f2e-7880-ee9a-5c61-eee598bb24c2@web.de>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/mm/init.c

index b51746f2b80bf925b9f131384e42e2419bd6ac14..79467c74941666bf3c7738cbc416a92128498636 100644 (file)
@@ -45,10 +45,7 @@ void __init bootmem_init(void)
         * If PHYS_OFFSET is zero reserve page at address 0:
         * successfull allocations should never return NULL.
         */
-       if (PHYS_OFFSET)
-               memblock_reserve(0, PHYS_OFFSET);
-       else
-               memblock_reserve(0, 1);
+       memblock_reserve(0, PHYS_OFFSET ? PHYS_OFFSET : 1);
 
        early_init_fdt_scan_reserved_mem();