From nobody Thu Jun 30 16:15:39 2022 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 A28908A39FD; Thu, 30 Jun 2022 16:15:40 +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 4LYk2h0ZpNz3QW4; Thu, 30 Jun 2022 16:15:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656605740; 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=9MQvVlt21VUm1VAeNjsMGxE+FkiZ+prBuohW9d4WuCw=; b=RikJupMB/1FY0BjVIFn+zebLH65uUioJx/kNRv7+YuaZab2jTFa/R/XLJtIkG4QJDSczFU Gi177tOdswe+A25BP1fVYWRBC0DD4Ao6BFNmSVK+BFVshGRGLffZyJk2TWqx4EqTDVPCbL f8mCw4mAt3+1+wppYza8NFJEcPuDgy/1JGzxMkBd2fnVzk7/ZD4LsQBUiURsLJMbbH+0Ga iBX4KGSnPvL6tBpabmhxphQck1O8v4F6AvYMsey7CydkTh/M3nbFu/HL5+cO++2UOkUCqu fHoQUqnsSvcwYXbtnOKQVh647t3VqbL28vT5uAz4UvwYxIaQLJmsLYxUfxkWbg== 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 D644B196D; Thu, 30 Jun 2022 16:15:39 +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 25UGFdqq014895; Thu, 30 Jun 2022 16:15:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25UGFd4J014894; Thu, 30 Jun 2022 16:15:39 GMT (envelope-from git) Date: Thu, 30 Jun 2022 16:15:39 GMT Message-Id: <202206301615.25UGFd4J014894@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: 755e60ca0463 - main - ena: Use device_set_desc in probe 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 755e60ca046390bdcfc097b6a8f1a032d47a7b65 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656605740; 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=9MQvVlt21VUm1VAeNjsMGxE+FkiZ+prBuohW9d4WuCw=; b=aUTmNZeLvQiukPlv0yT6S6QMmx7e3zK7Kaz8DbNqdWkSMBlswyRhU6SU1fobVDusn6CCSV pK1KATqVIALxrMoxTIm0lI3D7kmG//IjiCQ/ubZ/vWNkrG9PsUoXBx6Lg9JvyaSIgTke8d 63PpUqkIn6OUUTxqiha8IUbhZ6YV+EfTQFfKIaMIRaW0DluiNQuf/VlMBcrb75s0oKy0Py iQvQ6ZsNw27nVKmT/5b8fOjFaVMA07H1/HJee8D8tEOK6nVI2w/F4o54MDtYLi7Z2Zkz7X atNPY7gI1r/lCxVCJr3zFX3YRI3j0mqQQteOikZlf4d5F8PbmBJRBbdVI+e6Bg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656605740; a=rsa-sha256; cv=none; b=h/+TDIgkEohMvwpD9bw6UPp0ttrCZRrWVUyCiChwoOrrfUiytuDkQvcyQKM+oBoksU+dmG XMLnDOQa7ee+o+bSeb/8vbIxNOrlxVNQPpQodupJbgdBgHRlR0zaBX7E3NhhuOAulKajPq U/Bt1C8TzAdTWGdl4yvw3DFoSlG3ThHQywFaXyniO2iqp4bifpAF6r0s88M+lwuAM4Q3Bj L9kRLlSc4lwEJR2mjubnzU2UxJp0ALLDqQSLpvuh3tjzKlHWKqpehTd2tWjuTYZYJCfhho PicEs6d3tcoeBtIXYvTQUJfurDImTMTbyAX31oJV1p9WJ0ImEMyX8D+vc3jAPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=755e60ca046390bdcfc097b6a8f1a032d47a7b65 commit 755e60ca046390bdcfc097b6a8f1a032d47a7b65 Author: Dawid Gorecki AuthorDate: 2022-06-10 09:18:10 +0000 Commit: Marcin Wojtas CommitDate: 2022-06-30 15:32:01 +0000 ena: Use device_set_desc in probe During probe the driver created a temporary buffer to which the value of DEVICE_DESC constant was printed. This buffer was then copied to the device structure using device_set_desc_copy. Since the value of this string is exactly the same for every device using the ENA driver, using sprintf is unnecessary, and device_set_desc can be used instead. Obtained from: Semihalf MFC after: 2 weeks Sponsored by: Amazon, Inc. --- sys/dev/ena/ena.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index e5854dc4d140..1ec3d3b2b6ef 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -296,7 +296,6 @@ static int ena_probe(device_t dev) { ena_vendor_info_t *ent; - char adapter_name[60]; uint16_t pci_vendor_id = 0; uint16_t pci_device_id = 0; @@ -310,8 +309,7 @@ ena_probe(device_t dev) ena_log_raw(DBG, "vendor=%x device=%x\n", pci_vendor_id, pci_device_id); - sprintf(adapter_name, DEVICE_DESC); - device_set_desc_copy(dev, adapter_name); + device_set_desc(dev, DEVICE_DESC); return (BUS_PROBE_DEFAULT); }