From nobody Tue Aug 1 22:26:07 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 4RFqT16czVz4pwW7; 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 4RFqSw1LXQz3hrx; Tue, 1 Aug 2023 22:26:08 +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=dU2P6pW/G5Fbi2k2rwSpAGyTWpDjvj3PL2A/5YUSkwg=; b=opD4t0tC6CR73KWOxiU5kP7TaDoB0Vn486bN4mV0mXn5KmY9J1sZuBljJ/BX3DE/kwja+V OhGHE0Qb6Rn7LmuamlCBjCUrCptQsc29r6QWrnENxlOf7mL1L90MyGNNfQ1WB9XjLkLU0t hUA7UG8MrPlr+EDKUSk2GcFXgCV6hRODBbwsdeCtk7p56e08encHS5n4sSCakKxupbOaAl 1V2ZPodMEpUcH28rnQ3hYpTO29yktXjLG/w7jaiOY/q89R6e/B9v1+djavE3fv1z4z66qd Xy+GO7Na3/4wF7OyznE3GwjLN8ulUxMLGSGzjhwKuogxaVUaki7vldPagOluDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690928768; a=rsa-sha256; cv=none; b=puxrGxdA3O3xlzSOoIbuw9wx63EtN/G0u1azfrHryf6qseh5Hxs3fTDXOkH/KUunaqo02C Dx3qgxT0Ai7RmYQgSgrsvUQzOwiOmphgw23BJpp3aq/hz7SRPp8WNmM7/MS0adS05m3jaN S7NKY54buT340q78Bxa6oFMUi3PxnNU/kDShvC1Px3l1hdkDvToFPjkPitC5u+B/rVYF41 ZNXdGhEkgTjZuZwTPb4kJ3JOqsGS1BTVYGDCnuK+h2O4UVVR45kjbbTO7PMWhOf6Ys4J3/ V+9r6BqQS9WSTnPE5Ls6aje79jObjjVCQK9M96ALfc0qpxyG+WeuufAgIfxmEg== 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=dU2P6pW/G5Fbi2k2rwSpAGyTWpDjvj3PL2A/5YUSkwg=; b=DyCIbU1Qpr0+oYKqshp4uzNxSL0RzOJ+t3HQKraj7HbwIRWFpUrK4doJS3KsJqrk0bfxFt IPIaANH39PZkIHn2juZTdBA6QBAG1zvqQtpaEcA73BXud5LnpIt1WG4MYXPNx/ycWwmZC6 J9CNNJsqzH5vRs6XV++oJjkkLTB9QTNADFePjBaFggGv8zBhM87kbmyQswUqS1ipXOyd3P B4xwGb/VFYWYK0HPkqwUI5VwQW9PSY+cdVJpq1Mgm4ED0mrdeKUZXn1jmY0731UueIOUbL bg4LFhxbOHfFpEqsqY4ILVCW7wgW3wacQqW3iO01Ze8Gh9pYbJWQXx05E/cH8g== 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 4RFqSv6VgrzvSk; 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 371MQ7FM045565; Tue, 1 Aug 2023 22:26:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 371MQ7Rh045564; Tue, 1 Aug 2023 22:26:07 GMT (envelope-from git) Date: Tue, 1 Aug 2023 22:26:07 GMT Message-Id: <202308012226.371MQ7Rh045564@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: 76b2e3907ced - main - cam xpt_*nounce_periph*: Various fixes for periphs without a protocol 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: 76b2e3907cede6456897d2f950911d45ae627d8b Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=76b2e3907cede6456897d2f950911d45ae627d8b commit 76b2e3907cede6456897d2f950911d45ae627d8b Author: John Baldwin AuthorDate: 2023-08-01 22:20:25 +0000 Commit: John Baldwin CommitDate: 2023-08-01 22:20:25 +0000 cam xpt_*nounce_periph*: Various fixes for periphs without a protocol If the periph doesn't have a valid protocol, these routines emit fallback messages. However, the fallback messages duplicated the periph name and unit number, and in the case of *denounce* included a spurious newline. Reviewed by: mav, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D41177 --- sys/cam/cam_xpt.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index b85da5f30a3b..61d24c120841 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -1067,9 +1067,7 @@ xpt_announce_periph(struct cam_periph *periph, char *announce_string) if (proto) proto->ops->announce(path->device); else - printf("%s%d: Unknown protocol device %d\n", - periph->periph_name, periph->unit_number, - path->device->protocol); + printf("Unknown protocol device %d\n", path->device->protocol); if (path->device->serial_num_len > 0) { /* Don't wrap the screen - print only the first 60 chars */ printf("%s%d: Serial Number %.60s\n", periph->periph_name, @@ -1124,8 +1122,7 @@ xpt_announce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb, if (proto) proto->ops->announce_sbuf(path->device, sb); else - sbuf_printf(sb, "%s%d: Unknown protocol device %d\n", - periph->periph_name, periph->unit_number, + sbuf_printf(sb, "Unknown protocol device %d\n", path->device->protocol); if (path->device->serial_num_len > 0) { /* Don't wrap the screen - print only the first 60 chars */ @@ -1191,9 +1188,7 @@ xpt_denounce_periph(struct cam_periph *periph) if (proto) proto->ops->denounce(path->device); else - printf("%s%d: Unknown protocol device %d\n", - periph->periph_name, periph->unit_number, - path->device->protocol); + printf("Unknown protocol device %d", path->device->protocol); if (path->device->serial_num_len > 0) printf(" s/n %.60s", path->device->serial_num); printf(" detached\n"); @@ -1231,8 +1226,7 @@ xpt_denounce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb) if (proto) proto->ops->denounce_sbuf(path->device, sb); else - sbuf_printf(sb, "%s%d: Unknown protocol device %d\n", - periph->periph_name, periph->unit_number, + sbuf_printf(sb, "Unknown protocol device %d", path->device->protocol); if (path->device->serial_num_len > 0) sbuf_printf(sb, " s/n %.60s", path->device->serial_num);