linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] wireless: airo: re-use mac_pton()
@ 2015-11-18 14:16 Andy Shevchenko
  2015-11-26 13:32 ` Kalle Valo
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2015-11-18 14:16 UTC (permalink / raw)
  To: linux-wireless, Kalle Valo; +Cc: Andy Shevchenko

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>
---
 drivers/net/wireless/airo.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 17c40f0..7ad78e5 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -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);
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] wireless: airo: re-use mac_pton()
  2015-11-18 14:16 [PATCH 1/1] wireless: airo: re-use mac_pton() Andy Shevchenko
@ 2015-11-26 13:32 ` Kalle Valo
  2015-11-27  9:53   ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Kalle Valo @ 2015-11-26 13:32 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-wireless

Andy Shevchenko <andriy.shevchenko@linux.intel.com> writes:

> 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>

This breaks compilation:

  CC [M]  drivers/net/wireless/cisco/airo.o
drivers/net/wireless/cisco/airo.c: In function ‘proc_APList_on_close’:
drivers/net/wireless/cisco/airo.c:5141:49: error: request for member ‘ap’ in something not a structure or union

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] wireless: airo: re-use mac_pton()
  2015-11-26 13:32 ` Kalle Valo
@ 2015-11-27  9:53   ` Andy Shevchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2015-11-27  9:53 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless

On Thu, 2015-11-26 at 15:32 +0200, Kalle Valo wrote:
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> writes:
> 
> > 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>
> 
> This breaks compilation:
> 
>   CC [M]  drivers/net/wireless/cisco/airo.o
> drivers/net/wireless/cisco/airo.c: In function
> ‘proc_APList_on_close’:
> drivers/net/wireless/cisco/airo.c:5141:49: error: request for member
> ‘ap’ in something not a structure or union

Sorry for that, seems rebase issue since it was an old fix in my local
tree.

Seems it should be
  mac_pton(data->wbuffer + i * 6 * 3, APList_rid->ap[i]);

I will send updated version later.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-27  9:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-18 14:16 [PATCH 1/1] wireless: airo: re-use mac_pton() Andy Shevchenko
2015-11-26 13:32 ` Kalle Valo
2015-11-27  9:53   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).