From: Gergo Koteles <soyer@irl.hu>
To: "Barnabás Pőcze" <pobrn@protonmail.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
"Len Brown" <lenb@kernel.org>,
"Ike Panhc" <ike.pan@canonical.com>,
"Hans de Goede" <hdegoede@redhat.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Henrique de Moraes Holschuh" <hmh@hmh.eng.br>,
linux-acpi@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/3] ACPI: platform-profile: add platform_profile_cycle()
Date: Sat, 06 Apr 2024 02:00:02 +0200 [thread overview]
Message-ID: <0d78bced4d012fc30f0ad70091559d04fa7b13b9.camel@irl.hu> (raw)
In-Reply-To: <g_07w0jkBp9IeComzpK26YHPB1QZNjN_amEZ2bTG6xrOMMltvaav0Rd9Oh4a0nlzPsW2guvvUHkNQrfzSdFGbJhKDB0SHgUJB4belZNrapI=@protonmail.com>
Hi Barnabás,
On Fri, 2024-04-05 at 16:34 +0000, Barnabás Pőcze wrote:
> > + next = ffs(cur_profile->choices[0] >> (profile + 1)) + profile;
> > +
> > + /* current profile is the highest, select the lowest */
> > + if (next == profile)
> > + next = ffs(cur_profile->choices[0]) - 1;
>
> I think you can use `find_next_bit()` or similar instead.
>
Thanks, it looks much better with find_next_bit_wrap.
>
Best regards,
Gergo
next prev parent reply other threads:[~2024-04-06 0:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-05 3:05 [PATCH v4 0/3] switch platform profiles with Lenovo laptops Gergo Koteles
2024-04-05 3:05 ` [PATCH v4 1/3] ACPI: platform-profile: add platform_profile_cycle() Gergo Koteles
2024-04-05 6:48 ` Daniel Lezcano
2024-04-05 14:48 ` Gergo Koteles
2024-04-05 16:34 ` Barnabás Pőcze
2024-04-06 0:00 ` Gergo Koteles [this message]
2024-04-05 3:05 ` [PATCH v4 2/3] platform/x86: ideapad-laptop: switch platform profiles using thermal management key Gergo Koteles
2024-04-05 3:05 ` [PATCH v4 3/3] platform/x86: thinkpad_acpi: use platform_profile_cycle() Gergo Koteles
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=0d78bced4d012fc30f0ad70091559d04fa7b13b9.camel@irl.hu \
--to=soyer@irl.hu \
--cc=hdegoede@redhat.com \
--cc=hmh@hmh.eng.br \
--cc=ibm-acpi-devel@lists.sourceforge.net \
--cc=ike.pan@canonical.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=pobrn@protonmail.com \
--cc=rafael@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).