The branch main has been updated by olce:

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

commit 6cce86c9bcd9656af6d3f5fddd600b40a3ab127c
Author:     Olivier Certner <[email protected]>
AuthorDate: 2026-06-04 10:15:37 +0000
Commit:     Olivier Certner <[email protected]>
CommitDate: 2026-06-22 21:40:13 +0000

    acpi: Sleep/wake event handlers: Expose first argument's true type
    
    This is for clarification and to slightly simplify code.
    
    At present, the EVENTHANDLER(9) subsystem does not check that the first
    argument to the event handler, registered via EVENTHANDLER_REGISTER(),
    is of the right type with respect to the type declaration passed to
    EVENTHANDLER_DECLARE(), so in that infrastructure no additional safety
    is gained by this change.
    
    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 | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 4af65f07aa8e..1e21d4572fac 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -185,10 +185,10 @@ static int        acpi_wake_prep_walk(struct acpi_softc 
*sc, enum power_stype stype);
 static int     acpi_wake_sysctl_walk(device_t dev);
 static int     acpi_wake_set_sysctl(SYSCTL_HANDLER_ARGS);
 static int     acpi_supported_sleep_state_sysctl(SYSCTL_HANDLER_ARGS);
-static void    acpi_system_eventhandler_sleep(void *arg,
-                   enum power_stype stype);
-static void    acpi_system_eventhandler_wakeup(void *arg,
-                   enum power_stype stype);
+static void    acpi_system_eventhandler_sleep(struct acpi_softc *const sc,
+                   const enum power_stype stype);
+static void    acpi_system_eventhandler_wakeup(struct acpi_softc *const sc,
+                   const enum power_stype stype);
 static enum power_stype        acpi_sstate_to_stype(int sstate);
 static int     acpi_sname_to_sstate(const char *sname);
 static const char      *acpi_sstate_to_sname(int sstate);
@@ -4106,9 +4106,9 @@ out:
 /* System Event Handlers (registered by EVENTHANDLER_REGISTER) */
 
 static void
-acpi_system_eventhandler_sleep(void *arg, enum power_stype stype)
+acpi_system_eventhandler_sleep(struct acpi_softc *const sc,
+    const enum power_stype stype)
 {
-    struct acpi_softc *sc = (struct acpi_softc *)arg;
     int ret;
 
     ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, stype);
@@ -4130,13 +4130,12 @@ acpi_system_eventhandler_sleep(void *arg, enum 
power_stype stype)
 }
 
 static void
-acpi_system_eventhandler_wakeup(void *arg, enum power_stype stype)
+acpi_system_eventhandler_wakeup(struct acpi_softc *const sc,
+    const enum power_stype stype)
 {
-
     ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, stype);
 
     /* Currently, nothing to do for wakeup. */
-
     return_VOID;
 }
 

Reply via email to