Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 May 2023 19:34:21 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 65c92e48c43a - main - acpi_button: Replace boolean_t with better types.
Message-ID:  <202305041934.344JYLd0049337@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

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

commit 65c92e48c43aca347b614d1e0a5c87c9df0ed8a8
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-05-04 19:32:09 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-05-04 19:32:09 +0000

    acpi_button: Replace boolean_t with better types.
    
    - Use an enum for the button type (it is not really a boolean value).
    
    - Use bool for fixed.
    
    Reviewed by:    imp, emaste
    Differential Revision:  https://reviews.freebsd.org/D39922
---
 sys/dev/acpica/acpi_button.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/sys/dev/acpica/acpi_button.c b/sys/dev/acpica/acpi_button.c
index 492f64e00f4d..f2c7041f809f 100644
--- a/sys/dev/acpica/acpi_button.c
+++ b/sys/dev/acpica/acpi_button.c
@@ -53,10 +53,8 @@ ACPI_MODULE_NAME("BUTTON")
 struct acpi_button_softc {
     device_t	button_dev;
     ACPI_HANDLE	button_handle;
-    boolean_t	button_type;
-#define		ACPI_POWER_BUTTON	0
-#define		ACPI_SLEEP_BUTTON	1
-    boolean_t	fixed;
+    enum { ACPI_POWER_BUTTON, ACPI_SLEEP_BUTTON } button_type;
+    bool	fixed;
 #ifdef EVDEV_SUPPORT
     struct evdev_dev *button_evdev;
 #endif
@@ -120,14 +118,14 @@ acpi_button_probe(device_t dev)
     } else if (strcmp(str, "ACPI_FPB") == 0) {
 	device_set_desc(dev, "Power Button (fixed)");
 	sc->button_type = ACPI_POWER_BUTTON;
-	sc->fixed = 1;
+	sc->fixed = true;
     } else if (strcmp(str, "PNP0C0E") == 0) {
 	device_set_desc(dev, "Sleep Button");
 	sc->button_type = ACPI_SLEEP_BUTTON;
     } else if (strcmp(str, "ACPI_FSB") == 0) {
 	device_set_desc(dev, "Sleep Button (fixed)");
 	sc->button_type = ACPI_SLEEP_BUTTON;
-	sc->fixed = 1;
+	sc->fixed = true;
     }
 
     return (rv);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202305041934.344JYLd0049337>