Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30465930rwd; Thu, 6 Jul 2023 06:24:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlEWAqPgatGdC4puRVwRtOvONDcpFCbFThX0Csx7LmZXCMERqga1tXkGaY8EEONv5GCuxF59 X-Received: by 2002:a05:6a21:33a8:b0:10f:9bea:5a61 with SMTP id yy40-20020a056a2133a800b0010f9bea5a61mr2509916pzb.2.1688649860013; Thu, 06 Jul 2023 06:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688649859; cv=none; d=google.com; s=arc-20160816; b=JTExr84be7b0i3zhmr8zgCgivNj8143wKQdImEB6LXlgLE5zyKGuWHa0XZ8wQbEhaS GBF4hx0w8pUrFxaMsmtuWar/4mGXItY7+m+DeMCL9wqS/FMA2GwcI201NuxyEjTIoEam YeQDPQ1N2I9uXlAHp80wb7TETZ8DSelzswc1vCOq7tTJHwdTQn/edfJiliiqpNQKkdoM RrbFAC+d4OvK9T0BJpCjJEyO1s7ZeMvDLu6vQW+qQcjLF6G3W4A/WTbwBJes/G/7ohbu l8Bw5a8k+FHc3Sm24AepigH1WPwen7g3zMIf/Mk8ebfysrbZb/8yKf+8OQqfO7m2YuDR zM8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=Cgf43GhwD7b0csu2mfmmYfiuYsfy6eO/8hxUqbvqUJ4=; fh=SNnO2/sN5IKh/B3nGMnDv+TiCvTytWUfOne11FyGsFI=; b=YI/9bz4gpEWM4W+m802c1Jzd3CziuAQmt452uYMz2+fB8mQsg+nhY11gy2RlKIulbj CC5LWh1dx34ZAe0XfNfb0rCuHTnviO9536yGbdcdtOFZ+IhJcqHgGhB9slTAEofx+Res 9RVYUdTtEtk3PYuB29IGBF8OqjqpgxV6njGRLFbY6kr94s9OWcVZZEEkri47kv6Bm/+l aYZYbXdEQr64Dh1bCM8IsW/RRr5MzJSxMLPiuX6ofb5yypwd1E2f9+QVT5mdkHnW28oC g7jSrXt3RLX516qP9r/kDWtrIwxErxZvhAGK/mzhhQf8sz/CV6kuubkyl3Lttch9zBNm Y8mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=cMZFJB67; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c5-20020a6566c5000000b0055731f11410si1355574pgw.470.2023.07.06.06.24.05; Thu, 06 Jul 2023 06:24:19 -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=@gmail.com header.s=20221208 header.b=cMZFJB67; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231532AbjGFNSL (ORCPT + 99 others); Thu, 6 Jul 2023 09:18:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbjGFNSK (ORCPT ); Thu, 6 Jul 2023 09:18:10 -0400 Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3708B1992; Thu, 6 Jul 2023 06:18:09 -0700 (PDT) Received: by mail-yb1-xb32.google.com with SMTP id 3f1490d57ef6-c5c8d00ced3so693272276.2; Thu, 06 Jul 2023 06:18:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688649488; x=1691241488; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=Cgf43GhwD7b0csu2mfmmYfiuYsfy6eO/8hxUqbvqUJ4=; b=cMZFJB67wJDTRGG5QdoThR4MqF/I7e2w3zLRKyOAfDmVQw2liAOGwy7h3lQxm38tK1 ZvcySuBmyORycZYLesYh74Pk/CBOm8MOKYAnfHtn+OXbv16l7fJJ2HVqM77NjVEnUa4m QfxqP1Jr/Cr7flT7cK8S6Dhfv9bIpzqCyKtZ4vUrkIFI1u6mZI7nriFRZklMHmo/kcAD 28evqx94OXRXSweCYO/tIZLPugWilFzmXBQuTo3F4wj4wp72HQGFDx6yQcNDSo5Y1HEw ALCEZ6BafX5qvtdAFPv5RItZ2MEakqG99qXbNy7/CNSPS1f5NX1oBj3FTKCr4Fsgn2au P31w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688649488; x=1691241488; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Cgf43GhwD7b0csu2mfmmYfiuYsfy6eO/8hxUqbvqUJ4=; b=D5sZkS9yH04astUAfeE1p1GgT/kVM0VKWA2LS2hIF7MYHX4m5ZK2N1Q3JIZsJeXQtS o9ayqQPQztMZDAgUA+Y3uDgyeD6d0fzu1x2+LNVSeQi8ft4tTwJuQ1z35DtFBtwhbRHY I39UIt3+MN3t6fE6u0WOE/lvSWr5GpCdUAtt90OfpIrL1dhq00gKdHRQXhkZ+QYEFt+S PgkMYlBe7CAz+FAB+NDsNJM7v88X/uiL0gn6YTGbvySH7ZCwrCReUkE4w7mmWX4vUsDo 74EnNftwlqdwWLKDFxXJFfPLPlnxxJqh0BYIBSleqwogLoTpiwxcZZ54pP5wY1D2Vg71 lRnw== X-Gm-Message-State: ABy/qLY7y+FixeIAyA39ElXUdRup5gsnzjPMO+9N+4a/PjzMMqPAuGZf lqDyUqeu8nt316G1Gp5is+N/z3l57zg= X-Received: by 2002:a25:b7ca:0:b0:bca:7da8:e37c with SMTP id u10-20020a25b7ca000000b00bca7da8e37cmr1768953ybj.15.1688649488224; Thu, 06 Jul 2023 06:18:08 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id b8-20020a5b0088000000b00c6135ffd2fcsm308177ybp.15.2023.07.06.06.18.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Jul 2023 06:18:07 -0700 (PDT) Sender: Guenter Roeck Message-ID: <02b9ec14-bf69-ce61-4bd5-cac05563b855@roeck-us.net> Date: Thu, 6 Jul 2023 06:18:03 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] watchdog: starfive: Remove #ifdef guards for PM related functions Content-Language: en-US To: Paul Cercueil , Xingyu Wu , Samin Guo , Wim Van Sebroeck Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230706082928.10869-1-paul@crapouillou.net> From: Guenter Roeck In-Reply-To: <20230706082928.10869-1-paul@crapouillou.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 On 7/6/23 01:29, Paul Cercueil wrote: > Use the new PM macros for the suspend and resume functions to be > automatically dropped by the compiler when CONFIG_PM or > CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. > > This has the advantage of always compiling these functions in, > independently of any Kconfig option. Thanks to that, bugs and other > regressions are subsequently easier to catch. > > Signed-off-by: Paul Cercueil Reviewed-by: Guenter Roeck > --- > drivers/watchdog/starfive-wdt.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/drivers/watchdog/starfive-wdt.c b/drivers/watchdog/starfive-wdt.c > index 8058fca4d05d..7c8a1c5e75be 100644 > --- a/drivers/watchdog/starfive-wdt.c > +++ b/drivers/watchdog/starfive-wdt.c > @@ -526,7 +526,6 @@ static void starfive_wdt_shutdown(struct platform_device *pdev) > starfive_wdt_pm_stop(&wdt->wdd); > } > > -#ifdef CONFIG_PM_SLEEP > static int starfive_wdt_suspend(struct device *dev) > { > struct starfive_wdt *wdt = dev_get_drvdata(dev); > @@ -556,9 +555,7 @@ static int starfive_wdt_resume(struct device *dev) > > return starfive_wdt_start(wdt); > } > -#endif /* CONFIG_PM_SLEEP */ > > -#ifdef CONFIG_PM > static int starfive_wdt_runtime_suspend(struct device *dev) > { > struct starfive_wdt *wdt = dev_get_drvdata(dev); > @@ -574,11 +571,10 @@ static int starfive_wdt_runtime_resume(struct device *dev) > > return starfive_wdt_enable_clock(wdt); > } > -#endif /* CONFIG_PM */ > > static const struct dev_pm_ops starfive_wdt_pm_ops = { > - SET_RUNTIME_PM_OPS(starfive_wdt_runtime_suspend, starfive_wdt_runtime_resume, NULL) > - SET_SYSTEM_SLEEP_PM_OPS(starfive_wdt_suspend, starfive_wdt_resume) > + RUNTIME_PM_OPS(starfive_wdt_runtime_suspend, starfive_wdt_runtime_resume, NULL) > + SYSTEM_SLEEP_PM_OPS(starfive_wdt_suspend, starfive_wdt_resume) > }; > > static const struct of_device_id starfive_wdt_match[] = { > @@ -594,7 +590,7 @@ static struct platform_driver starfive_wdt_driver = { > .shutdown = starfive_wdt_shutdown, > .driver = { > .name = "starfive-wdt", > - .pm = &starfive_wdt_pm_ops, > + .pm = pm_ptr(&starfive_wdt_pm_ops), > .of_match_table = starfive_wdt_match, > }, > };