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
This commit is contained in:
John Baldwin
2023-08-01 15:19:50 -07:00
parent 323a94afb6
commit 0be27bde5f
3 changed files with 16 additions and 2 deletions
+8 -1
View File
@@ -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 */
+2
View File
@@ -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);
+6 -1
View File
@@ -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