use BIT() macro instead of explicit shifts

As a side effect, the BIT() macro creates a word_t instead of an int,
so it can can handle even shift that exceed the int limits. This makes
the code more robust and provides the preferred coding pattern.

Signed-off-by: Axel Heider <axelheider@gmx.de>
This commit is contained in:
Axel Heider 2021-07-05 04:29:43 +02:00 committed by Gerwin Klein
parent 0f7135aae4
commit 7bff9f4cd1
2 changed files with 2 additions and 2 deletions

View file

@ -34,7 +34,7 @@ BOOT_CODE void map_kernel_devices(void)
if (!kernel_devices[i].userAvailable) {
p_region_t reg = {
.start = kernel_devices[i].paddr,
.end = kernel_devices[i].paddr + (1 << PAGE_BITS),
.end = kernel_devices[i].paddr + BIT(PAGE_BITS),
};
reserve_region(reg);
}

View file

@ -50,7 +50,7 @@ BOOT_CODE void map_kernel_devices(void)
if (!kernel_devices[i].userAvailable) {
p_region_t reg = {
.start = kernel_devices[i].paddr,
.end = kernel_devices[i].paddr + (1 << seL4_LargePageBits),
.end = kernel_devices[i].paddr + BIT(seL4_LargePageBits),
};
reserve_region(reg);
}