grub-devel
[Top][All Lists]
Advanced

[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
> 

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]