mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
Use xpt_path_sbuf() in few drivers
xpt_path_string() is now a wrapper around xpt_path_sbuf(). Using it to than concatenate result to another sbuf makes no sense. Just call xpt_path_sbuf() directly. MFC after: 1 month
This commit is contained in:
parent
a3ceeef26b
commit
8c4ee0b22c
|
@ -304,7 +304,6 @@ mprsas_log_command(struct mpr_command *cm, u_int level, const char *fmt, ...)
|
||||||
struct sbuf sb;
|
struct sbuf sb;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
char str[224];
|
char str[224];
|
||||||
char path_str[64];
|
|
||||||
|
|
||||||
if (cm == NULL)
|
if (cm == NULL)
|
||||||
return;
|
return;
|
||||||
|
@ -318,9 +317,7 @@ mprsas_log_command(struct mpr_command *cm, u_int level, const char *fmt, ...)
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
|
||||||
if (cm->cm_ccb != NULL) {
|
if (cm->cm_ccb != NULL) {
|
||||||
xpt_path_string(cm->cm_ccb->csio.ccb_h.path, path_str,
|
xpt_path_sbuf(cm->cm_ccb->csio.ccb_h.path, &sb);
|
||||||
sizeof(path_str));
|
|
||||||
sbuf_cat(&sb, path_str);
|
|
||||||
if (cm->cm_ccb->ccb_h.func_code == XPT_SCSI_IO) {
|
if (cm->cm_ccb->ccb_h.func_code == XPT_SCSI_IO) {
|
||||||
scsi_command_string(&cm->cm_ccb->csio, &sb);
|
scsi_command_string(&cm->cm_ccb->csio, &sb);
|
||||||
sbuf_printf(&sb, "length %d ",
|
sbuf_printf(&sb, "length %d ",
|
||||||
|
|
|
@ -295,7 +295,6 @@ mpssas_log_command(struct mps_command *cm, u_int level, const char *fmt, ...)
|
||||||
struct sbuf sb;
|
struct sbuf sb;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
char str[224];
|
char str[224];
|
||||||
char path_str[64];
|
|
||||||
|
|
||||||
if (cm == NULL)
|
if (cm == NULL)
|
||||||
return;
|
return;
|
||||||
|
@ -309,9 +308,7 @@ mpssas_log_command(struct mps_command *cm, u_int level, const char *fmt, ...)
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
|
||||||
if (cm->cm_ccb != NULL) {
|
if (cm->cm_ccb != NULL) {
|
||||||
xpt_path_string(cm->cm_ccb->csio.ccb_h.path, path_str,
|
xpt_path_sbuf(cm->cm_ccb->csio.ccb_h.path, &sb);
|
||||||
sizeof(path_str));
|
|
||||||
sbuf_cat(&sb, path_str);
|
|
||||||
if (cm->cm_ccb->ccb_h.func_code == XPT_SCSI_IO) {
|
if (cm->cm_ccb->ccb_h.func_code == XPT_SCSI_IO) {
|
||||||
scsi_command_string(&cm->cm_ccb->csio, &sb);
|
scsi_command_string(&cm->cm_ccb->csio, &sb);
|
||||||
sbuf_printf(&sb, "length %d ",
|
sbuf_printf(&sb, "length %d ",
|
||||||
|
|
|
@ -2336,7 +2336,6 @@ vtscsi_printf_req(struct vtscsi_request *req, const char *func,
|
||||||
struct sbuf sb;
|
struct sbuf sb;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
char str[192];
|
char str[192];
|
||||||
char path_str[64];
|
|
||||||
|
|
||||||
if (req == NULL)
|
if (req == NULL)
|
||||||
return;
|
return;
|
||||||
|
@ -2352,8 +2351,7 @@ vtscsi_printf_req(struct vtscsi_request *req, const char *func,
|
||||||
cam_sim_name(sc->vtscsi_sim), cam_sim_unit(sc->vtscsi_sim),
|
cam_sim_name(sc->vtscsi_sim), cam_sim_unit(sc->vtscsi_sim),
|
||||||
cam_sim_bus(sc->vtscsi_sim));
|
cam_sim_bus(sc->vtscsi_sim));
|
||||||
} else {
|
} else {
|
||||||
xpt_path_string(ccb->ccb_h.path, path_str, sizeof(path_str));
|
xpt_path_sbuf(ccb->ccb_h.path, &sb);
|
||||||
sbuf_cat(&sb, path_str);
|
|
||||||
if (ccb->ccb_h.func_code == XPT_SCSI_IO) {
|
if (ccb->ccb_h.func_code == XPT_SCSI_IO) {
|
||||||
scsi_command_string(&ccb->csio, &sb);
|
scsi_command_string(&ccb->csio, &sb);
|
||||||
sbuf_printf(&sb, "length %d ", ccb->csio.dxfer_len);
|
sbuf_printf(&sb, "length %d ", ccb->csio.dxfer_len);
|
||||||
|
|
Loading…
Reference in a new issue