From: Andy Shevchenko Date: Thu, 15 Jan 2015 11:28:07 +0000 (+0200) Subject: tcm_qla2xxx: print port name via %*phC X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3c9786e59515ed18153bfa4a36e0a2e762c0dc68;p=openwrt%2Fstaging%2Fblogic.git tcm_qla2xxx: print port name via %*phC Instead of pushing each byte via stack let's use custom specifier which allows to print small buffers as a hex string. Signed-off-by: Andy Shevchenko Signed-off-by: Nicholas Bellinger --- diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index 73f9feecda72..99f43b7fc9ab 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -1570,9 +1570,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, sizeof(port_name), "%8phC", fc_wwpn); /* * Locate our struct se_node_acl either from an explict NodeACL created * via ConfigFS, or via running in TPG demo mode.