From nobody Tue Jun 28 13:01:15 2022 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 F0F8F86E65B; Tue, 28 Jun 2022 13:01:15 +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 4LXPqH6X15z3rLT; Tue, 28 Jun 2022 13:01:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656421275; 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=7vIDPm1ZIu6POh6m6qnAN876MNZUd7dWSB2ST/jo8bM=; b=TwrPDcql1vV3Wq9dzNX8ouvB2mrtY/lkLtVccBBP9CK3yTjF4GAEgXTn1CNvf8QodYKEa4 6uCZIbRuHV2t81uQC1TaNL/rOfHgdKyfA65+s1KgEUHi3J4sMeV54ICCMVzj8Rkx5bIPqA UzIw5tpaFalN3w/8HvFIhuPEeCGvT4Gb2zKiV5VGe0fCBQMb2PbREhJN+SvrPA3AmkGGxQ Zqte8+5lFw3PBbxFZk2YaxILv9lFMGBLB03vssVIjWEVzgjHwmLjfoFjrHPjz6edt3TgXI XVY+sLAS22NVqj4N9DpF6F2vt0EVkhQeFnt7bNLWsH/KSsjRPLG/6La3nVsfNA== 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 C0AFF1D52B; Tue, 28 Jun 2022 13:01:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25SD1FW3049651; Tue, 28 Jun 2022 13:01:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25SD1FeA049650; Tue, 28 Jun 2022 13:01:15 GMT (envelope-from git) Date: Tue, 28 Jun 2022 13:01:15 GMT Message-Id: <202206281301.25SD1FeA049650@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 945eaca155fc - main - ACPI: change arguments to internal acpi_find_dsd() 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 945eaca155fc0d48da8d11fc41b8b00f17254d90 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656421275; 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=7vIDPm1ZIu6POh6m6qnAN876MNZUd7dWSB2ST/jo8bM=; b=o6zf3gpaeO7YVmA2rG/USv6Ws+/vsdo7+xhRQCc5ygxcFD8+YOiRRV9iA0WOGhGe9OUQWj IWjEYNlDuEE8DjmBaR2tc+a4Db5G2jLokWdqwcGBfHC60sjk2cufxadnBOjoXFqlTtPDKm HBEcd6QXbXQ1Ogv7vt+UiqZ6EXo6u0doYN+K71sEs4SKF1VDilitCr7NV3go2kAe+ctVse Vw3qkC5u5IAbOhurAKI1zc7rQ3XlP1CZrSkmPwee9xo3OtPBDU1kwMZ5yTdjN7OTlallc1 jT//vBkCqP9Ez/l/dsZCyT6dVDfUpgEign9LL0B/FE8p+12sJ19NGOjXoIrNbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656421275; a=rsa-sha256; cv=none; b=XJ1+QPAW6WRKFyjieGUc8HhMh2QvSn1B95PLagh/zQ6OfPsEwTz4i0OplHQYSA8DxpV1Kk 5hYQ5oqjxmiSocPGXoo8xdSQARlersB334h8bVau0tLMwMbEzz27YhLxkhdvwcfgKfUkwz Wq1EdfKgpJEe4fjeIGii9n8Gs+SDStktB2eMybNNQE/zzQQZ67xbqpSd/VVue/GdhFy+j3 CzZvWtks2+FtHjpPpUmZTAOpzVYwR1goq/xEe+URIpQ6Met6u/0r8STRS4Ss/q3At7hKhp FvR6tBiN1p4LxchLoCkZo8rsjVXiqtLH2EuE1ZckqLkk8fzDqtgPEARjvdgN/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=945eaca155fc0d48da8d11fc41b8b00f17254d90 commit 945eaca155fc0d48da8d11fc41b8b00f17254d90 Author: Bjoern A. Zeeb AuthorDate: 2022-06-23 00:17:14 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-06-28 12:57:04 +0000 ACPI: change arguments to internal acpi_find_dsd() acpi_find_dsd() is not a bus function and we only need the acpi_device (ad). The only caller has already looked up the ad (from ivars) for us. Directly pass the ad to acpi_find_dsd() instead of bus, dev and remove the extra call to device_get_ivars(); the changed argument also means we now call AcpiEvaluateObject directly on the handle. This optimisation was done a while ago while debugging a driver which ended up with a bad bus, dev combination making the old version fail. MFC after: 2 weeks Reviewed by: mw Differential Revision: https://reviews.freebsd.org/D35558 --- sys/dev/acpica/acpi.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 2488e5aa83f0..37d7b88811a6 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -156,7 +156,7 @@ static ACPI_STATUS acpi_device_scan_cb(ACPI_HANDLE h, UINT32 level, void *context, void **retval); static ACPI_STATUS acpi_device_scan_children(device_t bus, device_t dev, int max_depth, acpi_scan_cb_t user_fn, void *arg); -static ACPI_STATUS acpi_find_dsd(device_t bus, device_t dev); +static ACPI_STATUS acpi_find_dsd(struct acpi_device *ad); static int acpi_isa_pnp_probe(device_t bus, device_t child, struct isa_pnp_id *ids); static void acpi_platform_osc(device_t dev); @@ -1864,7 +1864,7 @@ acpi_device_get_prop(device_t bus, device_t dev, ACPI_STRING propname, return (AE_BAD_PARAMETER); if (ad->dsd_pkg == NULL) { if (ad->dsd.Pointer == NULL) { - status = acpi_find_dsd(bus, dev); + status = acpi_find_dsd(ad); if (ACPI_FAILURE(status)) return (status); } else { @@ -1893,18 +1893,16 @@ acpi_device_get_prop(device_t bus, device_t dev, ACPI_STRING propname, } static ACPI_STATUS -acpi_find_dsd(device_t bus, device_t dev) +acpi_find_dsd(struct acpi_device *ad) { const ACPI_OBJECT *dsd, *guid, *pkg; - struct acpi_device *ad; ACPI_STATUS status; - ad = device_get_ivars(dev); ad->dsd.Length = ACPI_ALLOCATE_BUFFER; ad->dsd.Pointer = NULL; ad->dsd_pkg = NULL; - status = ACPI_EVALUATE_OBJECT(bus, dev, "_DSD", NULL, &ad->dsd); + status = AcpiEvaluateObject(ad->ad_handle, "_DSD", NULL, &ad->dsd); if (ACPI_FAILURE(status)) return (status);