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: <48ddb551-496f-f4e7-96dc-30f250f97438@infradead.org>
Date:   Fri, 16 Jun 2023 21:06:36 -0700
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Arnd Bergmann <arnd@...nel.org>, Mark Brown <broonie@...nel.org>
Cc:     Arnd Bergmann <arnd@...db.de>, Liam Girdwood <lgirdwood@...il.com>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>,
        Yingkun Meng <mengyingkun@...ngson.cn>,
        alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] ASoC: loongson: fix compile testing on 32-bit



On 6/16/23 02:00, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> DIV_ROUND_CLOSEST() does not work on 64-bit variables when building for
> a 32-bit target:
> 
> ld.lld: error: undefined symbol: __udivdi3
>>>> referenced by loongson_i2s.c
>>>>               sound/soc/loongson/loongson_i2s.o:(loongson_i2s_hw_params) in archive vmlinux.a
> 
> Use DIV_ROUND_CLOSEST_ULL() instead.
> 
> Fixes: d24028606e764 ("ASoC: loongson: Add Loongson ASoC Sound Card Support")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>

Acked-by: Randy Dunlap <rdunlap@...radead.org>
Tested-by: Randy Dunlap <rdunlap@...radead.org> # build-tested

Thanks.

> ---
>  sound/soc/loongson/loongson_i2s.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/loongson/loongson_i2s.c b/sound/soc/loongson/loongson_i2s.c
> index f73b6d6f16c23..b919f0fe83615 100644
> --- a/sound/soc/loongson/loongson_i2s.c
> +++ b/sound/soc/loongson/loongson_i2s.c
> @@ -89,7 +89,7 @@ static int loongson_i2s_hw_params(struct snd_pcm_substream *substream,
>  		bclk_ratio = DIV_ROUND_CLOSEST(sysclk,
>  					       (bits * chans * fs * 2)) - 1;
>  		mclk_ratio = clk_rate / sysclk;
> -		mclk_ratio_frac = DIV_ROUND_CLOSEST(((u64)clk_rate << 16),
> +		mclk_ratio_frac = DIV_ROUND_CLOSEST_ULL(((u64)clk_rate << 16),
>  						    sysclk) - (mclk_ratio << 16);
>  
>  		regmap_read(i2s->regmap, LS_I2S_CFG, &val);

-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ