diff options
author | Ahmad Khalifa <ahmadkhalifa570@gmail.com> | 2024-04-19 22:43:19 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2025-03-26 01:28:37 +0000 |
commit | 4073e53e4285f20c21e4eeecb4d774752b59bae8 (patch) | |
tree | 1abcb1a9e1e92312a49de4728b8340ac4bc0783e | |
parent | 475082194ac811a925bf4a8109ef5e4f4f485dad (diff) |
acpi_cmbat: Use nitems instead of sizeof
Reviewed by: imp, markj, Elliott Mitchell
Pull Request: https://github.com/freebsd/freebsd-src/pull/1125
(cherry picked from commit d0cc25f770aee068bcbaee89aa2f52cc5dd79dd5)
-rw-r--r-- | sys/dev/acpica/acpi_cmbat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/acpica/acpi_cmbat.c b/sys/dev/acpica/acpi_cmbat.c index e85967aed9c9..35032244af19 100644 --- a/sys/dev/acpica/acpi_cmbat.c +++ b/sys/dev/acpica/acpi_cmbat.c @@ -344,7 +344,7 @@ acpi_cmbat_get_bix(void *arg) bix_buffer.Pointer = NULL; bix_buffer.Length = ACPI_ALLOCATE_BUFFER; - for (n = 0; n < sizeof(bobjs); n++) { + for (n = 0; n < nitems(bobjs); n++) { as = AcpiEvaluateObject(h, bobjs[n].name, NULL, &bix_buffer); if (!ACPI_FAILURE(as)) { res = (ACPI_OBJECT *)bix_buffer.Pointer; @@ -355,7 +355,7 @@ acpi_cmbat_get_bix(void *arg) bix_buffer.Length = ACPI_ALLOCATE_BUFFER; } /* Both _BIF and _BIX were not found. */ - if (n == sizeof(bobjs)) { + if (n == nitems(bobjs)) { ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev), "error fetching current battery info -- %s\n", AcpiFormatException(as)); |