From nobody Fri Jul 24 04:34:55 2026 X-Original-To: dev-commits-src-all@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 4h5wBr72Btz6lsYQ for ; Fri, 24 Jul 2026 04:35:00 +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 4h5wBr5Pk0z3YtC for ; Fri, 24 Jul 2026 04:35:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784867700; 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=kLaBxdtnVJn30bHVEg2h1TukixouhU1gcNu8DhM47VI=; b=bdO0bV+sDS0n9OYrehWJxg0JF8vyijfQPWe7KcvB0gWQaG26Ra9iYEWJ6D7qc7v+qyvy2l wn9TPLNrYX03EnRasnxPPjolWPhfERvV8rSw0RwMkP2D5R+nOQAHnaIAORPumVtpN88meZ m8YJLlauBxEWcLilMBtEGQIrXCoV1FpEUtpQCIjwyUy99sIdQPJfocV5BFnMWfDY8kYvEs gSCwdsbtX1Ux+w/ABy7BxVCJNa5OMuz/uSI+oMqfIOxNcCgR2/4Ho8HGCWCrh3iCoXYCb0 7VOzOSv7KzOSRHpADOU883mmy+s+idTJi0G0Vr/cSK6wNScEcWWjk4zlSYTNcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1784867700; a=rsa-sha256; cv=none; b=gMxYs4Oby/VG0Ojs1ZTZtwFOnDorfr0PSdWEYCifKTHySK8OGY5txlqcM94TuvWHO0ThD7 I24HbPtrrRZxGLI/EpD69GjR0QKLB1vD+5XaXhNt9xJnqvVedFaZGYQRHPgpIC34K7HPE7 U6hMwDC/Jwp2xCYJ8w4V9gN2xn4m6VNp0TZHcGnGTDMBA2g3fMP1sJOPnAJK3FYLzdDBT+ uBxouPYHYEFZto9HJbJcL718n2wubmD5tDonrOhJPfj7zkDnlNFbGfx0ERPyVi/iWc7cPZ 1cxg4g0/YhfKxnYQm4rtCXWbLcpy52ynMI6UGoD1VDHGaM9spnUM7SD6fPKXVQ== 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=1784867700; 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=kLaBxdtnVJn30bHVEg2h1TukixouhU1gcNu8DhM47VI=; b=fMihohxcuUSOFGDBBMEJX74TD4Fvtr8QHiWRjbm6De/gqkRmZfMwkCkfvjeuTBW8Xwx1zd mWPh7H+EOHCnoK+XY5Vcb/1yJcMSajpXB9tBy5VnMpT+ClO+2N/CG/ygcC2tR/1xZGNbwc K3/Sp5IqYHFC4oT44FyhpgAEzMRO+IyE2OEOA7vyR58VFACJGX58eQ6GiNtSdVOkgzlTd8 fXjYqxMOEQL56gRMm/6xcA1TAA/4zaJZLUslXN18GEwcDBcHkEcOGGWmlNN7+8J/tzW+5K FyMawyFvw2VQ6c/VuFWp+mK0ukvztcMWWTp+HID9V6BwNM4+Jp0yNrDRNScdZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h5wBr4RWHzcPT for ; Fri, 24 Jul 2026 04:35:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 397b6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 24 Jul 2026 04:34:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 490d561de6da - stable/15 - acpi: Constify thanks to AcpiGetHandle() taking a constant pathname List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 490d561de6da6d7508d9ef0084e70e85019c0804 Auto-Submitted: auto-generated Date: Fri, 24 Jul 2026 04:34:55 +0000 Message-Id: <6a62eb6f.397b6.75c7e949@gitrepo.freebsd.org> The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=490d561de6da6d7508d9ef0084e70e85019c0804 commit 490d561de6da6d7508d9ef0084e70e85019c0804 Author: Olivier Certner AuthorDate: 2026-06-03 20:30:22 +0000 Commit: Olivier Certner CommitDate: 2026-07-24 04:33:26 +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 (cherry picked from commit a12d069ef37fd60538b6f46372b194e6cf117250) --- 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 0d3f1abeebe6..edaa2153b0c9 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1830,7 +1830,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; @@ -1839,11 +1839,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; @@ -1952,8 +1953,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); @@ -1998,8 +1998,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 *)); @@ -2682,7 +2681,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; @@ -2704,8 +2703,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); @@ -4076,14 +4074,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 15738bbb1171..e73ba47d3255 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -382,9 +382,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, @@ -433,7 +433,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));