From nobody Sun Jun 09 14:12:14 2024 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 4Vxxhf5hSgz5MCg5; Sun, 09 Jun 2024 14:12:18 +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 4Vxxhf52d3z4DPP; Sun, 9 Jun 2024 14:12:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717942338; 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=b/rtHXQPXs0dLBuPJCZ5RlQqQP8w69TXuGuxmRRNNq4=; b=MVY5nZTBPoBW/GY86y7tVy3ZqpWeZjexDKDe/yOacpytfEddG0BvSsaUva24Ul6nVNRzrt dwZhX20baZMIYgfuvJD/Oc72BQvLD3R5IGiOcAjLDEImSoBzdTfldZYTlg1kca330YvjXa DUOZDbAcRZMaB0zeZUuovasQZTMURh9QrUFlDZumKwgokB7LAKvUoiGmrYc2DmCkKMJ4ZZ tKZZ5AIoAoyCGqTTFlsydH/PDjxBF14k6H99Dioz0Z570r5vEIiylIyUW3ad16YAX4dT5D XgmymJasEKd4nquX9ZXSmDho0fnkKk2W78y3Ww8yP96o1+dNvjnqlQf7sCOkiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717942338; a=rsa-sha256; cv=none; b=e0cCevcNblFkjbN27L0s2RTtNTZik99dRE2oiaa7zMiNisitQKbvpsHQROmV+jvZaXB32G WEzNx8O85hRu7Jme0VlNWABHaUdgvjyb+rYJio11aCFPxAClf3fhOlP4qbgpOJiEnli7mY 4P+ySq8+2bn3UA1yPmwHYJFNkzSdZ0sS+uo9+WDu6m7wyrgwAXky9MCXHsYVDBiZGn2mdm +ci9QP5y5KqNAikV95ovk0gt5CQ46n62BfH2f4itaP81P9PP196FQR+cUJwDAAT2DCc0js ++mrXrgqHM+mPg6b8dUTQ1hpeq3gVNykqJ9+GIMN4kHzQe3EuNM+l1uavkfyBg== 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=1717942338; 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=b/rtHXQPXs0dLBuPJCZ5RlQqQP8w69TXuGuxmRRNNq4=; b=ajMiP5/4MJ5YxaJFtsQTvmzXX/nAKZ035xEX1nmi604BLilx6LM8jmO7oXDfGcxwwgo/bd E1uyVIcGMyz3HEVG8l4inQ3GrtHRbxEJL/OMsfzvszHQlandLZjwFU8TDu5EPaQrkogtKz mQZENuSFtUYmFP8mYPLFOd+9TiNiYLCOW2lQ7asfTzOzKp1zEyZWG6/QsjLAGYhZM6FoCu K+UmTvhn3yjMFTWtMJG5/XSLko7QZqp6qxa59FGgOyfCBnzDKzoOPBp8GOCcwRIMlnDNOh GQLeJGn7atwQVK0HnPe3Ikjvb3D+In/dRYn3JN1JxI5GkiXGe1uQ7PkPbdxkow== 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 4VxxhZ6R7Bzlx2; Sun, 9 Jun 2024 14:12:14 +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 459ECESN085931; Sun, 9 Jun 2024 14:12:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 459ECETd085928; Sun, 9 Jun 2024 14:12:14 GMT (envelope-from git) Date: Sun, 9 Jun 2024 14:12:14 GMT Message-Id: <202406091412.459ECETd085928@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3f6fc84ad947 - stable/14 - proto: Use device_set_descf() 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 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 3f6fc84ad9475501913d718770ec67d972917637 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3f6fc84ad9475501913d718770ec67d972917637 commit 3f6fc84ad9475501913d718770ec67d972917637 Author: Mark Johnston AuthorDate: 2024-02-04 23:58:30 +0000 Commit: Mark Johnston CommitDate: 2024-06-09 13:37:59 +0000 proto: Use device_set_descf() No functional change intended. MFC after: 1 week (cherry picked from commit 542f9494b747079b13f3ed672cd01fa902e98ff2) --- sys/dev/proto/proto_bus_isa.c | 8 +------- sys/dev/proto/proto_bus_pci.c | 12 +++--------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/sys/dev/proto/proto_bus_isa.c b/sys/dev/proto/proto_bus_isa.c index 31c65b9d7857..7176543345a7 100644 --- a/sys/dev/proto/proto_bus_isa.c +++ b/sys/dev/proto/proto_bus_isa.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include @@ -63,7 +62,6 @@ static char **proto_isa_devnames; static int proto_isa_probe(device_t dev) { - struct sbuf *sb; struct resource *res; int rid, type; @@ -77,11 +75,7 @@ proto_isa_probe(device_t dev) if (res == NULL) return (ENODEV); - sb = sbuf_new_auto(); - sbuf_printf(sb, "%s:%#jx", proto_isa_prefix, rman_get_start(res)); - sbuf_finish(sb); - device_set_desc_copy(dev, sbuf_data(sb)); - sbuf_delete(sb); + device_set_descf(dev, "%s:%#jx", proto_isa_prefix, rman_get_start(res)); bus_release_resource(dev, type, rid, res); return (proto_probe(dev, proto_isa_prefix, &proto_isa_devnames)); } diff --git a/sys/dev/proto/proto_bus_pci.c b/sys/dev/proto/proto_bus_pci.c index 326f1105f1a5..015a2c53d526 100644 --- a/sys/dev/proto/proto_bus_pci.c +++ b/sys/dev/proto/proto_bus_pci.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include @@ -63,17 +62,12 @@ static char **proto_pci_devnames; static int proto_pci_probe(device_t dev) { - struct sbuf *sb; - if ((pci_read_config(dev, PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) != 0) return (ENXIO); - sb = sbuf_new_auto(); - sbuf_printf(sb, "%s%d:%d:%d:%d", proto_pci_prefix, pci_get_domain(dev), - pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev)); - sbuf_finish(sb); - device_set_desc_copy(dev, sbuf_data(sb)); - sbuf_delete(sb); + device_set_descf(dev, "%s%d:%d:%d:%d", proto_pci_prefix, + pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), + pci_get_function(dev)); return (proto_probe(dev, proto_pci_prefix, &proto_pci_devnames)); }