[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 18/18] luks2: Use grub_log2ull to calculate log_sector_siz
From: |
Patrick Steinhardt |
Subject: |
Re: [PATCH v8 18/18] luks2: Use grub_log2ull to calculate log_sector_size and improve readability |
Date: |
Sat, 12 Dec 2020 09:18:01 +0100 |
On Tue, Dec 08, 2020 at 04:45:49PM -0600, Glenn Washburn wrote:
> Signed-off-by: Glenn Washburn <development@efficientek.com>
> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Patrick Steinhardt <ps@pks.im>
> ---
> grub-core/disk/luks2.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c
> index c737797b9..31b51f1d4 100644
> --- a/grub-core/disk/luks2.c
> +++ b/grub-core/disk/luks2.c
> @@ -642,8 +642,7 @@ luks2_recover_key (grub_disk_t source,
>
> /* Set up disk according to keyslot's segment. */
> crypt->offset_sectors = grub_divmod64 (segment.offset,
> segment.sector_size, NULL);
> - crypt->log_sector_size = sizeof (unsigned int) * 8
> - - __builtin_clz ((unsigned int) segment.sector_size) - 1;
> + crypt->log_sector_size = grub_log2ull (segment.sector_size);
> /* Set to the source disk size, which is the maximum we allow. */
> max_crypt_sectors = grub_disk_convert_sector(source,
> source->total_sectors,
> --
> 2.27.0
>
signature.asc
Description: PGP signature
- Re: [PATCH v8 14/18] luks2: Better error handling when setting up the cryptodisk, (continued)
[PATCH v8 15/18] luks2: Error check segment.sector_size, Glenn Washburn, 2020/12/08
[PATCH v8 16/18] mips: Enable __clzdi2(), Glenn Washburn, 2020/12/08
[PATCH v8 18/18] luks2: Use grub_log2ull to calculate log_sector_size and improve readability, Glenn Washburn, 2020/12/08
- Re: [PATCH v8 18/18] luks2: Use grub_log2ull to calculate log_sector_size and improve readability,
Patrick Steinhardt <=
Re: [PATCH v8 00/18] Cryptodisk fixes for v2.06 redux, Daniel Kiper, 2020/12/10