scsi: fnic: use kernel's '%pM' format option to print MAC
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Sat, 22 Oct 2016 17:32:26 +0000 (20:32 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2020 07:19:41 +0000 (08:19 +0100)
[ Upstream commit 36fe90b0f0bdc9d030e88ba2153f3c8d6b6a5964 ]

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>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/fnic/vnic_dev.c

index 9795d6f3e1974e47e98f6d28ef80f1e4f282e528..ba69d6112fa13d34bc6acda465521797a04ee94c 100644 (file)
@@ -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)