Linux wireless drivers development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: linux-wireless@vger.kernel.org
Cc: Kalle Valo <kvalo@qca.qualcomm.com>,
	"John W. Linville" <linville@tuxdriver.com>
Subject: Re: [PATCH] wireless: ath6kl: re-use native helper to parse MAC
Date: Tue, 23 Apr 2013 17:25:35 +0300	[thread overview]
Message-ID: <1366727135.7932.133.camel@smile> (raw)
In-Reply-To: <1366723941-23920-1-git-send-email-andriy.shevchenko@linux.intel.com>

On Tue, 2013-04-23 at 16:32 +0300, Andy Shevchenko wrote: 
> There is native mac_pton() function which helps to parse MAC.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/net/wireless/ath/ath6kl/debug.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
> index fe38b83..9824cb0 100644
> --- a/drivers/net/wireless/ath/ath6kl/debug.c
> +++ b/drivers/net/wireless/ath/ath6kl/debug.c
> @@ -1241,19 +1241,14 @@ static ssize_t ath6kl_force_roam_write(struct file *file,
>  	size_t len;
>  	u8 bssid[ETH_ALEN];
>  	int i;

It seems i shall be removed as well.

> -	int addr[ETH_ALEN];
>  
>  	len = min(count, sizeof(buf) - 1);
>  	if (copy_from_user(buf, user_buf, len))
>  		return -EFAULT;
>  	buf[len] = '\0';
>  
> -	if (sscanf(buf, "%02x:%02x:%02x:%02x:%02x:%02x",
> -		   &addr[0], &addr[1], &addr[2], &addr[3], &addr[4], &addr[5])
> -	    != ETH_ALEN)
> +	if (!mac_pton(buf, bssid))
>  		return -EINVAL;
> -	for (i = 0; i < ETH_ALEN; i++)
> -		bssid[i] = addr[i];
>  
>  	ret = ath6kl_wmi_force_roam_cmd(ar->wmi, bssid);
>  	if (ret)

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

      reply	other threads:[~2013-04-23 14:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-23 13:32 [PATCH] wireless: ath6kl: re-use native helper to parse MAC Andy Shevchenko
2013-04-23 14:25 ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1366727135.7932.133.camel@smile \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=kvalo@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox