From nobody Sun Jun 02 23:47:21 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 4VstnQ2jgDz5LVVg; Sun, 02 Jun 2024 23:47:22 +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 4VstnP2RdBz49tb; Sun, 2 Jun 2024 23:47:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717372041; 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=yyhKXp27biv457HA8u+o7WmiUrC/8U1a05Tw2UE+OvQ=; b=sJI2oYPOeKA/ZLD2omhcXYOlwbByTSGW4tD1p+luz9XAg/nt8IZFokr55i9Cs/tiCIHLke S8HojIoskAgCeh3mS+rgQZun6LtXP3C1X0L2iuo2fYRX1KezrDu759Tq9rxm7ANedGbdOT XAPsCXex2KkP1XJWrpf/KmTe0jEaW3osSLFtsqwfZLx63anl//cQmgb5vPei6dgSk327TY 1QwrBXqd+tXII/d0KPVNy1kKG5PtPbmXyOz9XH2bmy6ougT3aVTTCVWItG9zXwShPNhyG8 taPMW9hO++MLFyS+JULSmq5IzI0gkYxv/446vtlW+z61FfLw2HS8PednAEYPTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717372041; a=rsa-sha256; cv=none; b=L7UE5zYC/ahLpbkshWaOwqvHDNs9LLWx5AzyQw4ffapjWLNt9kvRayR8WnfXPu0iXaa19h 3FeTfljQB3uSk+nUQCTUIv2G6SEu6OJ5jjuXdo/nwGZ2YYLS3ky32b5u7GLI7txT3Fr+aY p6EZillO2B7IDotFsUprw7WV7yCPveJA4syzEzDgLRV6hvqHx7pUcXdSORYUVJ8n4SGb4I XH6E18rpxOTghrp8R2t2llKMT/SXUNIB9sDoEjbRScWNL1kAkMCIR7C8cK/HDoaC4OlHv3 N1WtTwc3NfZ0oFuuREzYymhz93szVzT9vUtKNM4ZYmqAhdAcVrxlOn5i+ECSZA== 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=1717372041; 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=yyhKXp27biv457HA8u+o7WmiUrC/8U1a05Tw2UE+OvQ=; b=sxw1vjG5X+mxsARy/RaOYbTr6/Vk9AkecDFVmIR+hXom8glJ7dTOyfqTMOV72Hr744t/VK K2xaFDwqi62WTZ5ZYdICIiy2YUek0HJU5UyFDcvGPq+Uk879wCH5sZQxGUt+tVBBv3cyF0 v2DBv56NUaw+wORn7oo6SIl7EBCixStAA/Ma6FPmL6CAk86jc9VSw7Zroxls1Yn9CxpgLY 79qdFfxti8i6LD+VCes66MPLoYxyN9GnsIrfFFyWWmkBcKIrScBy/xf+GYd+VAP9l7YnGc P4eZsDkW5GH3GiC3QCj8G9nj4XrukLnBaTkXm6ubuc134diQ2BTp66lklKiXdQ== 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 4VstnP1s3bz1BnS; Sun, 2 Jun 2024 23:47:21 +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 452NlLkE056735; Sun, 2 Jun 2024 23:47:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 452NlLE6056732; Sun, 2 Jun 2024 23:47:21 GMT (envelope-from git) Date: Sun, 2 Jun 2024 23:47:21 GMT Message-Id: <202406022347.452NlLE6056732@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: bad36a49985c - main - acpi: Use device_set_descf() 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bad36a49985c3cd7bfcb1b35ce3ae37f007843ce Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bad36a49985c3cd7bfcb1b35ce3ae37f007843ce commit bad36a49985c3cd7bfcb1b35ce3ae37f007843ce Author: Mark Johnston AuthorDate: 2024-02-04 23:51:27 +0000 Commit: Mark Johnston CommitDate: 2024-06-02 23:38:41 +0000 acpi: Use device_set_descf() No functional change intended. MFC after: 1 week --- sys/dev/acpi_support/acpi_asus.c | 22 +++++----------------- sys/dev/acpi_support/acpi_fujitsu.c | 4 +--- sys/dev/acpica/acpi_ec.c | 8 +++----- sys/dev/acpica/acpi_pci_link.c | 9 ++++----- sys/dev/acpica/acpi_timer.c | 4 +--- 5 files changed, 14 insertions(+), 33 deletions(-) diff --git a/sys/dev/acpi_support/acpi_asus.c b/sys/dev/acpi_support/acpi_asus.c index 6e63d8fabab1..b9ba6650d2b7 100644 --- a/sys/dev/acpi_support/acpi_asus.c +++ b/sys/dev/acpi_support/acpi_asus.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include @@ -535,7 +534,6 @@ acpi_asus_probe(device_t dev) { struct acpi_asus_model *model; struct acpi_asus_softc *sc; - struct sbuf *sb; ACPI_BUFFER Buf; ACPI_OBJECT Arg, *Obj; ACPI_OBJECT_LIST Args; @@ -599,24 +597,17 @@ acpi_asus_probe(device_t dev) } } - sb = sbuf_new_auto(); - if (sb == NULL) - return (ENOMEM); - /* * Asus laptops are simply identified by name, easy! */ for (model = acpi_asus_models; model->name != NULL; model++) { if (strncmp(Obj->String.Pointer, model->name, 3) == 0) { good: - sbuf_printf(sb, "Asus %s Laptop Extras", - Obj->String.Pointer); - sbuf_finish(sb); - sc->model = model; - device_set_desc_copy(dev, sbuf_data(sb)); - sbuf_delete(sb); + device_set_descf(dev, "Asus %s Laptop Extras", + Obj->String.Pointer); + AcpiOsFree(Buf.Pointer); return (rv); } @@ -695,12 +686,9 @@ good: } } - sbuf_printf(sb, "Unsupported Asus laptop: %s\n", Obj->String.Pointer); - sbuf_finish(sb); - - device_printf(dev, "%s", sbuf_data(sb)); + device_printf(dev, "Unsupported Asus laptop: %s\n", + Obj->String.Pointer); - sbuf_delete(sb); AcpiOsFree(Buf.Pointer); return (ENXIO); diff --git a/sys/dev/acpi_support/acpi_fujitsu.c b/sys/dev/acpi_support/acpi_fujitsu.c index 2d3c6f17dfe2..1649f74d873c 100644 --- a/sys/dev/acpi_support/acpi_fujitsu.c +++ b/sys/dev/acpi_support/acpi_fujitsu.c @@ -222,14 +222,12 @@ static int acpi_fujitsu_probe(device_t dev) { char *name; - char buffer[64]; int rv; rv = ACPI_ID_PROBE(device_get_parent(dev), dev, fujitsu_ids, &name); if (acpi_disabled("fujitsu") || rv > 0 || device_get_unit(dev) > 1) return (ENXIO); - sprintf(buffer, "Fujitsu Function Hotkeys %s", name); - device_set_desc_copy(dev, buffer); + device_set_descf(dev, "Fujitsu Function Hotkeys %s", name); return (rv); } diff --git a/sys/dev/acpica/acpi_ec.c b/sys/dev/acpica/acpi_ec.c index d27b7caee9e6..8ee7bc54f304 100644 --- a/sys/dev/acpica/acpi_ec.c +++ b/sys/dev/acpica/acpi_ec.c @@ -339,7 +339,6 @@ acpi_ec_probe(device_t dev) ACPI_OBJECT *obj; ACPI_STATUS status; device_t peer; - char desc[64]; int ecdt; int ret, rc; struct acpi_ec_params *params; @@ -444,10 +443,9 @@ acpi_ec_probe(device_t dev) ret = rc; out: if (ret <= 0) { - snprintf(desc, sizeof(desc), "Embedded Controller: GPE %#x%s%s", - params->gpe_bit, (params->glk) ? ", GLK" : "", - ecdt ? ", ECDT" : ""); - device_set_desc_copy(dev, desc); + device_set_descf(dev, "Embedded Controller: GPE %#x%s%s", + params->gpe_bit, (params->glk) ? ", GLK" : "", + ecdt ? ", ECDT" : ""); } else free(params, M_TEMP); diff --git a/sys/dev/acpica/acpi_pci_link.c b/sys/dev/acpica/acpi_pci_link.c index dac07a07ae7d..d9807876c443 100644 --- a/sys/dev/acpica/acpi_pci_link.c +++ b/sys/dev/acpica/acpi_pci_link.c @@ -143,7 +143,7 @@ acpi_short_name(ACPI_HANDLE handle, char *buffer, size_t buflen) static int acpi_pci_link_probe(device_t dev) { - char descr[28], name[12]; + char name[12]; int rv; /* @@ -157,10 +157,9 @@ acpi_pci_link_probe(device_t dev) return (rv); if (ACPI_SUCCESS(acpi_short_name(acpi_get_handle(dev), name, - sizeof(name)))) { - snprintf(descr, sizeof(descr), "ACPI PCI Link %s", name); - device_set_desc_copy(dev, descr); - } else + sizeof(name)))) + device_set_descf(dev, "ACPI PCI Link %s", name); + else device_set_desc(dev, "ACPI PCI Link"); device_quiet(dev); return (rv); diff --git a/sys/dev/acpica/acpi_timer.c b/sys/dev/acpica/acpi_timer.c index 8b362f52047a..e78b4728749a 100644 --- a/sys/dev/acpica/acpi_timer.c +++ b/sys/dev/acpica/acpi_timer.c @@ -159,7 +159,6 @@ acpi_timer_identify(driver_t *driver, device_t parent) static int acpi_timer_probe(device_t dev) { - char desc[40]; int i, j, rid, rtype; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -219,10 +218,9 @@ acpi_timer_probe(device_t dev) } tc_init(&acpi_timer_timecounter); - sprintf(desc, "%d-bit timer at %u.%06uMHz", + device_set_descf(dev, "%d-bit timer at %u.%06uMHz", (AcpiGbl_FADT.Flags & ACPI_FADT_32BIT_TIMER) != 0 ? 32 : 24, acpi_timer_frequency / 1000000, acpi_timer_frequency % 1000000); - device_set_desc_copy(dev, desc); /* Release the resource, we'll allocate it again during attach. */ bus_release_resource(dev, rtype, rid, acpi_timer_reg);