mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ardb@kernel.org>
To: "Thorsten Blum" <blum@kernel.org>,
	"Ilias Apalodimas" <ilias.apalodimas@linaro.org>
Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] efi/libstub: Simplify check_image_region()
Date: Thu, 10 Sep 2026 09:51:17 +0200	[thread overview]
Message-ID: <e41fae7c-9a09-4ae9-aef2-ab4a59d974f0@app.fastmail.com> (raw)
In-Reply-To: <20260830102911.345357-3-blum@kernel.org>



On Sun, 30 Aug 2026, at 12:29, Thorsten Blum wrote:
> 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>
> ---
>  drivers/firmware/efi/libstub/kaslr.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
>

Both patches applied to efi/next - thanks.

> diff --git a/drivers/firmware/efi/libstub/kaslr.c 
> b/drivers/firmware/efi/libstub/kaslr.c
> index 4bc963e999eb..17549bf3dc3e 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;
>  }
> 
>  /**

      parent reply	other threads:[~2026-09-10  7:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-30 10:29 Thorsten Blum
2026-08-30 10:29 ` [PATCH 2/2] efi/libstub: Fix grammar in efi_kaslr_relocate_kernel() comment Thorsten Blum
2026-09-10  7:51 ` Ard Biesheuvel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e41fae7c-9a09-4ae9-aef2-ab4a59d974f0@app.fastmail.com \
    --to=ardb@kernel.org \
    --cc=blum@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®