mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-21 18:27:22 +00:00
acpi_cmbat: Use nitems instead of sizeof
Reviewed by: imp, markj, Elliott Mitchell Pull Request: https://github.com/freebsd/freebsd-src/pull/1125
This commit is contained in:
parent
bf2fd47550
commit
d0cc25f770
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue