git: f7eff1236d5f - main - power: Make POWER_STYPE_COUNT equal to POWER_STYPE_UNKNOWN

From: Olivier Certner <olce_at_FreeBSD.org>
Date: Mon, 22 Jun 2026 21:42:36 UTC
The branch main has been updated by olce:

URL: https://cgit.FreeBSD.org/src/commit/?id=f7eff1236d5fc0895c38dac4bb7f6b8d0eedbec3

commit f7eff1236d5fc0895c38dac4bb7f6b8d0eedbec3
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2026-06-04 11:17:32 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2026-06-22 21:40:12 +0000

    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
---
 sys/dev/acpica/acpi.c | 2 --
 sys/sys/power.h       | 2 +-
 2 files changed, 1 insertion(+), 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 */