From nobody Tue Aug 01 22:26:06 2023 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 4RFqT14rYfz4pwqp; Tue, 1 Aug 2023 22:26:09 +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 4RFqSw0Qvjz3hrw; Tue, 1 Aug 2023 22:26:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690928768; 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=vy1mzvYzQ9BAV2HDD54hDTrWw2zinA/J5G/73yNLbEA=; b=VkJcnKCoG3nje5RvuXkN9oXBosjxiBq8+S/2yoa4xETdgtrq9iBlURphw835mDg2vJe656 I4unZL4fJ0pUBZp/3RgPFC3BUq8MoFu7K1IfieUx0IfrvGSqWw9LBHNHsyFMDx4qKEgnWO RqyI7zuhxTIqgEoTPHpFo0mARoEeF34JDjvTP6gAPcM1HoJeHWsY46AAAetSWvXT3cSO8w N4tJ1uS+Uk60f3s6SgXaAjrbLz7INR/lYiJ22/VHoQtkeDjuQ80E5+r6mH1nYNWcL/hVQG sZ7Ll3bMuV6R3mrtKRVB9l+Xhb+1U2UAp0Db+ZudEIv3pJ6fMEbdHO7O6PZmsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690928768; a=rsa-sha256; cv=none; b=GOnMvd6cLuZ37ZN9+7+3gsqDp1AJSF6ITf9C9ZxWuy1kshZNyHDQrJI5vyedyLktSqzTdF ZPbDaxjMWzJy3DQKUIDPcUy4QfVS+kUNMyE9X/j0UINxqY4tSnE1qtlDsQAl0wcpj/3gmC eUjdnhEI39W0Flhtc/zkYmjqhmuV+5Dhiy6+YOkeb0lEmV44ybeCAQ4YKsCEtSuhvto6vp JO9CEY9ax8Xulo1YMDF+kl+4tpZLp7cJtFUHbIhMAZ5h4u7BZrlxmH24YkNJlUomSBEQNN pNbVg7ysvxSrlXXFjO6x36E4aQvcUExYvK55i/EiL6SXbnMuiMVXCv3uf0e3nQ== 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=1690928768; 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=vy1mzvYzQ9BAV2HDD54hDTrWw2zinA/J5G/73yNLbEA=; b=vx4RSylIJ/dG9Kq7ADkM8NEg20i1ztGrEJ4Qh5NfAeTRuBPscSYsxUi8Gr32tDq/GPp8M7 TTyf0ar6vPh254oQAm/MMg+FUne9Nek7J0B8oJte6sPUQ2SrZEisxssXm2VzS2a0eIdXxN sjGunmIHFgn3z0NPLnVrI+4nrZy138mCjt2nsMQVTcTV0Qjh7H264aET+CF154zfMokduo ltCweXYRzSfsP+2gVoo8yfAJMPJ7SHqttkl2Eeos/dMBVK1it/vcJFollXP4clYU/u2uYw L8Lmnxpc83QdzMXufDF3WCqmPmG3/bC8uphr5Yx4qQR5JexXfxMYI3FQ/M+YOg== 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 4RFqSv4t98zvd6; Tue, 1 Aug 2023 22:26:07 +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 371MQ616045540; Tue, 1 Aug 2023 22:26:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 371MQ6wP045539; Tue, 1 Aug 2023 22:26:06 GMT (envelope-from git) Date: Tue, 1 Aug 2023 22:26:06 GMT Message-Id: <202308012226.371MQ6wP045539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 0be27bde5f67 - main - cam/nvme: Remove spurious newline during periph detach announcement 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0be27bde5f673fc89643ea460b9cb94fc3316dd1 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0be27bde5f673fc89643ea460b9cb94fc3316dd1 commit 0be27bde5f673fc89643ea460b9cb94fc3316dd1 Author: John Baldwin AuthorDate: 2023-08-01 22:19:50 +0000 Commit: John Baldwin CommitDate: 2023-08-01 22:19:50 +0000 cam/nvme: Remove spurious newline during periph detach announcement Other protocol denounce routines use a "short" variant of announce that does not include a trailing newline. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D41176 --- sys/cam/nvme/nvme_all.c | 9 ++++++++- sys/cam/nvme/nvme_all.h | 2 ++ sys/cam/nvme/nvme_xpt.c | 7 ++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/sys/cam/nvme/nvme_all.c b/sys/cam/nvme/nvme_all.c index 0ab37b861ca2..5350dbd1bcdb 100644 --- a/sys/cam/nvme/nvme_all.c +++ b/sys/cam/nvme/nvme_all.c @@ -89,7 +89,14 @@ void nvme_print_ident(const struct nvme_controller_data *cdata, const struct nvme_namespace_data *data, struct sbuf *sb) { + nvme_print_ident_short(cdata, data, sb); + sbuf_printf(sb, "\n"); +} +void +nvme_print_ident_short(const struct nvme_controller_data *cdata, + const struct nvme_namespace_data *data, struct sbuf *sb) +{ sbuf_printf(sb, "<"); cam_strvis_sbuf(sb, cdata->mn, sizeof(cdata->mn), CAM_STRVIS_FLAG_NONASCII_SPC); @@ -99,7 +106,7 @@ nvme_print_ident(const struct nvme_controller_data *cdata, sbuf_printf(sb, " "); cam_strvis_sbuf(sb, cdata->sn, sizeof(cdata->sn), CAM_STRVIS_FLAG_NONASCII_SPC); - sbuf_printf(sb, ">\n"); + sbuf_printf(sb, ">"); } /* XXX need to do nvme admin opcodes too, but those aren't used yet by nda */ diff --git a/sys/cam/nvme/nvme_all.h b/sys/cam/nvme/nvme_all.h index ef932fd8efc3..9bdbeb219a90 100644 --- a/sys/cam/nvme/nvme_all.h +++ b/sys/cam/nvme/nvme_all.h @@ -42,6 +42,8 @@ int nvme_identify_match(caddr_t identbuffer, caddr_t table_entry); struct sbuf; void nvme_print_ident(const struct nvme_controller_data *, const struct nvme_namespace_data *, struct sbuf *); +void nvme_print_ident_short(const struct nvme_controller_data *, + const struct nvme_namespace_data *, struct sbuf *); const char *nvme_op_string(const struct nvme_command *, int admin); const char *nvme_cmd_string(const struct nvme_command *, char *, size_t); void nvme_cmd_sbuf(const struct nvme_command *, struct sbuf *sb); diff --git a/sys/cam/nvme/nvme_xpt.c b/sys/cam/nvme/nvme_xpt.c index 3222ec1e9dc3..0662f476536c 100644 --- a/sys/cam/nvme/nvme_xpt.c +++ b/sys/cam/nvme/nvme_xpt.c @@ -838,8 +838,13 @@ nvme_proto_announce(struct cam_ed *device) static void nvme_proto_denounce(struct cam_ed *device) { + struct sbuf sb; + char buffer[120]; - nvme_proto_announce(device); + sbuf_new(&sb, buffer, sizeof(buffer), SBUF_FIXEDLEN); + nvme_print_ident_short(device->nvme_cdata, device->nvme_data, &sb); + sbuf_finish(&sb); + sbuf_putbuf(&sb); } static void