From patchwork Tue Apr 23 13:32:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 2477631 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 5D1493FD1A for ; Tue, 23 Apr 2013 13:32:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756211Ab3DWNc1 (ORCPT ); Tue, 23 Apr 2013 09:32:27 -0400 Received: from mga09.intel.com ([134.134.136.24]:13779 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756176Ab3DWNc1 (ORCPT ); Tue, 23 Apr 2013 09:32:27 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 23 Apr 2013 06:30:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,533,1363158000"; d="scan'208";a="322991786" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.173]) by orsmga002.jf.intel.com with ESMTP; 23 Apr 2013 06:32:24 -0700 Received: from andy by smile with local (Exim 4.80) (envelope-from ) id 1UUdKY-0006Ee-Cc; Tue, 23 Apr 2013 16:32:22 +0300 From: Andy Shevchenko To: linux-wireless@vger.kernel.org, Kalle Valo , "John W. Linville" Cc: Andy Shevchenko Subject: [PATCH] wireless: ath6kl: re-use native helper to parse MAC Date: Tue, 23 Apr 2013 16:32:21 +0300 Message-Id: <1366723941-23920-1-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 1.8.2.rc0.22.gb3600c3 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org There is native mac_pton() function which helps to parse MAC. Signed-off-by: Andy Shevchenko --- 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; - 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)