From patchwork Fri Jun 16 09:00:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108954 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1188324vqr; Fri, 16 Jun 2023 02:09:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Eap0BwE2UMeW697mEGKnYqqr8h6g0MLspSG/ohvnssvm62eS2fXTLwF2mRu1EnuLQJGvo X-Received: by 2002:a05:6358:51cd:b0:123:1d38:db05 with SMTP id 13-20020a05635851cd00b001231d38db05mr986067rwl.6.1686906571354; Fri, 16 Jun 2023 02:09:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686906571; cv=none; d=google.com; s=arc-20160816; b=uoQKTLY+eKiLy9Tm7uLvR5Xl9D4vBarRvuU8iwv0PKLRNwcOEPOZXxYnzC3L08s+cn UBrI3n3PkMixc2jh0fmm4CgaEpB7iv7pDrJHaqABDWbq9MUeFHOoifyY77qKY8MNsinY GXco2MXNjyR6Mq/V297CrQ3yMYfWrODM1B0iU91Rm7Fl2F8GjuS4FexO4XWmE/TAk0bp XuzMixKaq59CcRsTgpubUUp0Pi+jaNJEvNGNzmQka84vULNbjKlB71smNeltiE7bI5AF btqIMcfk7M3TMx76L6adCBW4YVEGlEnxGHCaNMPklYxnRJuFa51T7xOOkG+3MSpsouhE 4Iuw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=f0admiXWKRoayf+ZUUoaw0/gDlQtXfjLqB69x3RLTvs=; b=iVuxg+zadBqULaPQlTEkbIFMTQrEQ/eVVVayjJYDPjsaspQ6HJX+2HuSP8jeyb1tj1 /eScOGjTSp5PW7xH8LGc68AVMpzHufAZRCyb9ER4sgCulOsOULzEuKhFWHSXV4vbolW1 +wgZnKEr8htgbKp5atUK6Jfcj8yFErKhtfSh4MY/TBX3x9Qxz6sVuRbnqpyzHJ0Xqknh +BjBwKHqj83v1O8kdTjBVVXBPwgJSbtgOCn5/ooreMRj2XKvUIsVfXfL9OM7OIgv7xro g1wu4TCKSCsa+WGzIYZJKwVzIJ3+VHGZc9zg96KkaMcXlvLb0pIzdDzaSmwKNXHFIAfv rWtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FtywWfZt; 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 w22-20020a63af16000000b0054ff40bf1ccsi3604141pge.702.2023.06.16.02.09.17; Fri, 16 Jun 2023 02:09:31 -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=FtywWfZt; 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 S245619AbjFPJE1 (ORCPT + 99 others); Fri, 16 Jun 2023 05:04:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244352AbjFPJDy (ORCPT ); Fri, 16 Jun 2023 05:03:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B73A54493 for ; Fri, 16 Jun 2023 02:02:07 -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 7E71262C11 for ; Fri, 16 Jun 2023 09:02:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6EF3C433C0; Fri, 16 Jun 2023 09:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686906122; bh=cVzo/h1du6EG71YMJA69ZOvL8XUo5XXroakRB2KzZho=; h=From:To:Cc:Subject:Date:From; b=FtywWfZtgsSj9FFvkPXXwo6WbvZLGQh+2L5ouZeJCIRq8qf+btEr6ccuQbacsOeo5 zwEcUnUrGyBg3M7mYLmj3cE9cC1xiuvjCZp7K09Tb3tPZ/LsFmp3t5T3SNEoGRhI4u A7Tv6H/7geI+qr66OvZ9gksTWXwg4/qycNf1TuY8IHG2a+GHYcrQBn6Yu7KYRicyuf svss8ubY8wrRBMqSn5QcK2POSanpEJmhtb3oE9N9i3FZAOi7EqUY+EcGNmBkB3ZfDs X6nfcGOd+NhgLFFkNEChAnaX2f7MdfxAX3OM/yXJOB+5EezGd6CHIao4CSb4XxqlZ+ PNkWceMMoDYXw== From: Arnd Bergmann To: Mark Brown Cc: Arnd Bergmann , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Ryan Lee , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] ASoC: max98388: fix unused function warnings Date: Fri, 16 Jun 2023 11:00:37 +0200 Message-Id: <20230616090156.2347850-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 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?1768849744882662361?= X-GMAIL-MSGID: =?utf-8?q?1768849744882662361?= From: Arnd Bergmann The PM functions are never referenced when CONFIG_PM_SLEEP is disabled: sound/soc/codecs/max98388.c:854:12: error: unused function 'max98388_suspend' [-Werror,-Wunused-function] static int max98388_suspend(struct device *dev) ^ sound/soc/codecs/max98388.c:864:12: error: unused function 'max98388_resume' [-Werror,-Wunused-function] static int max98388_resume(struct device *dev) Fix this by using the modern SYSTEM_SLEEP_PM_OPS() macro in place of the deprecated SET_SYSTEM_SLEEP_PM_OPS() version, and use pm_sleep_ptr() to hide the entire structure as well. On a related note, the of_match_ptr() and ACPI_PTR() macros have the same problem and would cause the device id table to be unused when the driver is built-in and the respective subsystems are disabled. This does not cause warnings unless -Wunused-const-variable is passed to the compiler, but it's better to just not use the macros at all here. Signed-off-by: Arnd Bergmann Acked-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested --- sound/soc/codecs/max98388.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/max98388.c b/sound/soc/codecs/max98388.c index 8062a71150074..3d03c4bac6c55 100644 --- a/sound/soc/codecs/max98388.c +++ b/sound/soc/codecs/max98388.c @@ -873,7 +873,7 @@ static int max98388_resume(struct device *dev) } static const struct dev_pm_ops max98388_pm = { - SET_SYSTEM_SLEEP_PM_OPS(max98388_suspend, max98388_resume) + SYSTEM_SLEEP_PM_OPS(max98388_suspend, max98388_resume) }; static const struct regmap_config max98388_regmap = { @@ -998,9 +998,9 @@ MODULE_DEVICE_TABLE(acpi, max98388_acpi_match); static struct i2c_driver max98388_i2c_driver = { .driver = { .name = "max98388", - .of_match_table = of_match_ptr(max98388_of_match), - .acpi_match_table = ACPI_PTR(max98388_acpi_match), - .pm = &max98388_pm, + .of_match_table = max98388_of_match, + .acpi_match_table = max98388_acpi_match, + .pm = pm_sleep_ptr(&max98388_pm), }, .probe = max98388_i2c_probe, .id_table = max98388_i2c_id, From patchwork Fri Jun 16 09:00:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108962 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1193270vqr; Fri, 16 Jun 2023 02:21:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5M2T5jr9+fqPf6PP008F5fTZZrLuxSFCUclFrnZ1fySjefAd12ZAW/yFhhBozOJnPdTZ9S X-Received: by 2002:a17:902:748c:b0:1ac:815e:320b with SMTP id h12-20020a170902748c00b001ac815e320bmr1272573pll.17.1686907261255; Fri, 16 Jun 2023 02:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686907261; cv=none; d=google.com; s=arc-20160816; b=WC20yoEVNcUZd2B0cp3jVGAhIePVrR6F5kO+Wu7ozFft+cID1QUJyU57ARYXUXxUNp 52tt2SEML6LLANiijrP1nDCAlhtCMxcuusUWXfWayYjRW13vPBNbiRZdWb+FVMrNj0dp 9FADxIC/ZTBLtYc+44LOONYfTINCrRoJGnbkTN0E0F975mYmtIzKVCbh/WecrmE9K4oU bx5tnUDsdM+5mVO1Jd0pKpisOlfioBTZTTPlwYUS5HwMbv7BhhltqXEvhH+KcEn3t8yS koHf0BZI+QK53ichYehA6GecI1CihvTugJWxKY03PKmzGIUmcqBW2goJiTj6X4EpCFJY XWvA== 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=4UJ0nGl4pUCOD9ku443NVrM2HltUbD7L7AByD++tvag=; b=jPo4wJqG2D6DCLgXdX9BiDAQfDk4DY0sCznUumnKr74ngPCWHxLZ+1GC8LD+56eqqc QZcq0STeD67JuA8JiY/qNpCbfnM9f772tnwK4s8dXsRASdTyqY/FSXUmvLUsByczZePW PWJBuxfBubl2nFWWEBBmaPchHqPXOHLZ7Kjj5fmjfEf8ff5nv5nyYmY6qdz61rzoPHEu nmOsRmgQdVVMN2NYVroSgG8x1NJ3HSVKwNLy/wpeZG13nQzW9hXaD+ho3DnLrknfiAom aw12X1cN12Vx2J62TlYGtvPF1SfufVVtzlC/nro1KgoxB8W/yDBz2IstKXjrOHV418HM dUfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="q/nhG7AO"; 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 x5-20020a170902ec8500b001ab19e023a1si15988425plg.375.2023.06.16.02.20.46; Fri, 16 Jun 2023 02:21: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="q/nhG7AO"; 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 S234252AbjFPJFl (ORCPT + 99 others); Fri, 16 Jun 2023 05:05:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241161AbjFPJEX (ORCPT ); Fri, 16 Jun 2023 05:04:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4204846AC for ; Fri, 16 Jun 2023 02:02:19 -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 CF85B60EA6 for ; Fri, 16 Jun 2023 09:02:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55DC8C433C0; Fri, 16 Jun 2023 09:02:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686906137; bh=UOnPoFg43i3UesyhFVozRmIc8vnbB70GQh4IzFCjtN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q/nhG7AOdYsI3nv+QMHa1sa79lU32ytFCuAbdWYzzYuo0eZvAqQqwJjHiYUk0p+x6 lJbLILzZUk+zlak4Hv/XANuqsfyEkHsj3WMQObqLLLFsRUiadkD63bjp0TRVslmGQ/ AhYVR87FEhBmKcXkTwLtddA+M8gGyIHtTFUGIlO/QiGJQ+Bj/gaDku/tSb6MKz2mao 5Yk3FQeLdKKMxKVGPv0o4CfrP3/U1lh/NPjRyzAvgO+GcO5uazcdgJaJRpuX0Mpzwj MZvk4kxH4F5HRJREvI71UF7RixnpxI8z8cURMJhlJ7U0sfhgzyUc/UGPvCfhOikrTS /syyNBHkwic9g== 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 2/4] ASoC: loongson: fix unused PM function warning Date: Fri, 16 Jun 2023 11:00:38 +0200 Message-Id: <20230616090156.2347850-2-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=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1768850468304516766?= X-GMAIL-MSGID: =?utf-8?q?1768850468304516766?= From: Arnd Bergmann Build testing without CONFIG_PM_SLEEP causes a warning: sound/soc/loongson/loongson_i2s.c:246:12: error: unused function 'i2s_suspend' [-Werror,-Wunused-function] sound/soc/loongson/loongson_i2s.c:255:12: error: unused function 'i2s_resume' [-Werror,-Wunused-function] Use the modern SYSTEM_SLEEP_PM_OPS() instead of the old one to avoid this. 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 35d34568be79e..f73b6d6f16c23 100644 --- a/sound/soc/loongson/loongson_i2s.c +++ b/sound/soc/loongson/loongson_i2s.c @@ -265,5 +265,5 @@ static int i2s_resume(struct device *dev) } const struct dev_pm_ops loongson_i2s_pm = { - SET_SYSTEM_SLEEP_PM_OPS(i2s_suspend, i2s_resume) + SYSTEM_SLEEP_PM_OPS(i2s_suspend, i2s_resume) }; From patchwork Fri Jun 16 09:00:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108956 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1189016vqr; Fri, 16 Jun 2023 02:11:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Tem70CR3iQjNbaaDZlq7dwUA8HCKL3UO8nODDM0rJcJNw/CW7RODD25zb/cc+md/HCMii X-Received: by 2002:a17:90a:2d8f:b0:255:2dde:17cc with SMTP id p15-20020a17090a2d8f00b002552dde17ccmr1117791pjd.47.1686906663649; Fri, 16 Jun 2023 02:11:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686906663; cv=none; d=google.com; s=arc-20160816; b=oV/kGrkbQhS8OlWXvgqdgzLljmCdq1IA3ym2gjLeB5wn57o5YJJgJSEu8w8shLG7/g qVaSbl3644hWHYIjNdEHXJSh4v72JA4+MjVo33yWXzNVyTmSDZtupflWc45GKTUKJZ5U DF/OM7T0bQp0KoNQQNFpolBdUltETSUHiaJbcJ48Q4WXruAaZYadz8XyRKjC+npsU9Wd qxSxeRXHFOKYWs2zlEhJt1AbrnDzjxr8F59fyfMQUBBszHEclBaZDbkk0prRhrU+gYiS w7o/ulkua0ZKSeVv3+9aqZ1eSPyT8xRgXcp7aNrpXlsTw1DzlzSktc9hpP91pvTxd0b7 nz5A== 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=/PGR4q0st1pMt4amQfK45ClF4uN2eaPHu5aabcoXQK4=; b=HuI+bPQ+XqIQVjgncw7bV7tBxYTEYJiEpmnJJ3d3SXMHowPR9CCaFtY2kN0FGwPVg2 YhQKg5ZJVbd/HfqQEMDqVptkD9NyMo/Wf54AbOqzYtUEYZIlzDvBTMVGAQ7k7FEdVcHI HYKHYv++aEdDlTPcKSp9US9XyMK/F6sBu3RoeZzxrzgVkbOJiEBt0E/jtoVtk6fII44Z oQLQ+MaDNUc4UthSbNHAXfFJp8bCyQyMYemQxG7LpueUuy5LMP5mXLsNtowQVrgBL0/a yyV/SklhUuAdsdi5ed44E5ltvxOkcKvu0zrna0zlnCkggYmjVk7hg0Qbg1pCAG5dVW0z v0Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cb5Wuf4p; 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 z11-20020a6552cb000000b005349009f1desi11212516pgp.354.2023.06.16.02.10.50; Fri, 16 Jun 2023 02:11:03 -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=cb5Wuf4p; 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 S244923AbjFPJFo (ORCPT + 99 others); Fri, 16 Jun 2023 05:05:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343989AbjFPJE7 (ORCPT ); Fri, 16 Jun 2023 05:04:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 213FE3586 for ; Fri, 16 Jun 2023 02:02:39 -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 DE1CA60C5E for ; Fri, 16 Jun 2023 09:02:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D68AC433C8; Fri, 16 Jun 2023 09:02:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686906146; bh=liQAyMeBABb3jk++u+GcttTTYo2zoQN5sl4L8LiR7W4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cb5Wuf4p9yI0VjVK/YaONawmhznz+7Rimp+gudyxGyAWeWkQKoIV3Ip6CHkjYm6ci SoqOhzy9/0kwQikK94Y/NhXGchjI9D/CADjiCK4fSaFkOj2fPubcRZfFu8OFPfsnGE 5OVYVWWXHOJJZOI1rHnQjt4fi4+ddvzhqBadP2kjC8nqcZ201XiMIscymtApauolaI 930BQ2v4pdm5L8ahRo4W3Kn8zGIpHuRnzdC58fXQopEwSaxmdvNLQ2UeFIib7szHTy 6fNdEImZcNX8bIvGhBYV6k4ndgW3kayd+X8OmA7gKNjwRIVDL54P5IDvPfQpSStiDa uoz1NcWQUx8mg== 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 3/4] ASoC: loongson: add PCI dependency Date: Fri, 16 Jun 2023 11:00:39 +0200 Message-Id: <20230616090156.2347850-3-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?1768849841584847645?= X-GMAIL-MSGID: =?utf-8?q?1768849841584847645?= From: Arnd Bergmann The new driver fails to build when PCI is disabled: WARNING: unmet direct dependencies detected for SND_SOC_LOONGSON_I2S_PCI Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && (LOONGARCH || COMPILE_TEST [=y]) && PCI [=n] Selected by [y]: - SND_SOC_LOONGSON_CARD [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && (LOONGARCH || COMPILE_TEST [=y]) sound/soc/loongson/loongson_i2s_pci.c:167:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] module_pci_driver(loongson_i2s_driver); Add the appropriate Kconfig dependency. 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/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/loongson/Kconfig b/sound/soc/loongson/Kconfig index c175f9de19a85..b8d7e2bade246 100644 --- a/sound/soc/loongson/Kconfig +++ b/sound/soc/loongson/Kconfig @@ -16,6 +16,7 @@ config SND_SOC_LOONGSON_I2S_PCI config SND_SOC_LOONGSON_CARD tristate "Loongson Sound Card Driver" select SND_SOC_LOONGSON_I2S_PCI + depends on PCI help Say Y or M if you want to add support for SoC audio using loongson I2S controller. 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);