From: Andy Shevchenko Date: Thu, 15 Jan 2015 11:40:04 +0000 (+0200) Subject: usb: gadget: ethernet: re-use %pM specifier to print MAC X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=27f387059bedc3c4b3eb5b4c8bfe229dba59ce24;p=openwrt%2Fstaging%2Fblogic.git usb: gadget: ethernet: re-use %pM specifier to print MAC Instead of custom approach the patch converts code to use %pM specifier to print MAC. Signed-off-by: Andy Shevchenko Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c index 6e6f87656e7b..f1fd777ef4ec 100644 --- a/drivers/usb/gadget/function/u_ether.c +++ b/drivers/usb/gadget/function/u_ether.c @@ -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; }