Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2329887rwd; Fri, 16 Jun 2023 02:26:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5hAgipSYq9Anncp/02OVZPB4uJTyyoQ+/v9klOEUg5+OsIpd0dPKmgMccdIamzCYYSJBMU X-Received: by 2002:a05:6830:1dbc:b0:6ad:e7dc:851d with SMTP id z28-20020a0568301dbc00b006ade7dc851dmr1627369oti.33.1686907569760; Fri, 16 Jun 2023 02:26:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686907569; cv=none; d=google.com; s=arc-20160816; b=ylDVXz9PV7bSpZ9uPH9xgvge2cK4I+d4kBqEsyKUx89vHMn64FLQQADL6MKjqTsB5i bobyM7YFks8UVenXAzB13GYgcoYixpCwvmb3rh6e/FDWQaBr0atm1fPI5wSIl63P/Nzb +ph1SHwJPC/IYGclpRNJvUSJma20VzignWMtksNQ3CiDrF1gj4XmWcJtIbIGWErsfp+f BaDjr+CcJejNeNR64g+OUNvo2o2ZPnuWPZo9gLWNcX7BUIXT8HVOVNNoRYMPKLldj0Gg I9eOEx47xcA5kJgnvT+QZPoz8mo+xgZi/vVMj7UXfZPmtDBFnpBDSisZJeRvv+Op17Fs nwFg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b7-20020a656687000000b00544c0bf5ffesi14440812pgw.606.2023.06.16.02.25.56; Fri, 16 Jun 2023 02:26:09 -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 S245370AbjFPJE1 (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 Content-Transfer-Encoding: 8bit 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 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 --- 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, -- 2.39.2