lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230703081525.0fb45fde@sal.lan>
Date:   Mon, 3 Jul 2023 08:15:25 +0200
From:   Mauro Carvalho Chehab <mchehab@...nel.org>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Hans Verkuil <hverkuil-cisco@...all.nl>,
        Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>, Mark Brown <broonie@...nel.org>,
        David Lin <CTLIN0@...oton.com>, linux-media@...r.kernel.org,
        linux-kernel@...r.kernel.org, alsa-devel@...a-project.org,
        Antti Palosaari <crope@....fi>, Sergey Kozlov <serjk@...up.ru>,
        Abylay Ospan <aospan@...up.ru>,
        Yasunari Takiguchi <Yasunari.Takiguchi@...y.com>,
        Michael Krufky <mkrufky@...uxtv.org>,
        Matthias Schwarzott <zzam@...too.org>,
        Akihiro Tsukada <tskd08@...il.com>,
        Liam Girdwood <lgirdwood@...il.com>,
        Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>
Subject: Re: [PATCH v1 2/4] lib/math/int_log: Use ARRAY_SIZE(logtable) where
 makes sense

Em Mon, 19 Jun 2023 20:20:17 +0300
Andy Shevchenko <andriy.shevchenko@...ux.intel.com> escreveu:

> Use ARRAY_SIZE(logtable) where makes sense.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>

Reviewed-by: Mauro Carvalho Chehab <mchehab@...nel.org>

> ---
>  lib/math/int_log.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/math/int_log.c b/lib/math/int_log.c
> index 322df25a22d6..ea98fc0b3fe2 100644
> --- a/lib/math/int_log.c
> +++ b/lib/math/int_log.c
> @@ -91,7 +91,7 @@ unsigned int intlog2(u32 value)
>  	 *	so we would use the entry 0x18
>  	 */
>  	significand = value << (31 - msb);
> -	logentry = (significand >> 23) & 0xff;
> +	logentry = (significand >> 23) % ARRAY_SIZE(logtable);
>  
>  	/**
>  	 *	last step we do is interpolation because of the
> @@ -109,7 +109,7 @@ unsigned int intlog2(u32 value)
>  	 *	logtable_next is 256
>  	 */
>  	interpolation = ((significand & 0x7fffff) *
> -			((logtable[(logentry + 1) & 0xff] -
> +			((logtable[(logentry + 1) % ARRAY_SIZE(logtable)] -
>  			  logtable[logentry]) & 0xffff)) >> 15;
>  
>  	/* now we return the result */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ