Skip to content

Commit 831c4f3

Browse files
elfringjcmvbkbc
authored andcommitted
xtensa: One function call less in bootmem_init()
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>
1 parent 7d5bdc0 commit 831c4f3

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎arch/xtensa/mm/init.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ void __init bootmem_init(void)
4545
* If PHYS_OFFSET is zero reserve page at address 0:
4646
* successfull allocations should never return NULL.
4747
*/
48-
if (PHYS_OFFSET)
49-
memblock_reserve(0, PHYS_OFFSET);
50-
else
51-
memblock_reserve(0, 1);
48+
memblock_reserve(0, PHYS_OFFSET ? PHYS_OFFSET : 1);
5249

5350
early_init_fdt_scan_reserved_mem();
5451

0 commit comments

Comments
 (0)