diff mbox

[v3,1/6] scsi: fnic: use kernel's '%pM' format option to print MAC

Message ID 20161022173231.170417-2-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Andy Shevchenko Oct. 22, 2016, 5:32 p.m. UTC
Instead of supplying each byte through stack let's use %pM specifier.

Cc: Hiral Patel <hiralpat@cisco.com>
Cc: Suma Ramars <sramars@cisco.com>
Acked-by: Tom Tucker <tom@opengridcomputing.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/scsi/fnic/vnic_dev.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Comments

Ewan Milne Oct. 24, 2016, 12:29 p.m. UTC | #1
On Sat, 2016-10-22 at 20:32 +0300, Andy Shevchenko wrote:
> Instead of supplying each byte through stack let's use %pM specifier.
> 
> Cc: Hiral Patel <hiralpat@cisco.com>
> Cc: Suma Ramars <sramars@cisco.com>
> Acked-by: Tom Tucker <tom@opengridcomputing.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/scsi/fnic/vnic_dev.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/scsi/fnic/vnic_dev.c b/drivers/scsi/fnic/vnic_dev.c
> index 9795d6f..ba69d61 100644
> --- a/drivers/scsi/fnic/vnic_dev.c
> +++ b/drivers/scsi/fnic/vnic_dev.c
> @@ -499,10 +499,7 @@ void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
>  
>  	err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a0, &a1, wait);
>  	if (err)
> -		printk(KERN_ERR
> -			"Can't add addr [%02x:%02x:%02x:%02x:%02x:%02x], %d\n",
> -			addr[0], addr[1], addr[2], addr[3], addr[4], addr[5],
> -			err);
> +		pr_err("Can't add addr [%pM], %d\n", addr, err);
>  }
>  
>  void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
> @@ -517,10 +514,7 @@ void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
>  
>  	err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a0, &a1, wait);
>  	if (err)
> -		printk(KERN_ERR
> -			"Can't del addr [%02x:%02x:%02x:%02x:%02x:%02x], %d\n",
> -			addr[0], addr[1], addr[2], addr[3], addr[4], addr[5],
> -			err);
> +		pr_err("Can't del addr [%pM], %d\n", addr, err);
>  }
>  
>  int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr)

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


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/scsi/fnic/vnic_dev.c b/drivers/scsi/fnic/vnic_dev.c
index 9795d6f..ba69d61 100644
--- a/drivers/scsi/fnic/vnic_dev.c
+++ b/drivers/scsi/fnic/vnic_dev.c
@@ -499,10 +499,7 @@  void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
 
 	err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a0, &a1, wait);
 	if (err)
-		printk(KERN_ERR
-			"Can't add addr [%02x:%02x:%02x:%02x:%02x:%02x], %d\n",
-			addr[0], addr[1], addr[2], addr[3], addr[4], addr[5],
-			err);
+		pr_err("Can't add addr [%pM], %d\n", addr, err);
 }
 
 void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
@@ -517,10 +514,7 @@  void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
 
 	err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a0, &a1, wait);
 	if (err)
-		printk(KERN_ERR
-			"Can't del addr [%02x:%02x:%02x:%02x:%02x:%02x], %d\n",
-			addr[0], addr[1], addr[2], addr[3], addr[4], addr[5],
-			err);
+		pr_err("Can't del addr [%pM], %d\n", addr, err);
 }
 
 int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr)