From: sashiko-bot@kernel.org
To: "Triet Hoang" <triet.hoang.dev@gmail.com>
Cc: linux-watchdog@vger.kernel.org
Subject: Re: [PATCH 8/8] watchdog: stmp3xxx_rtc_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Date: Wed, 26 Aug 2026 06:19:49 +0000 [thread overview]
Message-ID: <20260826061949.C0D7C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260826060839.203297-9-triet.hoang.dev@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Incorrect wrapper macro used for the dev_pm_ops structure pointer.
--
commit 1f11ea674c46c75875588fac7d892578dd01a7b5
Author: Triet Hoang <triet.hoang.dev@gmail.com>
watchdog: stmp3xxx_rtc_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
This commit converts the deprecated SIMPLE_DEV_PM_OPS macro to
DEFINE_SIMPLE_DEV_PM_OPS and wraps the pm_ops pointer, which allows dropping
the maybe_unused annotations from the suspend and resume callbacks.
> diff --git a/drivers/watchdog/stmp3xxx_rtc_wdt.c b/drivers/watchdog/stmp3xxx_rtc_wdt.c
> --- a/drivers/watchdog/stmp3xxx_rtc_wdt.c
> +++ b/drivers/watchdog/stmp3xxx_rtc_wdt.c
[ ... ]
> -static SIMPLE_DEV_PM_OPS(stmp3xxx_wdt_pm_ops,
> +static DEFINE_SIMPLE_DEV_PM_OPS(stmp3xxx_wdt_pm_ops,
> stmp3xxx_wdt_suspend, stmp3xxx_wdt_resume);
>
> static struct platform_driver stmp3xxx_wdt_driver = {
> .driver = {
> .name = "stmp3xxx_rtc_wdt",
> - .pm = &stmp3xxx_wdt_pm_ops,
> + .pm = pm_sleep_ptr(&stmp3xxx_wdt_pm_ops),
[Severity: Low]
Is it correct to use pm_sleep_ptr() here instead of pm_ptr() for the
dev_pm_ops structure pointer?
According to the power management callback conditional compilation
guidelines, pm_ptr() should be used for dev_pm_ops structure pointers,
while pm_sleep_ptr() is intended for the specific sleep callbacks
(like suspend, resume, freeze, thaw, etc.).
By using pm_sleep_ptr() on the structure pointer itself, it will evaluate
to NULL when CONFIG_PM_SLEEP is disabled. If any runtime PM callbacks were
later added to this dev_pm_ops structure, they would be silently compiled
out even if CONFIG_PM is enabled.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260826060839.203297-1-triet.hoang.dev@gmail.com?part=8
prev parent reply other threads:[~2026-08-26 6:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-26 6:08 [PATCH 0/8] watchdog: Convert drivers to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
2026-08-26 6:08 ` [PATCH 1/8] watchdog: cadence_wdt: Convert " Triet Hoang
2026-08-26 6:08 ` [PATCH 2/8] watchdog: da9062: " Triet Hoang
2026-08-27 7:42 ` Tzung-Bi Shih
2026-08-27 13:25 ` Guenter Roeck
2026-08-26 6:08 ` [PATCH 3/8] watchdog: keembay_wdt: " Triet Hoang
2026-08-26 6:17 ` sashiko-bot
2026-08-26 21:38 ` Guenter Roeck
2026-08-26 6:08 ` [PATCH 4/8] watchdog: msc313e_wdt: " Triet Hoang
2026-08-26 6:20 ` sashiko-bot
2026-08-27 4:53 ` Tzung-Bi Shih
2026-08-26 6:08 ` [PATCH 5/8] watchdog: of_xilinx_wdt: " Triet Hoang
2026-08-26 6:08 ` [PATCH 6/8] watchdog: pm8916_wdt: " Triet Hoang
2026-08-26 6:08 ` [PATCH 7/8] watchdog: sp805_wdt: " Triet Hoang
2026-08-26 6:18 ` sashiko-bot
2026-08-26 6:08 ` [PATCH 8/8] watchdog: stmp3xxx_rtc_wdt: " Triet Hoang
2026-08-26 6:19 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260826061949.C0D7C1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=triet.hoang.dev@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.