Re: [PATCH 1/1] scsi: qla4xxx: change some variables to hexadecimal string via %pm, %pmR and %pM formats

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

 



-----Original Message-----
From: Oleksandr Khoshaba <oleksandr.khoshaba@xxxxxxxxx>
Date: Saturday 6 July 2013 12:10 PM
To: scsi <linux-scsi@xxxxxxxxxxxxxxx>, Dept-Eng Linux Driver
<Linux-Driver@xxxxxxxxxx>, "James E.J. Bottomley"
<JBottomley@xxxxxxxxxxxxx>, Saurav Kashyap <saurav.kashyap@xxxxxxxxxx>
Cc: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>, Oleksandr Khoshaba
<Oleksandr.Khoshaba@xxxxxxxxx>
Subject: [PATCH 1/1] scsi: qla4xxx: change some variables to hexadecimal
string via %pm, %pmR and %pM  formats

>The patch modifies some variables using the formats '%pm', '%pmR', '%pM'
>and prints them as a hexadecimal string with the '' and ':'  separators.
>
>Signed-off-by: Oleksandr Khoshaba <Oleksandr.Khoshaba@xxxxxxxxx>
>---
> drivers/scsi/qla4xxx/ql4_mbx.c |    6 ++----
> drivers/scsi/qla4xxx/ql4_nx.c  |    8 ++------
> drivers/scsi/qla4xxx/ql4_os.c  |   15 ++++-----------
> 3 files changed, 8 insertions(+), 21 deletions(-)
>
>diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c
>b/drivers/scsi/qla4xxx/ql4_mbx.c
>index a501bea..004ada6 100644
>--- a/drivers/scsi/qla4xxx/ql4_mbx.c
>+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
>@@ -1837,10 +1837,8 @@ int qla4xxx_set_param_ddbentry(struct
>scsi_qla_host *ha,
> 	ptid = (uint16_t *)&fw_ddb_entry->isid[1];
> 	*ptid = cpu_to_le16((uint16_t)ddb_entry->sess->target_id);
> 
>-	DEBUG2(ql4_printk(KERN_INFO, ha, "ISID [%02x%02x%02x%02x%02x%02x]\n",
>-			  fw_ddb_entry->isid[5], fw_ddb_entry->isid[4],
>-			  fw_ddb_entry->isid[3], fw_ddb_entry->isid[2],
>-			  fw_ddb_entry->isid[1], fw_ddb_entry->isid[0]));
>+	DEBUG2(ql4_printk(KERN_INFO, ha, "ISID [%pmR]\n",
>+			  fw_ddb_entry->isid));
> 
> 	iscsi_opts = le16_to_cpu(fw_ddb_entry->iscsi_options);
> 	memset(fw_ddb_entry->iscsi_alias, 0, sizeof(fw_ddb_entry->iscsi_alias));
>diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
>index eaf00c1..2bc1046 100644
>--- a/drivers/scsi/qla4xxx/ql4_nx.c
>+++ b/drivers/scsi/qla4xxx/ql4_nx.c
>@@ -3455,12 +3455,8 @@ int qla4_8xxx_get_sys_info(struct scsi_qla_host
>*ha)
> 	ha->phy_port_num = sys_info->port_num;
> 	ha->iscsi_pci_func_cnt = sys_info->iscsi_pci_func_cnt;
> 
>-	DEBUG2(printk("scsi%ld: %s: "
>-	    "mac %02x:%02x:%02x:%02x:%02x:%02x "
>-	    "serial %s\n", ha->host_no, __func__,
>-	    ha->my_mac[0], ha->my_mac[1], ha->my_mac[2],
>-	    ha->my_mac[3], ha->my_mac[4], ha->my_mac[5],
>-	    ha->serial_number));
>+	DEBUG2(printk("scsi%ld: %s: mac %pM serial %s\n", ha->host_no,
>+	    __func__, ha->my_mac, ha->serial_number));
> 
> 	status = QLA_SUCCESS;
> 
>diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
>index b246b3c..2797b8f 100644
>--- a/drivers/scsi/qla4xxx/ql4_os.c
>+++ b/drivers/scsi/qla4xxx/ql4_os.c
>@@ -4786,13 +4786,9 @@ static int qla4xxx_compare_tuple_ddb(struct
>scsi_qla_host *ha,
> 	 * ISID would not match firmware generated ISID.
> 	 */
> 	if (is_isid_compare) {
>-		DEBUG2(ql4_printk(KERN_INFO, ha, "%s: old ISID [%02x%02x%02x"
>-			"%02x%02x%02x] New ISID [%02x%02x%02x%02x%02x%02x]\n",
>-			__func__, old_tddb->isid[5], old_tddb->isid[4],
>-			old_tddb->isid[3], old_tddb->isid[2], old_tddb->isid[1],
>-			old_tddb->isid[0], new_tddb->isid[5], new_tddb->isid[4],
>-			new_tddb->isid[3], new_tddb->isid[2], new_tddb->isid[1],
>-			new_tddb->isid[0]));
>+		DEBUG2(ql4_printk(KERN_INFO, ha,
>+			"%s: old ISID [%pmR] New ISID [%pmR]\n",
>+			__func__, old_tddb->isid, new_tddb->isid));
> 
> 		if (memcmp(&old_tddb->isid[0], &new_tddb->isid[0],
> 			   sizeof(old_tddb->isid)))
>@@ -6211,10 +6207,7 @@ qla4xxx_sysfs_ddb_get_param(struct
>iscsi_bus_flash_session *fnode_sess,
> 		rc = sprintf(buf, "%u\n", fnode_conn->keepalive_timeout);
> 		break;
> 	case ISCSI_FLASHNODE_ISID:
>-		rc = sprintf(buf, "%02x%02x%02x%02x%02x%02x\n",
>-			     fnode_sess->isid[0], fnode_sess->isid[1],
>-			     fnode_sess->isid[2], fnode_sess->isid[3],
>-			     fnode_sess->isid[4], fnode_sess->isid[5]);
>+		rc = sprintf(buf, "%pm\n", fnode_sess->isid);
> 		break;
> 	case ISCSI_FLASHNODE_TSID:
> 		rc = sprintf(buf, "%u\n", fnode_sess->tsid);
>-- 
>1.7.9.5


Thanks for the patch.
Acked-by: Vikas Chaudhary <vikas.chaudhary@xxxxxxxxxx>

<<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