Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Triet Hoang" <triet.hoang.dev@gmail.com>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH] input: misc: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Date: Fri, 21 Aug 2026 02:50:21 +0000	[thread overview]
Message-ID: <20260821025021.9F9891F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260821024215.55188-1-triet.hoang.dev@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The patch breaks the build when `CONFIG_PM` is disabled because `pm80x_dev_suspend` and `pm80x_dev_resume` become undeclared identifiers.
--

--- Patch [1]: [PATCH] input: misc: Convert to DEFINE_SIMPLE_DEV_PM_OPS() ---
commit 831b6a38a335cea06b4312be1068bf63ef9bd3c9
Author: Triet Hoang <triet.hoang.dev@gmail.com>

input: misc: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

Convert deprecated SIMPLE_DEV_PM_OPS to DEFINE_SIMPLE_DEV_PM_OPS and
pm_sleep_ptr(). This drops the __maybe_unused annotations from the resume
callbacks and reduces kernel size when PM is disabled.

> diff --git a/drivers/input/misc/88pm80x_onkey.c b/drivers/input/misc/88pm80x_onkey.c
> index fee28e537898a..d4f344e2bf5c4 100644
> --- a/drivers/input/misc/88pm80x_onkey.c
> +++ b/drivers/input/misc/88pm80x_onkey.c
[ ... ]
> @@ -47,7 +47,7 @@ static irqreturn_t pm80x_onkey_handler(int irq, void *data)
>  	return IRQ_HANDLED;
>  }
>  
> -static SIMPLE_DEV_PM_OPS(pm80x_onkey_pm_ops, pm80x_dev_suspend,
> +static DEFINE_SIMPLE_DEV_PM_OPS(pm80x_onkey_pm_ops, pm80x_dev_suspend,
>  			 pm80x_dev_resume);

[Severity: Low]
Does this break the build when CONFIG_PM is disabled?

Unlike SIMPLE_DEV_PM_OPS, DEFINE_SIMPLE_DEV_PM_OPS uses pm_sleep_ptr() which
evaluates the C ternary operator with IS_ENABLED(). This means the compiler
still parses the arguments and requires them to be declared, even if they are
ultimately discarded.

Looking at include/linux/mfd/88pm80x.h, pm80x_dev_suspend and pm80x_dev_resume
are wrapped in #ifdef CONFIG_PM without providing empty fallback stubs:

#ifdef CONFIG_PM
static inline int pm80x_dev_suspend(struct device *dev)
{
...

Will this result in undeclared identifier compilation errors when building with
CONFIG_PM=n?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260821024215.55188-1-triet.hoang.dev@gmail.com?part=1

  reply	other threads:[~2026-08-21  2:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21  2:42 [PATCH] input: misc: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
2026-08-21  2:50 ` sashiko-bot [this message]
2026-08-21  4:15   ` [PATCH v2] " Triet Hoang
2026-08-21  4:25     ` sashiko-bot

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=20260821025021.9F9891F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox