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: 108960 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1189848vqr; Fri, 16 Jun 2023 02:13:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4OurbIgIkLGl2Hhr6vZa8IZHQw9ARSuqssyx9aMP2swhewzFtZtvY3hocMs/GyoC2pc88R X-Received: by 2002:a17:90a:1a05:b0:246:85ec:d816 with SMTP id 5-20020a17090a1a0500b0024685ecd816mr1054569pjk.3.1686906781268; Fri, 16 Jun 2023 02:13:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686906781; cv=none; d=google.com; s=arc-20160816; b=QrsYb5UfdUMRlqR7AmYhWTXZc5kpSW4vp/+zivhVrG40qZduDX26SRCbFG5H5v59sy AUOpx1PUOYc6vXDHaZWMfewe/AE+lUL+ZGcS/x4qjquLMMtPMnFjAx7oIWIMBXx4HgFY QO25h/++d0+VDFVA3LtF8aiD5YfIDMS4Ujq3KGoZXvGPsSLMflCJ1I3fd5ncMNPVTNYT /b4Q4F8u3IF0QBaUGZcgI2PjS+CovofgvusCxLvYabi5m1Pdut2VlJHr2gIgbKmGB2X4 z/bKr0AOG161Y1Az68x+i0sIUsbEbs9nyZMT5D6Z1w8lohCQ5pYO1haVzuskgIZLY6Xx aCzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SRpAJ4VT0kgCC2zUlp9Wl0zitA63DAujJz5tUvTx1NA=; b=yQx8j+9gTyCOVYw3m4gdJzPznDeWpIVhCRqxc9OSVAAZEjSe+A6etAbjYfi6TXi418 rX6ktLBignMFG2Zq3jGoH1eYqM5QoYWvbrsx2aFbjkjBVqUaxeGKA9mbpbAS5nK+nIai Y8hMlKCO0E373UmO9hEf+1hN0OPLGmgZXek/001wlfSPimrD1WDqChgbHwbhY5t6JMKg ezFHR7/jX0AmJwpRIm+I7ydD2nfwADuVuFM+zx9+Y7tHImX5oFk9eSc71fEPFw5PZzjd I82ih2kMr6F6KsEQhjTPGPTRgNa4o5P1dme+eiiPPWouFu88/oMIPOYh3WKGn3HLOka2 6eiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iJXuogqa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bm18-20020a656e92000000b0053074c54c3fsi15285278pgb.868.2023.06.16.02.12.48; Fri, 16 Jun 2023 02:13:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iJXuogqa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245580AbjFPJFt (ORCPT + 99 others); Fri, 16 Jun 2023 05:05:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230318AbjFPJFG (ORCPT ); Fri, 16 Jun 2023 05:05:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7330A3592 for ; Fri, 16 Jun 2023 02:02:49 -0700 (PDT) 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 D195D614F1 for ; 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 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768849965053010740?= X-GMAIL-MSGID: =?utf-8?q?1768849965053010740?= 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);