Skip to content

Commit 9cf9f2e

Browse files
committed
cpuidle: Change :enter_dead() driver callback return type to void
After a previous change, cpuidle_play_dead(), which is the only caller of idle state :enter_dead() callbacks, ignores their return values, so they may as well be void. Suggested-by: Peter Zijlstra <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Gautham R. Shenoy <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent f65ee09 commit 9cf9f2e

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

drivers/acpi/processor_idle.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ static void __cpuidle acpi_idle_do_entry(struct acpi_processor_cx *cx)
578578
* @dev: the target CPU
579579
* @index: the index of suggested state
580580
*/
581-
static int acpi_idle_play_dead(struct cpuidle_device *dev, int index)
581+
static void acpi_idle_play_dead(struct cpuidle_device *dev, int index)
582582
{
583583
struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
584584

@@ -591,11 +591,8 @@ static int acpi_idle_play_dead(struct cpuidle_device *dev, int index)
591591
else if (cx->entry_method == ACPI_CSTATE_SYSTEMIO) {
592592
io_idle(cx->address);
593593
} else
594-
return -ENODEV;
594+
return;
595595
}
596-
597-
/* Never reached */
598-
return 0;
599596
}
600597

601598
static __always_inline bool acpi_idle_fallback_to_c1(struct acpi_processor *pr)

include/linux/cpuidle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct cpuidle_state {
6161
struct cpuidle_driver *drv,
6262
int index);
6363

64-
int (*enter_dead) (struct cpuidle_device *dev, int index);
64+
void (*enter_dead) (struct cpuidle_device *dev, int index);
6565

6666
/*
6767
* CPUs execute ->enter_s2idle with the local tick or entire timekeeping

0 commit comments

Comments
 (0)