From nobody Sun Jun 16 20:37:57 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 4W2PwQ1CBLz5PRRb; Sun, 16 Jun 2024 20:37:58 +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 4W2PwP6yjvz3x4g; Sun, 16 Jun 2024 20:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718570278; 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=MnYFSjT4BxfsQK8ZI6FPJb1pjwy8yCC0QKyjW/yZGwY=; b=WC76b2pMRU59K0q5WAWmgrYehYdvrOFjRT3DfYXJ3AX79pSBiS7s/4+lkYc1NddZVKWaqx /kIw3dxaiHfDB89AOxJbepVLqHciueLMrfG9m2NUjNxXKUlyrAkENFZkbLv34Ox+N4vCu5 1O6HHwQtvlxXLPjre/kPuyK1hev1kiDeQ+UJubbf4SwDRe8c3FwmxGEkT6zG88TIq41Rtz 0ZpmdiNzIvon7IPo717z9WW7Dna+rR2oH6DJumXjbzPPoew9urowNSk0cXpatVNDEOshUC I8zaxrTApqOsj9Ey/5SSA5B8o8qzuRGgv3dOVQkRZtVq8XnB/1WYKrqMtHb9pg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718570278; a=rsa-sha256; cv=none; b=AWUlJ6LMOQJ+5RCZ1NQcy1cmgGMMxuxor5HNfLOEtaxbthxSsAJpNTGtBRprF0nKD4rbBg WRfI2XZAgUsFrIr3A8VYrwFW95LARBfPQigc7mJt4lfXxeyEj8pUQ28lffDsVcOzuBQ9JT 69ODZgOl8xbIuuE+U5sWdRyZwP/o9gh4xoFELnXFjTwm1aZj7rKD5Ztu+qGI+Z5BGG4JHY 0dpQWr2JNEUEIJBQkXrrZdFPh8reP92pJC2rwCIw2GPQXseBprvhlz6Y2fJw7CcE7u8vVE Vd51I+2JIU676DxsK1knAoDurxqFehrCUFCRIJwwU8x4jBfl8IDvkXQtmg78iw== 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=1718570278; 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=MnYFSjT4BxfsQK8ZI6FPJb1pjwy8yCC0QKyjW/yZGwY=; b=Os3OAtFe+Hk8Z4BnAvaa6xHf3tmgXtdxeFcHsITAkYndX+QtcxHcm7rs15aO6kq6R4b4dT W8CKjvKfZWyOMk1osPXK1ujL0U/MaM57tHwSwN8LkfMqkx9ZnYjSrr5Q4C1vZurpkRQIC8 ewJdXH22NGG6eNf4NqJwx+xhkDT6Xbw8Kav0pu9AisU9c01BAn10KDtDEx7Tkzima+KxpG qVuYV0kmDeCzCB8uCE9sTvSbAkc+coGE34BtieLix5w+KD5he4roEKSlaewrEGnhMJiLYs RU2KXja9Dk7wZt61oMvIRKNMS4UXzEcb2fzaq+Eg7qEV8tglDN9UVIuGxEGXdw== 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 4W2PwP6bClz12kn; Sun, 16 Jun 2024 20:37:57 +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 45GKbvMU079531; Sun, 16 Jun 2024 20:37:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45GKbvqR079528; Sun, 16 Jun 2024 20:37:57 GMT (envelope-from git) Date: Sun, 16 Jun 2024 20:37:57 GMT Message-Id: <202406162037.45GKbvqR079528@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: c0bd6ec3bb24 - main - bce: 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/main X-Git-Reftype: branch X-Git-Commit: c0bd6ec3bb2414d23f3013766b79eed51b31f696 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c0bd6ec3bb2414d23f3013766b79eed51b31f696 commit c0bd6ec3bb2414d23f3013766b79eed51b31f696 Author: Mark Johnston AuthorDate: 2024-06-05 19:22:32 +0000 Commit: Mark Johnston CommitDate: 2024-06-16 20:37:26 +0000 bce: Use device_set_descf() No functional change intended. MFC after: 1 week --- sys/dev/bce/if_bce.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c index 33158b75486c..2564d0c1dac6 100644 --- a/sys/dev/bce/if_bce.c +++ b/sys/dev/bce/if_bce.c @@ -671,7 +671,6 @@ bce_probe(device_t dev) { const struct bce_type *t; struct bce_softc *sc; - char *descbuf; u16 vid = 0, did = 0, svid = 0, sdid = 0; t = bce_devs; @@ -695,19 +694,10 @@ bce_probe(device_t dev) if ((vid == t->bce_vid) && (did == t->bce_did) && ((svid == t->bce_svid) || (t->bce_svid == PCI_ANY_ID)) && ((sdid == t->bce_sdid) || (t->bce_sdid == PCI_ANY_ID))) { - descbuf = malloc(BCE_DEVDESC_MAX, M_TEMP, M_NOWAIT); - - if (descbuf == NULL) - return(ENOMEM); - - /* Print out the device identity. */ - snprintf(descbuf, BCE_DEVDESC_MAX, "%s (%c%d)", + device_set_descf(dev, "%s (%c%d)", t->bce_name, (((pci_read_config(dev, PCIR_REVID, 4) & 0xf0) >> 4) + 'A'), (pci_read_config(dev, PCIR_REVID, 4) & 0xf)); - - device_set_desc_copy(dev, descbuf); - free(descbuf, M_TEMP); return(BUS_PROBE_DEFAULT); } t++;