usb: gadget: ethernet: re-use %pM specifier to print MAC
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 15 Jan 2015 11:40:04 +0000 (13:40 +0200)
committerFelipe Balbi <balbi@ti.com>
Mon, 19 Jan 2015 18:53:32 +0000 (12:53 -0600)
Instead of custom approach the patch converts code to use %pM specifier to
print MAC.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/function/u_ether.c

index 6e6f87656e7b0f5795caa17f387aa6cf89de2d41..f1fd777ef4ec6bcf3bb233074c3aab53d62493a3 100644 (file)
@@ -729,9 +729,7 @@ static int get_ether_addr_str(u8 dev_addr[ETH_ALEN], char *str, int len)
        if (len < 18)
                return -EINVAL;
 
-       snprintf(str, len, "%02x:%02x:%02x:%02x:%02x:%02x",
-                dev_addr[0], dev_addr[1], dev_addr[2],
-                dev_addr[3], dev_addr[4], dev_addr[5]);
+       snprintf(str, len, "%pM", dev_addr);
        return 18;
 }
 
This page took 0.030655 seconds and 5 git commands to generate.