[SCSI] libfc: set both precision and field with when printing FC IDs

Most of the prints of fabric IDs were specified as %6x, which will not
print any leading 0s.  It's nice to see leading 0s for identifiers
like this, which are a fixed length.  This patch sets the precision
modifier as well, making the specifier %6.6x, which forces the
printing of leading 0s.

Signed-off-by: Chris Leech <christopher.leech@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:
Chris Leech 2010-04-09 14:23:10 -07:00 committed by James Bottomley
parent 63ac4bbffb
commit ce8b5df042
4 changed files with 21 additions and 21 deletions

View File

@ -132,7 +132,7 @@ static void fc_disc_recv_rscn_req(struct fc_seq *sp, struct fc_frame *fp,
switch (fmt) { switch (fmt) {
case ELS_ADDR_FMT_PORT: case ELS_ADDR_FMT_PORT:
FC_DISC_DBG(disc, "Port address format for port " FC_DISC_DBG(disc, "Port address format for port "
"(%6x)\n", ntoh24(pp->rscn_fid)); "(%6.6x)\n", ntoh24(pp->rscn_fid));
dp = kzalloc(sizeof(*dp), GFP_KERNEL); dp = kzalloc(sizeof(*dp), GFP_KERNEL);
if (!dp) { if (!dp) {
redisc = 1; redisc = 1;
@ -449,7 +449,7 @@ static int fc_disc_gpn_ft_parse(struct fc_disc *disc, void *buf, size_t len)
} else { } else {
printk(KERN_WARNING "libfc: Failed to allocate " printk(KERN_WARNING "libfc: Failed to allocate "
"memory for the newly discovered port " "memory for the newly discovered port "
"(%6x)\n", ids.port_id); "(%6.6x)\n", ids.port_id);
error = -ENOMEM; error = -ENOMEM;
} }
} }
@ -607,7 +607,7 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
rdata->ids.port_name = port_name; rdata->ids.port_name = port_name;
else if (rdata->ids.port_name != port_name) { else if (rdata->ids.port_name != port_name) {
FC_DISC_DBG(disc, "GPN_ID accepted. WWPN changed. " FC_DISC_DBG(disc, "GPN_ID accepted. WWPN changed. "
"Port-id %x wwpn %llx\n", "Port-id %6.6x wwpn %llx\n",
rdata->ids.port_id, port_name); rdata->ids.port_id, port_name);
lport->tt.rport_logoff(rdata); lport->tt.rport_logoff(rdata);

View File

@ -489,7 +489,7 @@ crc_err:
/* per cpu count, not total count, but OK for limit */ /* per cpu count, not total count, but OK for limit */
if (stats->InvalidCRCCount++ < 5) if (stats->InvalidCRCCount++ < 5)
printk(KERN_WARNING "libfc: CRC error on data " printk(KERN_WARNING "libfc: CRC error on data "
"frame for port (%6x)\n", "frame for port (%6.6x)\n",
fc_host_port_id(lport->host)); fc_host_port_id(lport->host));
put_cpu(); put_cpu();
/* /*
@ -894,7 +894,7 @@ static void fc_fcp_resp(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
return; return;
} }
fsp->status_code = FC_DATA_OVRRUN; fsp->status_code = FC_DATA_OVRRUN;
FC_FCP_DBG(fsp, "tgt %6x xfer len %zx greater than expected, " FC_FCP_DBG(fsp, "tgt %6.6x xfer len %zx greater than expected, "
"len %x, data len %x\n", "len %x, data len %x\n",
fsp->rport->port_id, fsp->rport->port_id,
fsp->xfer_len, expected_len, fsp->data_len); fsp->xfer_len, expected_len, fsp->data_len);
@ -1562,7 +1562,7 @@ static void fc_fcp_rec_error(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
break; break;
default: default:
FC_FCP_DBG(fsp, "REC %p fid %x error unexpected error %d\n", FC_FCP_DBG(fsp, "REC %p fid %6.6x error unexpected error %d\n",
fsp, fsp->rport->port_id, error); fsp, fsp->rport->port_id, error);
fsp->status_code = FC_CMD_PLOGO; fsp->status_code = FC_CMD_PLOGO;
/* fall through */ /* fall through */
@ -1572,7 +1572,7 @@ static void fc_fcp_rec_error(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
* Assume REC or LS_ACC was lost. * Assume REC or LS_ACC was lost.
* The exchange manager will have aborted REC, so retry. * The exchange manager will have aborted REC, so retry.
*/ */
FC_FCP_DBG(fsp, "REC fid %x error error %d retry %d/%d\n", FC_FCP_DBG(fsp, "REC fid %6.6x error error %d retry %d/%d\n",
fsp->rport->port_id, error, fsp->recov_retry, fsp->rport->port_id, error, fsp->recov_retry,
FC_MAX_RECOV_RETRY); FC_MAX_RECOV_RETRY);
if (fsp->recov_retry++ < FC_MAX_RECOV_RETRY) if (fsp->recov_retry++ < FC_MAX_RECOV_RETRY)
@ -2053,7 +2053,7 @@ int fc_eh_device_reset(struct scsi_cmnd *sc_cmd)
if (lport->state != LPORT_ST_READY) if (lport->state != LPORT_ST_READY)
return rc; return rc;
FC_SCSI_DBG(lport, "Resetting rport (%6x)\n", rport->port_id); FC_SCSI_DBG(lport, "Resetting rport (%6.6x)\n", rport->port_id);
fsp = fc_fcp_pkt_alloc(lport, GFP_NOIO); fsp = fc_fcp_pkt_alloc(lport, GFP_NOIO);
if (fsp == NULL) { if (fsp == NULL) {
@ -2101,11 +2101,11 @@ int fc_eh_host_reset(struct scsi_cmnd *sc_cmd)
if (fc_fcp_lport_queue_ready(lport)) { if (fc_fcp_lport_queue_ready(lport)) {
shost_printk(KERN_INFO, shost, "libfc: Host reset succeeded " shost_printk(KERN_INFO, shost, "libfc: Host reset succeeded "
"on port (%6x)\n", fc_host_port_id(lport->host)); "on port (%6.6x)\n", fc_host_port_id(lport->host));
return SUCCESS; return SUCCESS;
} else { } else {
shost_printk(KERN_INFO, shost, "libfc: Host reset failed, " shost_printk(KERN_INFO, shost, "libfc: Host reset failed, "
"port (%6x) is not ready.\n", "port (%6.6x) is not ready.\n",
fc_host_port_id(lport->host)); fc_host_port_id(lport->host));
return FAILED; return FAILED;
} }
@ -2191,7 +2191,7 @@ void fc_fcp_destroy(struct fc_lport *lport)
if (!list_empty(&si->scsi_pkt_queue)) if (!list_empty(&si->scsi_pkt_queue))
printk(KERN_ERR "libfc: Leaked SCSI packets when destroying " printk(KERN_ERR "libfc: Leaked SCSI packets when destroying "
"port (%6x)\n", fc_host_port_id(lport->host)); "port (%6.6x)\n", fc_host_port_id(lport->host));
mempool_destroy(si->scsi_pkt_pool); mempool_destroy(si->scsi_pkt_pool);
kfree(si); kfree(si);

View File

@ -45,7 +45,7 @@ extern unsigned int fc_debug_logging;
#define FC_LPORT_DBG(lport, fmt, args...) \ #define FC_LPORT_DBG(lport, fmt, args...) \
FC_CHECK_LOGGING(FC_LPORT_LOGGING, \ FC_CHECK_LOGGING(FC_LPORT_LOGGING, \
printk(KERN_INFO "host%u: lport %6x: " fmt, \ printk(KERN_INFO "host%u: lport %6.6x: " fmt, \
(lport)->host->host_no, \ (lport)->host->host_no, \
fc_host_port_id((lport)->host), ##args)) fc_host_port_id((lport)->host), ##args))
@ -57,7 +57,7 @@ extern unsigned int fc_debug_logging;
#define FC_RPORT_ID_DBG(lport, port_id, fmt, args...) \ #define FC_RPORT_ID_DBG(lport, port_id, fmt, args...) \
FC_CHECK_LOGGING(FC_RPORT_LOGGING, \ FC_CHECK_LOGGING(FC_RPORT_LOGGING, \
printk(KERN_INFO "host%u: rport %6x: " fmt, \ printk(KERN_INFO "host%u: rport %6.6x: " fmt, \
(lport)->host->host_no, \ (lport)->host->host_no, \
(port_id), ##args)) (port_id), ##args))
@ -66,7 +66,7 @@ extern unsigned int fc_debug_logging;
#define FC_FCP_DBG(pkt, fmt, args...) \ #define FC_FCP_DBG(pkt, fmt, args...) \
FC_CHECK_LOGGING(FC_FCP_LOGGING, \ FC_CHECK_LOGGING(FC_FCP_LOGGING, \
printk(KERN_INFO "host%u: fcp: %6x: " fmt, \ printk(KERN_INFO "host%u: fcp: %6.6x: " fmt, \
(pkt)->lp->host->host_no, \ (pkt)->lp->host->host_no, \
pkt->rport->port_id, ##args)) pkt->rport->port_id, ##args))

View File

@ -172,7 +172,7 @@ static void fc_lport_rport_callback(struct fc_lport *lport,
struct fc_rport_priv *rdata, struct fc_rport_priv *rdata,
enum fc_rport_event event) enum fc_rport_event event)
{ {
FC_LPORT_DBG(lport, "Received a %d event for port (%6x)\n", event, FC_LPORT_DBG(lport, "Received a %d event for port (%6.6x)\n", event,
rdata->ids.port_id); rdata->ids.port_id);
mutex_lock(&lport->lp_mutex); mutex_lock(&lport->lp_mutex);
@ -183,7 +183,7 @@ static void fc_lport_rport_callback(struct fc_lport *lport,
fc_lport_enter_ns(lport, LPORT_ST_RNN_ID); fc_lport_enter_ns(lport, LPORT_ST_RNN_ID);
} else { } else {
FC_LPORT_DBG(lport, "Received an READY event " FC_LPORT_DBG(lport, "Received an READY event "
"on port (%6x) for the directory " "on port (%6.6x) for the directory "
"server, but the lport is not " "server, but the lport is not "
"in the DNS state, it's in the " "in the DNS state, it's in the "
"%d state", rdata->ids.port_id, "%d state", rdata->ids.port_id,
@ -575,7 +575,7 @@ void __fc_linkup(struct fc_lport *lport)
*/ */
void fc_linkup(struct fc_lport *lport) void fc_linkup(struct fc_lport *lport)
{ {
printk(KERN_INFO "host%d: libfc: Link up on port (%6x)\n", printk(KERN_INFO "host%d: libfc: Link up on port (%6.6x)\n",
lport->host->host_no, fc_host_port_id(lport->host)); lport->host->host_no, fc_host_port_id(lport->host));
mutex_lock(&lport->lp_mutex); mutex_lock(&lport->lp_mutex);
@ -605,7 +605,7 @@ void __fc_linkdown(struct fc_lport *lport)
*/ */
void fc_linkdown(struct fc_lport *lport) void fc_linkdown(struct fc_lport *lport)
{ {
printk(KERN_INFO "host%d: libfc: Link down on port (%6x)\n", printk(KERN_INFO "host%d: libfc: Link down on port (%6.6x)\n",
lport->host->host_no, fc_host_port_id(lport->host)); lport->host->host_no, fc_host_port_id(lport->host));
mutex_lock(&lport->lp_mutex); mutex_lock(&lport->lp_mutex);
@ -707,7 +707,7 @@ void fc_lport_disc_callback(struct fc_lport *lport, enum fc_disc_event event)
break; break;
case DISC_EV_FAILED: case DISC_EV_FAILED:
printk(KERN_ERR "host%d: libfc: " printk(KERN_ERR "host%d: libfc: "
"Discovery failed for port (%6x)\n", "Discovery failed for port (%6.6x)\n",
lport->host->host_no, fc_host_port_id(lport->host)); lport->host->host_no, fc_host_port_id(lport->host));
mutex_lock(&lport->lp_mutex); mutex_lock(&lport->lp_mutex);
fc_lport_enter_reset(lport); fc_lport_enter_reset(lport);
@ -753,7 +753,7 @@ static void fc_lport_set_port_id(struct fc_lport *lport, u32 port_id,
struct fc_frame *fp) struct fc_frame *fp)
{ {
if (port_id) if (port_id)
printk(KERN_INFO "host%d: Assigned Port ID %6x\n", printk(KERN_INFO "host%d: Assigned Port ID %6.6x\n",
lport->host->host_no, port_id); lport->host->host_no, port_id);
fc_host_port_id(lport->host) = port_id; fc_host_port_id(lport->host) = port_id;
@ -1499,7 +1499,7 @@ void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,
lport->r_a_tov = 2 * e_d_tov; lport->r_a_tov = 2 * e_d_tov;
fc_lport_set_port_id(lport, did, fp); fc_lport_set_port_id(lport, did, fp);
printk(KERN_INFO "host%d: libfc: " printk(KERN_INFO "host%d: libfc: "
"Port (%6x) entered " "Port (%6.6x) entered "
"point-to-point mode\n", "point-to-point mode\n",
lport->host->host_no, did); lport->host->host_no, did);
fc_lport_ptp_setup(lport, ntoh24(fh->fh_s_id), fc_lport_ptp_setup(lport, ntoh24(fh->fh_s_id),