From: "Mark Pearson" <mpearson-lenovo@squebb.ca>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
"Derek J . Clark" <derekjohn.clark@gmail.com>,
"Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, "Peng Fan" <peng.fan@nxp.com>,
"platform-driver-x86@vger.kernel.org"
<platform-driver-x86@vger.kernel.org>
Subject: Re: [PATCH] platform/x86: yogabook: use assign_bit()/change_bit() where applicable
Date: Tue, 22 Sep 2026 14:17:02 -0400 [thread overview]
Message-ID: <05c50d6a-e3fa-4ab5-afc4-7c13a792b2ef@app.fastmail.com> (raw)
In-Reply-To: <20260919130829.3041568-1-peng.fan@oss.nxp.com>
On Sat, Sep 19, 2026, at 9:08 AM, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> Convert open-coded if/else with set_bit/clear_bit to the assign_bit and
> change_bit APIs.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> drivers/platform/x86/lenovo/yogabook.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/platform/x86/lenovo/yogabook.c
> b/drivers/platform/x86/lenovo/yogabook.c
> index 1a4b2ab1f35d..f4c99508c6e7 100644
> --- a/drivers/platform/x86/lenovo/yogabook.c
> +++ b/drivers/platform/x86/lenovo/yogabook.c
> @@ -120,10 +120,7 @@ static void yogabook_toggle_digitizer_mode(struct
> yogabook_data *data)
> if (test_bit(YB_SUSPENDED, &data->flags))
> return;
>
> - if (test_bit(YB_DIGITIZER_MODE, &data->flags))
> - clear_bit(YB_DIGITIZER_MODE, &data->flags);
> - else
> - set_bit(YB_DIGITIZER_MODE, &data->flags);
> + change_bit(YB_DIGITIZER_MODE, &data->flags);
>
> /*
> * We are called from the ACPI core and the driver [un]binding which
> is
> @@ -136,10 +133,8 @@ static irqreturn_t yogabook_backside_hall_irq(int
> irq, void *_data)
> {
> struct yogabook_data *data = _data;
>
> - if (gpiod_get_value(data->backside_hall_gpio))
> - set_bit(YB_TABLET_MODE, &data->flags);
> - else
> - clear_bit(YB_TABLET_MODE, &data->flags);
> + assign_bit(YB_TABLET_MODE, &data->flags,
> + gpiod_get_value(data->backside_hall_gpio));
>
> schedule_work(&data->work);
>
> --
> 2.51.0
Looks good to me.
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Mark
prev parent reply other threads:[~2026-09-22 18:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 13:08 Peng Fan (OSS)
2026-09-22 18:17 ` Mark Pearson [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=05c50d6a-e3fa-4ab5-afc4-7c13a792b2ef@app.fastmail.com \
--to=mpearson-lenovo@squebb.ca \
--cc=derekjohn.clark@gmail.com \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=peng.fan@oss.nxp.com \
--cc=platform-driver-x86@vger.kernel.org \
/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
all inboxes | Powered by JetHome®