wireless: airo: re-use mac_pton()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 27 Nov 2015 16:29:31 +0000 (18:29 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 30 Nov 2015 12:59:28 +0000 (14:59 +0200)
mac_pton() converts 6-byte MAC / BSSID to binary format. Change an open coded
variant by the generic one.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/cisco/airo.c

index 17c40f06f13e585a96e5e0db137d25534eae1036..d2353f6e52140bf5b9a3de656859afc34221f7c6 100644 (file)
@@ -5137,21 +5137,9 @@ static void proc_APList_on_close( struct inode *inode, struct file *file ) {
        memset(APList_rid, 0, sizeof(*APList_rid));
        APList_rid->len = cpu_to_le16(sizeof(*APList_rid));
 
-       for( i = 0; i < 4 && data->writelen >= (i+1)*6*3; i++ ) {
-               int j;
-               for( j = 0; j < 6*3 && data->wbuffer[j+i*6*3]; j++ ) {
-                       switch(j%3) {
-                       case 0:
-                               APList_rid->ap[i][j/3]=
-                                       hex_to_bin(data->wbuffer[j+i*6*3])<<4;
-                               break;
-                       case 1:
-                               APList_rid->ap[i][j/3]|=
-                                       hex_to_bin(data->wbuffer[j+i*6*3]);
-                               break;
-                       }
-               }
-       }
+       for (i = 0; i < 4 && data->writelen >= (i + 1) * 6 * 3; i++)
+               mac_pton(data->wbuffer + i * 6 * 3, APList_rid->ap[i]);
+
        disable_MAC(ai, 1);
        writeAPListRid(ai, APList_rid, 1);
        enable_MAC(ai, 1);