summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Blum <blum@kernel.org>2026-08-30 12:29:09 +0200
committerArd Biesheuvel <ardb@kernel.org>2026-09-10 09:46:08 +0200
commitd6c852af44d7df4ecf3b30ba082ca8a52bc9645a (patch)
tree52cd21bbb140b9d5428eb78f89247252920a3aea
parent2a2b1e23c448ca405495dae162746c330e0ce15b (diff)
downloadlinux-next-d6c852af44d7df4ecf3b30ba082ca8a52bc9645a.tar.gz
linux-next-d6c852af44d7df4ecf3b30ba082ca8a52bc9645a.zip
efi/libstub: Simplify check_image_region()
Drop the local ret variable and the break statement by returning the result directly. Also use unsigned long for map_offset, since map_size and desc_size are both unsigned long. Signed-off-by: Thorsten Blum <blum@kernel.org> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
-rw-r--r--drivers/firmware/efi/libstub/kaslr.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/firmware/efi/libstub/kaslr.c b/drivers/firmware/efi/libstub/kaslr.c
index f5074656457a..b73b6d752f43 100644
--- a/drivers/firmware/efi/libstub/kaslr.c
+++ b/drivers/firmware/efi/libstub/kaslr.c
@@ -59,8 +59,7 @@ static bool check_image_region(u64 base, u64 size)
{
struct efi_boot_memmap *map __free(efi_pool) = NULL;
efi_status_t status;
- bool ret = false;
- int map_offset;
+ unsigned long map_offset;
status = efi_get_memory_map(&map, false);
if (status != EFI_SUCCESS)
@@ -74,13 +73,11 @@ static bool check_image_region(u64 base, u64 size)
* Find the region that covers base, and return whether
* it covers base+size bytes.
*/
- if (base >= md->phys_addr && base < end) {
- ret = (base + size) <= end;
- break;
- }
+ if (base >= md->phys_addr && base < end)
+ return (base + size) <= end;
}
- return ret;
+ return false;
}
/**