Re: [PATCH] scsi: qla2xxx: print port name via %*phC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Acked-by: Saurav Kashyap <saurav.kashyap@xxxxxxxxxx>


>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 <andriy.shevchenko@xxxxxxxxxxxxxxx>
>---
> drivers/scsi/qla2xxx/tcm_qla2xxx.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
>diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
>b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
>index 68fb66fd..c9b2421 100644
>--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
>+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
>@@ -1492,9 +1492,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.
>-- 
>1.9.2
>

<<attachment: winmail.dat>>


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux