diff options
| author | Olivier Certner <olce@FreeBSD.org> | 2026-06-04 11:17:32 +0000 |
|---|---|---|
| committer | Olivier Certner <olce@FreeBSD.org> | 2026-06-22 21:40:12 +0000 |
| commit | f7eff1236d5fc0895c38dac4bb7f6b8d0eedbec3 (patch) | |
| tree | 11da4f241c53ee6546a054b183f160216d79f476 | |
| parent | a12d069ef37fd60538b6f46372b194e6cf117250 (diff) | |
power: Make POWER_STYPE_COUNT equal to POWER_STYPE_UNKNOWN
This avoids having to list POWER_STYPE_COUNT, which is semantically not
an allowed value, in 'switch' statements along with POWER_STYPE_UNKNOWN.
No functional change (intended).
Reviewed by: obiwac
Event: Halifax Hackathon 202606
Sponsored by: The FreeBSD Foundation
Pull Request: https://github.com/OlCe2/freebsd-src/pull/8
| -rw-r--r-- | sys/dev/acpica/acpi.c | 2 | ||||
| -rw-r--r-- | sys/sys/power.h | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 48d868b6ac00..9a6dae2dfecf 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -825,7 +825,6 @@ acpi_stype_to_sstate(const struct acpi_softc *const sc, case POWER_STYPE_POWEROFF: return (ACPI_STATE_S5); case POWER_STYPE_SUSPEND_TO_IDLE: - case POWER_STYPE_COUNT: case POWER_STYPE_UNKNOWN: return (ACPI_STATE_UNKNOWN); } @@ -3734,7 +3733,6 @@ acpi_EnterSleepState(struct acpi_softc *sc, enum power_stype stype) #endif case POWER_STYPE_AWAKE: case POWER_STYPE_POWEROFF: - case POWER_STYPE_COUNT: case POWER_STYPE_UNKNOWN: __unreachable(); } diff --git a/sys/sys/power.h b/sys/sys/power.h index c9439d89db20..49bf36c3efb3 100644 --- a/sys/sys/power.h +++ b/sys/sys/power.h @@ -81,8 +81,8 @@ enum power_stype { POWER_STYPE_SUSPEND_TO_IDLE, POWER_STYPE_FW_HIBERNATE, POWER_STYPE_POWEROFF, - POWER_STYPE_COUNT, POWER_STYPE_UNKNOWN, + POWER_STYPE_COUNT = POWER_STYPE_UNKNOWN, }; /* XXX NUL terminator is included in this number */ |
