From patchwork Fri Jun 16 09:00:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 693269 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 502B0EB64D8 for ; Fri, 16 Jun 2023 09:04:23 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id EABD8829; Fri, 16 Jun 2023 11:03:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EABD8829 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1686906261; bh=42cOD8sz+eZUMd05BlQRxt1PSMlj4opjLa8x0yA5QWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=AdtuXdyHyS/Tcz4Zl0TOtWBswAc0y6mJ3zcxGX7nZ3wYukkYJoUNYUG71tNGicSP/ 6XmJ02xrco4uR2q+mK9kkX49zphvrBTVPfW2LoQZsY9Rf1hHBr2FzmQeQzKrL2HTrm t+wMD84VvJ9JDN0ZOn4Ni7AYMqMSomBgXmND+Gvg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 689B7F80580; Fri, 16 Jun 2023 11:02:44 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 35007F80130; Fri, 16 Jun 2023 11:02:44 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 81EF5F80579; Fri, 16 Jun 2023 11:02:41 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 15C13F80578 for ; Fri, 16 Jun 2023 11:02:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 15C13F80578 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=iJXuogqa Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BDF946117F; Fri, 16 Jun 2023 09:02:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4186AC433C0; Fri, 16 Jun 2023 09:02:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686906157; bh=42cOD8sz+eZUMd05BlQRxt1PSMlj4opjLa8x0yA5QWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iJXuogqaG3pv8w5YBkzuy6w/IMARU40BcnF+lxrWkGc/JB4SdZjvJJOcZdkV4p2Ik vu0A4ay0HhMJPCfnUvyg5jEWm9IyaNmk9Syv+COU4crsF5D984lMHNJo/n3vdnSoen y9sT1rAPEjXpIkhFkx8r02RxTDNh6ACIptapPE7+7Muf8D6GKpV18zNnrYtzCltXU9 /MkJd0fXODF6REfxs6R5/SnxPtIAobq/BQec2KAeJojrAjtzE+DNjLOQxiiUTFrUL6 iawgZ8PNzdctrsWcXopE0hKxjHT3hgio17OiHDV0Xdou4BaNHXH3FikiJMX8IRpYs3 dpahOeAN2yxCA== From: Arnd Bergmann To: Mark Brown Cc: Arnd Bergmann , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Yingkun Meng , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] ASoC: loongson: fix compile testing on 32-bit Date: Fri, 16 Jun 2023 11:00:40 +0200 Message-Id: <20230616090156.2347850-4-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230616090156.2347850-1-arnd@kernel.org> References: <20230616090156.2347850-1-arnd@kernel.org> MIME-Version: 1.0 Message-ID-Hash: KKJ2MUVOWHXDWCIVCEYZWL63SKEYITLP X-Message-ID-Hash: KKJ2MUVOWHXDWCIVCEYZWL63SKEYITLP X-MailFrom: arnd@kernel.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Arnd Bergmann 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 Acked-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested --- 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);