* [PATCH v1 1/1] intel_idle: Replace min_t() with the better alternatives
@ 2026-08-13 8:17 Andy Shevchenko
0 siblings, 0 replies; only message in thread
From: Andy Shevchenko @ 2026-08-13 8:17 UTC (permalink / raw)
To: Rafael J. Wysocki, linux-pm, linux-kernel
Cc: Rafael J. Wysocki, Artem Bityutskiy, Len Brown, Andy Shevchenko
Almost always use of min_t() is wrong. Replace it with min() and min3() as all
types are int and there is no point to use typed variant of it.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/idle/intel_idle.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index b12b4f62752a..699665f24ecd 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -1792,9 +1792,7 @@ static bool __init intel_idle_cst_usable(void)
{
int cstate, limit;
- limit = min_t(int, min_t(int, CPUIDLE_STATE_MAX, max_cstate + 1),
- acpi_state_table.count);
-
+ limit = min3(CPUIDLE_STATE_MAX, max_cstate + 1, acpi_state_table.count);
for (cstate = 1; cstate < limit; cstate++) {
struct acpi_processor_cx *cx = &acpi_state_table.states[cstate];
@@ -1938,7 +1936,7 @@ static void __init intel_idle_init_cstates_acpi_lpi(struct cpuidle_driver *drv)
static void __init intel_idle_init_cstates_acpi_cst(struct cpuidle_driver *drv)
{
- int cstate, limit = min_t(int, CPUIDLE_STATE_MAX, acpi_state_table.count);
+ int cstate, limit = min(CPUIDLE_STATE_MAX, acpi_state_table.count);
/*
* If limit > 0, intel_idle_cst_usable() has returned 'true', so all of
@@ -2018,7 +2016,7 @@ static bool __init intel_idle_off_by_default_lpi(unsigned int flags, u32 mwait_h
static bool __init intel_idle_off_by_default_cst(unsigned int flags, u32 mwait_hint)
{
- int cstate, limit = min_t(int, CPUIDLE_STATE_MAX, acpi_state_table.count);
+ int cstate, limit = min(CPUIDLE_STATE_MAX, acpi_state_table.count);
/*
* If limit > 0, intel_idle_cst_usable() has returned 'true', so all of
--
2.50.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-13 8:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-13 8:17 [PATCH v1 1/1] intel_idle: Replace min_t() with the better alternatives Andy Shevchenko
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®