usb: gadget: use %pm to print mac addresses
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 6 Jul 2012 15:30:21 +0000 (18:30 +0300)
committerFelipe Balbi <balbi@ti.com>
Thu, 23 Aug 2012 08:04:20 +0000 (11:04 +0300)
%pm already provides pretty print for mac addresses, let's
use that and drop homebrew mac address printing.

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

index 30b908f2a53da7a42b285aad2311a249fda3b776..95bc94f8e57066a743428571707540d71775e751 100644 (file)
@@ -897,10 +897,7 @@ ecm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
                return -ENOMEM;
 
        /* export host's Ethernet address in CDC format */
-       snprintf(ecm->ethaddr, sizeof ecm->ethaddr,
-               "%02X%02X%02X%02X%02X%02X",
-               ethaddr[0], ethaddr[1], ethaddr[2],
-               ethaddr[3], ethaddr[4], ethaddr[5]);
+       snprintf(ecm->ethaddr, sizeof ecm->ethaddr, "%pm", ethaddr);
        ecm_string_defs[1].s = ecm->ethaddr;
 
        ecm->port.cdc_filter = DEFAULT_FILTER;
index aab8eded045b0281aba42ce0844570b25c3396a7..b651b529c67f070dcd4a545cea8cfc40010602f3 100644 (file)
@@ -1346,10 +1346,7 @@ int __init ncm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
                return -ENOMEM;
 
        /* export host's Ethernet address in CDC format */
-       snprintf(ncm->ethaddr, sizeof ncm->ethaddr,
-               "%02X%02X%02X%02X%02X%02X",
-               ethaddr[0], ethaddr[1], ethaddr[2],
-               ethaddr[3], ethaddr[4], ethaddr[5]);
+       snprintf(ncm->ethaddr, sizeof ncm->ethaddr, "%pm", ethaddr);
        ncm_string_defs[1].s = ncm->ethaddr;
 
        spin_lock_init(&ncm->lock);
index 21ab474aca07ae266a44bc43b3e42dc184a6f318..4060c0bd9785cf5a033b2e30981374fd0cdc5fb0 100644 (file)
@@ -436,10 +436,7 @@ int geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
                return -ENOMEM;
 
        /* export host's Ethernet address in CDC format */
-       snprintf(geth->ethaddr, sizeof geth->ethaddr,
-               "%02X%02X%02X%02X%02X%02X",
-               ethaddr[0], ethaddr[1], ethaddr[2],
-               ethaddr[3], ethaddr[4], ethaddr[5]);
+       snprintf(geth->ethaddr, sizeof geth->ethaddr, "%pm", ethaddr);
        geth_string_defs[1].s = geth->ethaddr;
 
        geth->port.cdc_filter = DEFAULT_FILTER;