From nobody Fri Apr 19 22:48:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VLqZL0CwXz5Httv; Fri, 19 Apr 2024 22:48:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VLqZK4rJzz4NTF; Fri, 19 Apr 2024 22:48:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713566937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HWl9gBd3gs6J0pjB651OnIfFeDn4jYJHrQELO9K5Z/E=; b=AKcktsD7+OW4D1v4lQ9mKavSE+bufgWAXDVSrnFqZC9qqfMA9GQVUkfbxsryI3IbIIRlQb iQOVtSPLNhm5rQrNoswE89yUpIimttZOBZFGYGxuqEr5OCK1g6cvCzmAnHWUTxrQ9vr6ic vyCE92e9gDxGDM0D2VPx4Iki/OX4FrKIaySkA12d3GfNktAwEaUOQmqRbOw9ecTfBAFkuB xRjijGs5cEjViDQYt3LgQ77ukeRbxu915JmET2VykLEHrmb7XUl0wS2DO/hccvyJ4DJ7PU 0ZjVqrXUFd932trGnA7ovmx7L8sOXRcF59vpwHRvcOfCN0dkp+NGiCjR1nYaDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713566937; a=rsa-sha256; cv=none; b=C8JYV7MAvRVs9rd4mWcoyoLdA+bYpqkZRkDqtnVfP43XpmoVGKXGodoP+DQnU/KZU8vas9 xRBS52l0F4+kBSHkdekGysqBvgAVAClg7Vh5wBzyPy/jOEzVwa3xKpVZRv1f1EfDLcREsc TnCoKPtaT6tuy2t7RMqU02+3mg9Kw/HtumTFgk8OWKACRz6oso2i+Eef5C0ba4FD1fy4C6 lmqzFmaj8DD2qRmk0yhpyLsBZ8kzndYJYG1gIVqKiLbVyjaFtDp2Ev59++cNuyhmlYTwdh Nut4a7OMOo5CIeguAYTsdgOFthDRrjBUAPioBaT+l1uXnmDQYqwyv8F4c7pVAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713566937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HWl9gBd3gs6J0pjB651OnIfFeDn4jYJHrQELO9K5Z/E=; b=aKVqZ2zZZQAmBptk63lLw26sUwkH/29ROyJOD86zP7ipqzE9xABURerOm9/kXuLIReZQ96 lpzVZ7ZIxWPbdC7kpxaYzRv7SqUpfnHo2poXVhlxTghAPO0XsnEYdS0tMjgvllENF+9jUB ILkE1v3S0zkgpjk3MnFnqgSKqij0dlT2gc24rXfuzHzryIuibuQG46zoHqlD+7ntRXP7r+ uSUch2QIHhTj9qVxCZjEi6ii0wq2hl2BZyjKWHN5qp5Ngjik5nu9Ry8w8KrKryv2uuRLtJ 5DxWL29w9z93EzDPc1INkbs1Lecf1pZAOHG6OvSZHbm30YmMhN/0SoirvwDrdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VLqZK4Q3Tz19p3; Fri, 19 Apr 2024 22:48:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43JMmvVV010901; Fri, 19 Apr 2024 22:48:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43JMmvxl010898; Fri, 19 Apr 2024 22:48:57 GMT (envelope-from git) Date: Fri, 19 Apr 2024 22:48:57 GMT Message-Id: <202404192248.43JMmvxl010898@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d0cc25f770ae - main - acpi_cmbat: Use nitems instead of sizeof List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d0cc25f770aee068bcbaee89aa2f52cc5dd79dd5 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d0cc25f770aee068bcbaee89aa2f52cc5dd79dd5 commit d0cc25f770aee068bcbaee89aa2f52cc5dd79dd5 Author: Ahmad Khalifa AuthorDate: 2024-04-19 22:43:19 +0000 Commit: Warner Losh CommitDate: 2024-04-19 22:44:57 +0000 acpi_cmbat: Use nitems instead of sizeof Reviewed by: imp, markj, Elliott Mitchell Pull Request: https://github.com/freebsd/freebsd-src/pull/1125 --- sys/dev/acpica/acpi_cmbat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpica/acpi_cmbat.c b/sys/dev/acpica/acpi_cmbat.c index 8c08868456d7..aeda34c3acff 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));