All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ewan D. Milne" <emilne@redhat.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org,
	"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
	Oleksandr Khoshaba <oleksandr.khoshaba@gmail.com>,
	QLogic-Storage-Upstream@qlogic.com
Subject: Re: [PATCH v3 3/6] scsi: qla4xxx: print MAC and SID via %p[mM][R]
Date: Mon, 24 Oct 2016 08:34:37 -0400	[thread overview]
Message-ID: <1477312477.17595.2.camel@localhost.localdomain> (raw)
In-Reply-To: <20161022173231.170417-4-andriy.shevchenko@linux.intel.com>

On Sat, 2016-10-22 at 20:32 +0300, Andy Shevchenko wrote:
> From: Oleksandr Khoshaba <oleksandr.khoshaba@gmail.com>
> 
> In the kernel we have nice specifier to print MAC by given pointer to the
> address in a binary form.
> 
> Signed-off-by: Oleksandr Khoshaba <Oleksandr.Khoshaba@gmail.com>
> Acked-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
> Cc: QLogic-Storage-Upstream@qlogic.com
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/scsi/qla4xxx/ql4_mbx.c |  5 +----
>  drivers/scsi/qla4xxx/ql4_nx.c  |  8 ++------
>  drivers/scsi/qla4xxx/ql4_os.c  | 15 ++++-----------
>  3 files changed, 7 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
> index c291fdf..1da04f3 100644
> --- a/drivers/scsi/qla4xxx/ql4_mbx.c
> +++ b/drivers/scsi/qla4xxx/ql4_mbx.c
> @@ -2032,10 +2032,7 @@ 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 06ddd13..bccd8b6 100644
> --- a/drivers/scsi/qla4xxx/ql4_nx.c
> +++ b/drivers/scsi/qla4xxx/ql4_nx.c
> @@ -4094,12 +4094,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 01c3610..9fbb33f 100644
> --- a/drivers/scsi/qla4xxx/ql4_os.c
> +++ b/drivers/scsi/qla4xxx/ql4_os.c
> @@ -6304,13 +6304,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)))
> @@ -7925,10 +7921,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);

Reviewed-by: Ewan D. Milne <emilne@redhat.com>



  reply	other threads:[~2016-10-24 12:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-22 17:32 [PATCH v3 0/6] scsi: collection of clean ups Andy Shevchenko
2016-10-22 17:32 ` [PATCH v3 1/6] scsi: fnic: use kernel's '%pM' format option to print MAC Andy Shevchenko
2016-10-24 12:29   ` Ewan D. Milne
2016-10-22 17:32 ` [PATCH v3 2/6] fusion: print lan address via %pMR Andy Shevchenko
2016-10-24 12:32   ` Ewan D. Milne
2016-10-22 17:32 ` [PATCH v3 3/6] scsi: qla4xxx: print MAC and SID via %p[mM][R] Andy Shevchenko
2016-10-24 12:34   ` Ewan D. Milne [this message]
2016-10-22 17:32 ` [PATCH v3 4/6] [SCSI] ips: don't use custom hex_asc_upper[] table Andy Shevchenko
2016-10-24 12:34   ` Ewan D. Milne
2016-10-22 17:32 ` [PATCH v3 5/6] scsi: replace custom approach to hexdump small buffers Andy Shevchenko
2016-10-24 12:35   ` Ewan D. Milne
2016-10-22 17:32 ` [PATCH v3 6/6] cciss: replace custom function to hexdump Andy Shevchenko
2016-10-25  2:12 ` [PATCH v3 0/6] scsi: collection of clean ups Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1477312477.17595.2.camel@localhost.localdomain \
    --to=emilne@redhat.com \
    --cc=QLogic-Storage-Upstream@qlogic.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=oleksandr.khoshaba@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.