[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 16/17] misc: Add grub_log2ull macro for calculating log ba
From: |
Patrick Steinhardt |
Subject: |
Re: [PATCH v7 16/17] misc: Add grub_log2ull macro for calculating log base 2 of 64-bit integers |
Date: |
Sun, 6 Dec 2020 14:36:39 +0100 |
On Fri, Dec 04, 2020 at 10:43:45AM -0600, Glenn Washburn wrote:
> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
> Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Patrick Steinhardt <ps@pks.im>
> ---
> include/grub/misc.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/include/grub/misc.h b/include/grub/misc.h
> index 780a34e90..73a514eb1 100644
> --- a/include/grub/misc.h
> +++ b/include/grub/misc.h
> @@ -482,4 +482,7 @@ void EXPORT_FUNC(grub_real_boot_time) (const char *file,
> #define grub_max(a, b) (((a) > (b)) ? (a) : (b))
> #define grub_min(a, b) (((a) < (b)) ? (a) : (b))
>
> +#define grub_log2ull(n) (GRUB_TYPE_BITS (grub_uint64_t) \
> + - __builtin_clzll (n) - 1)
> +
> #endif /* ! GRUB_MISC_HEADER */
> --
> 2.27.0
>
signature.asc
Description: PGP signature
- Re: [PATCH v7 09/17] cryptodisk: Add macros GRUB_TYPE_U_MAX/MIN(type) to replace literals, (continued)
- [PATCH v7 07/17] luks2: Add string "index" to user strings using a json index., Glenn Washburn, 2020/12/04
- [PATCH v7 10/17] luks2: grub_cryptodisk_t->total_sectors is the max number of device native sectors, Glenn Washburn, 2020/12/04
- [PATCH v7 01/17] disk: Rename grub_disk_get_size to grub_disk_native_sectors, Glenn Washburn, 2020/12/04
- [PATCH v7 16/17] misc: Add grub_log2ull macro for calculating log base 2 of 64-bit integers, Glenn Washburn, 2020/12/04
- Re: [PATCH v7 16/17] misc: Add grub_log2ull macro for calculating log base 2 of 64-bit integers,
Patrick Steinhardt <=
- [PATCH v7 13/17] luks2: Error check segment.sector_size, Glenn Washburn, 2020/12/04
- [PATCH v7 08/17] cryptodisk: Add macro GRUB_TYPE_BITS() to replace some literals, Glenn Washburn, 2020/12/04
- [PATCH v7 06/17] luks2: Use more intuitive slot key instead of index in user messages, Glenn Washburn, 2020/12/04
- [PATCH v7 03/17] luks2: Remove unused argument in grub_error, Glenn Washburn, 2020/12/04