From nobody Mon Jun 22 21:42:35 2026 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 4gkhWH3zJ5z6j5y5 for ; Mon, 22 Jun 2026 21:42:35 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gkhWH30XGz3LkB for ; Mon, 22 Jun 2026 21:42:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782164555; 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=AEVvBamamlAidC1uhH2/vNmgS+XQrXvob7NxlouUAxc=; b=sx5/GbYUZ7sHbZGhrZGgK9xCSfPOzSRcywE/JKFyrMi56hqL5DI0fPdKAJFrhnIeKT11B3 qkfoLMYCO0Qa61Hw34n/mrTIPhIxnprRJ7fAyyl04F/85H3Kfdvr1gVSywHq5nd5Vn77QE CKTxiisEm+tS9ao0kFJqr4MJWRlLQoJMOuf4qoKcsawNBeI+/KS2kZ1yV4gl3dqF5RfoWt y8dFZWq5o4iAtCSO+VfEtUBd/ut5ITNPos2YpBOV0R+I4mTzK6t2yoeo40ehp8xZmNp2GV Kwek79g0s9sER95rJxn0nly103hPi+cmIn1nF4bRk5SAaM+Me12yi5UnEOQ65Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782164555; a=rsa-sha256; cv=none; b=rMaUeYanyiHOBHGv8g8FexgMv3dn596B2ggnUHqcjqbSAfHG7aAVDX3TdUNgbn8/U50yD3 w9hw2wkWenXEAjL/io3a40qQgDEJ1IpiUxzKnY7nOciOTUpoQVeegdp02rw075d8M9Rvqk BpGWaRoOIDI+kBRKc24cNye9x0dpU0pKwQT3CT/6z9CWdMJVe2Epu8vv0u2GKjGBiSIhyt ouTyBmdvNmG40lV80/W48nyVUaLUHEYN3lJU8hh+pedIgUTFcr5FqUY941g8HWG4guc2We jZJZvFk2LmmSmqhVzvlbuvJmMIMwRv5rCPODGCJ/UtNQSgYP4f+W4tc5K+rn/w== 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=1782164555; 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=AEVvBamamlAidC1uhH2/vNmgS+XQrXvob7NxlouUAxc=; b=lmpF1WgychDrx8MktmEmppwGbv2nt62bb/YswqZTTMYrCZ5PnRcC/sMCPXEqX/QpUObjNm S0OGEU8mXs/X9wGoMRWJ5D+uJjuAFD87j6ETME1KjSokQjI/QVMnnlEFdMp5OvRsXsVySQ 5P3mSeMUu7uZUiouKhJWNrtwJHv6/XbWXc0PWxzaD98VCKGM2dCP6eXY0s8t31QljBpUA3 nvq4sMXv4Ila7vDLLsq14xdYWlWD3jfTs8hekI17gRv4ANMGXiuIvVVpe3b7SHBjsI5Rw5 OvHjvcZ4fYca9mLuA0wdBnWBHfzdT2ZP0e5aB+FeOUcC/OOPddG+3oyZaACJTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gkhWH1sdXz14pT for ; Mon, 22 Jun 2026 21:42:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1e7c9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 22 Jun 2026 21:42:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: a12d069ef37f - main - acpi: Constify thanks to AcpiGetHandle() taking a constant pathname 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a12d069ef37fd60538b6f46372b194e6cf117250 Auto-Submitted: auto-generated Date: Mon, 22 Jun 2026 21:42:35 +0000 Message-Id: <6a39ac4b.1e7c9.7453dea4@gitrepo.freebsd.org> The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=a12d069ef37fd60538b6f46372b194e6cf117250 commit a12d069ef37fd60538b6f46372b194e6cf117250 Author: Olivier Certner AuthorDate: 2026-06-03 20:30:22 +0000 Commit: Olivier Certner CommitDate: 2026-06-22 21:40:08 +0000 acpi: Constify thanks to AcpiGetHandle() taking a constant pathname Make the ACPI interface's functions evaluate_object() and get_property() take a constant pathname (by substituting ACPI_STRING with 'const char *'). This allows to remove some __DECONST(). 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 | 24 +++++++++--------------- sys/dev/acpica/acpi_if.m | 8 ++++---- sys/dev/acpica/acpivar.h | 6 +++--- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 7103eea16053..48d868b6ac00 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1946,7 +1946,7 @@ acpi_device_id_probe(device_t bus, device_t dev, char **ids, char **match) } static ACPI_STATUS -acpi_device_eval_obj(device_t bus, device_t dev, ACPI_STRING pathname, +acpi_device_eval_obj(device_t bus, device_t dev, const char *pathname, ACPI_OBJECT_LIST *parameters, ACPI_BUFFER *ret) { ACPI_HANDLE h; @@ -1955,11 +1955,12 @@ acpi_device_eval_obj(device_t bus, device_t dev, ACPI_STRING pathname, h = ACPI_ROOT_OBJECT; else if ((h = acpi_get_handle(dev)) == NULL) return (AE_BAD_PARAMETER); - return (AcpiEvaluateObject(h, pathname, parameters, ret)); + return (AcpiEvaluateObject(h, __DECONST(char *, pathname), parameters, + ret)); } static ACPI_STATUS -acpi_device_get_prop(device_t bus, device_t dev, ACPI_STRING propname, +acpi_device_get_prop(device_t bus, device_t dev, const char *propname, const ACPI_OBJECT **value) { const ACPI_OBJECT *pkg, *name, *val; @@ -2068,8 +2069,7 @@ acpi_bus_get_prop(device_t bus, device_t child, const char *propname, ACPI_STATUS status; const ACPI_OBJECT *obj; - status = acpi_device_get_prop(bus, child, __DECONST(char *, propname), - &obj); + status = acpi_device_get_prop(bus, child, propname, &obj); if (ACPI_FAILURE(status)) return (-1); @@ -2114,8 +2114,7 @@ acpi_bus_get_prop(device_t bus, device_t child, const char *propname, case ACPI_TYPE_PACKAGE: if (propvalue != NULL && size >= sizeof(ACPI_OBJECT *)) { - *((ACPI_OBJECT **) propvalue) = - __DECONST(ACPI_OBJECT *, obj); + *((const ACPI_OBJECT **) propvalue) = obj; } return (sizeof(ACPI_OBJECT *)); @@ -2844,7 +2843,7 @@ acpi_MatchHid(ACPI_HANDLE h, const char *hid) * or one if its parents. */ ACPI_STATUS -acpi_GetHandleInScope(ACPI_HANDLE parent, char *path, ACPI_HANDLE *result) +acpi_GetHandleInScope(ACPI_HANDLE parent, const char *path, ACPI_HANDLE *result) { ACPI_HANDLE r; ACPI_STATUS status; @@ -2866,8 +2865,7 @@ acpi_GetHandleInScope(ACPI_HANDLE parent, char *path, ACPI_HANDLE *result) } ACPI_STATUS -acpi_GetProperty(device_t dev, ACPI_STRING propname, - const ACPI_OBJECT **value) +acpi_GetProperty(device_t dev, const char *propname, const ACPI_OBJECT **value) { device_t bus = device_get_parent(dev); @@ -4328,14 +4326,10 @@ acpi_lookup(void *arg, const char *name, device_t *dev) * starts with '\'. We could restrict this to \_SB and friends, * but see acpi_probe_children() for notes on why we scan the entire * namespace for devices. - * - * XXX: The pathname argument to AcpiGetHandle() should be fixed to - * be const. */ if (name[0] != '\\') return; - if (ACPI_FAILURE(AcpiGetHandle(ACPI_ROOT_OBJECT, __DECONST(char *, name), - &handle))) + if (ACPI_FAILURE(AcpiGetHandle(ACPI_ROOT_OBJECT, name, &handle))) return; *dev = acpi_get_device(handle); } diff --git a/sys/dev/acpica/acpi_if.m b/sys/dev/acpica/acpi_if.m index 6b7a770f8812..b9960995a052 100644 --- a/sys/dev/acpica/acpi_if.m +++ b/sys/dev/acpica/acpi_if.m @@ -102,7 +102,7 @@ METHOD int id_probe { # device_t dev: evaluate the object relative to this device's handle. # Specify NULL to begin the search at the ACPI root. # -# ACPI_STRING pathname: absolute or relative path to this object +# const char *pathname: absolute or relative path to this object # # ACPI_OBJECT_LIST *parameters: array of arguments to pass to the object. # Specify NULL if there are none. @@ -115,7 +115,7 @@ METHOD int id_probe { METHOD ACPI_STATUS evaluate_object { device_t bus; device_t dev; - ACPI_STRING pathname; + const char *pathname; ACPI_OBJECT_LIST *parameters; ACPI_BUFFER *ret; }; @@ -127,7 +127,7 @@ METHOD ACPI_STATUS evaluate_object { # # device_t dev: find property for this device's handle. # -# const ACPI_STRING propname: name of the property +# const char *propname: name of the property # # const ACPI_OBJECT **value: property value output # Specify NULL if ignored @@ -137,7 +137,7 @@ METHOD ACPI_STATUS evaluate_object { METHOD ACPI_STATUS get_property { device_t bus; device_t dev; - ACPI_STRING propname; + const char *propname; const ACPI_OBJECT **value; }; diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 01e7ddcd74cd..5d1415a8f543 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -365,9 +365,9 @@ typedef void acpi_subtable_handler(ACPI_SUBTABLE_HEADER *, void *); BOOLEAN acpi_DeviceIsPresent(device_t dev); BOOLEAN acpi_BatteryIsPresent(device_t dev); -ACPI_STATUS acpi_GetHandleInScope(ACPI_HANDLE parent, char *path, +ACPI_STATUS acpi_GetHandleInScope(ACPI_HANDLE parent, const char *path, ACPI_HANDLE *result); -ACPI_STATUS acpi_GetProperty(device_t dev, ACPI_STRING propname, +ACPI_STATUS acpi_GetProperty(device_t dev, const char *propname, const ACPI_OBJECT **value); ACPI_BUFFER *acpi_AllocBuffer(int size); ACPI_STATUS acpi_ConvertBufferToInteger(ACPI_BUFFER *bufp, @@ -416,7 +416,7 @@ int acpi_MatchHid(ACPI_HANDLE h, const char *hid); #define ACPI_MATCHHID_CID 2 static __inline bool -acpi_HasProperty(device_t dev, ACPI_STRING propname) +acpi_HasProperty(device_t dev, const char *propname) { return ACPI_SUCCESS(acpi_GetProperty(dev, propname, NULL));