scsi: qla2xxx: change some variables to hexadecimal string via %*phC or %*phN format
Subsystems (2)
PATCH 1/1 scsi: qla2xxx: change some variables to hexadecimal string via %*phC or %*phN format
The patch modifies some variables using the format '%*ph[CN]' and prints them as a hexadecimal string with the separator ':' or ''.
Signed-off-by Oleksandr Khoshaba <[email protected]>
--- drivers/scsi/qla2xxx/qla_bsg.c | 8 +--- drivers/scsi/qla2xxx/qla_gs.c | 82 ++++++------------------------------ drivers/scsi/qla2xxx/qla_init.c | 25 +++-------- drivers/scsi/qla2xxx/qla_os.c | 10 +---- drivers/scsi/qla2xxx/qla_target.c | 74 +++++++++----------------------- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 18 +++----- 6 files changed, 51 insertions(+), 166 deletions(-)
drivers/scsi/qla2xxx/qla_bsg.c +2 -6
@@ -1333,12 +1333,8 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job)if (rval) {ql_log (ql_log_warn, vha,0x704c , -"iIDMA cmd failed for %02x%02x%02x%02x%02x%02x%02x%02x -- " -"%04x %x %04x %04x.\n" , fcport->port_name[0 ], - fcport->port_name[1 ], fcport->port_name[2 ], - fcport->port_name[3 ], fcport->port_name[4 ], - fcport->port_name[5 ], fcport->port_name[6 ], - fcport->port_name[7 ], rval, fcport->fp_speed, mb[0 ], mb[1 ]); +"iIDMA cmd failed for %8phN -- %04x %x %04x %04x.\n" , + fcport->port_name, rval, fcport->fp_speed, mb[0 ], mb[1 ]); rval = (DID_ERROR <<16 ); }else {if (!port_param->mode) {
drivers/scsi/qla2xxx/qla_gs.c +14 -68
133 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_init.c +6 -19
@@ -564,12 +564,8 @@ qla2x00_initialize_adapter(scsi_qla_host_t *vha)if (ha->flags.disable_serdes) {/* Mask HBA via NVRAM settings? */ ql_log (ql_log_info, vha,0x0077 , -"Masking HBA WWPN " -"%02x%02x%02x%02x%02x%02x%02x%02x (via NVRAM).\n" , - vha->port_name[0 ], vha->port_name[1 ], - vha->port_name[2 ], vha->port_name[3 ], - vha->port_name[4 ], vha->port_name[5 ], - vha->port_name[6 ], vha->port_name[7 ]); +"Masking HBA WWPN %8phN (via NVRAM).\n" , + vha->port_name);return QLA_FUNCTION_FAILED ; }
@@ -3069,22 +3065,13 @@ qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) mb);if (rval !=QLA_SUCCESS ) {ql_dbg (ql_dbg_disc, vha,0x2004 , -"Unable to adjust iIDMA " -"%02x%02x%02x%02x%02x%02x%02x%02x -- %04x %x %04x " -"%04x.\n" , fcport->port_name[0 ], fcport->port_name[1 ], - fcport->port_name[2 ], fcport->port_name[3 ], - fcport->port_name[4 ], fcport->port_name[5 ], - fcport->port_name[6 ], fcport->port_name[7 ], rval, - fcport->fp_speed, mb[0 ], mb[1 ]); +"Unable to adjust iIDMA %8phN -- %04x %x %04x %04x.\n" , + fcport->port_name, rval, fcport->fp_speed, mb[0 ], mb[1 ]); }else {ql_dbg (ql_dbg_disc, vha,0x2005 , -"iIDMA adjusted to %s GB/s " -"on %02x%02x%02x%02x%02x%02x%02x%02x.\n" , +"iIDMA adjusted to %s GB/s on %8phN.\n" ,qla2x00_get_link_speed_str (ha, fcport->fp_speed), - fcport->port_name[0 ], fcport->port_name[1 ], - fcport->port_name[2 ], fcport->port_name[3 ], - fcport->port_name[4 ], fcport->port_name[5 ], - fcport->port_name[6 ], fcport->port_name[7 ]); + fcport->port_name); } }
drivers/scsi/qla2xxx/qla_os.c +2 -8
@@ -3214,14 +3214,8 @@ void qla2x00_mark_device_lost(scsi_qla_host_t *vha, fc_port_t *fcport,set_bit (RELOGIN_NEEDED , &vha->dpc_flags);ql_dbg (ql_dbg_disc, vha,0x2067 , -"Port login retry " -"%02x%02x%02x%02x%02x%02x%02x%02x, " -"id = 0x%04x retry cnt=%d.\n" , - fcport->port_name[0 ], fcport->port_name[1 ], - fcport->port_name[2 ], fcport->port_name[3 ], - fcport->port_name[4 ], fcport->port_name[5 ], - fcport->port_name[6 ], fcport->port_name[7 ], - fcport->loop_id, fcport->login_retry); +"Port login retry %8phN, id = 0x%04x retry cnt=%d.\n" , + fcport->port_name, fcport->loop_id, fcport->login_retry); } }
drivers/scsi/qla2xxx/qla_target.c +21 -53
117 lines not on this page · raw message
drivers/scsi/qla2xxx/tcm_qla2xxx.c +6 -12
@@ -1424,9 +1424,7 @@ static int tcm_qla2xxx_check_initiator_node_acl(* match the format by tcm_qla2xxx explict ConfigFS NodeACLs. */ memset (&port_name,0 ,36 ); -snprintf (port_name,36 ,"%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x" , - fc_wwpn[0 ], fc_wwpn[1 ], fc_wwpn[2 ], fc_wwpn[3 ], fc_wwpn[4 ], - fc_wwpn[5 ], fc_wwpn[6 ], fc_wwpn[7 ]); +snprintf (port_name,36 ,"%8phC" , fc_wwpn);/* * Locate our struct se_node_acl either from an explict NodeACL created * via ConfigFS, or via running in TPG demo mode.
@@ -1470,15 +1468,11 @@ static void tcm_qla2xxx_update_sess(struct qla_tgt_sess *sess, port_id_t s_id,if (sess->loop_id != loop_id || sess->s_id.b24 != s_id.b24) -pr_info ("Updating session %p from port %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x loop_id %d -> %d s_id %x:%x:%x -> %x:%x:%x\n" , - sess, - sess->port_name[0 ], sess->port_name[1 ], - sess->port_name[2 ], sess->port_name[3 ], - sess->port_name[4 ], sess->port_name[5 ], - sess->port_name[6 ], sess->port_name[7 ], - sess->loop_id, loop_id, - sess->s_id.b.domain, sess->s_id.b.area, sess->s_id.b.al_pa, - s_id.b.domain, s_id.b.area, s_id.b.al_pa); +pr_info ("Updating session %p from port %8phC loop_id %d -> %d s_id %x:%x:%x -> %x:%x:%x\n" , + sess, sess->port_name, sess->loop_id, loop_id, + sess->s_id.b.domain, sess->s_id.b.area, + sess->s_id.b.al_pa, s_id.b.domain, s_id.b.area, + s_id.b.al_pa);if (sess->loop_id != loop_id) {/*
Signature · 1 line
1.7.9.5