From patchwork Thu Jul 14 21:29:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Franky Lin X-Patchwork-Id: 976262 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6ELVkmm009900 for ; Thu, 14 Jul 2011 21:31:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932469Ab1GNVbb (ORCPT ); Thu, 14 Jul 2011 17:31:31 -0400 Received: from mms1.broadcom.com ([216.31.210.17]:4281 "EHLO mms1.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932387Ab1GNV34 (ORCPT ); Thu, 14 Jul 2011 17:29:56 -0400 Received: from [10.9.200.133] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Thu, 14 Jul 2011 14:34:50 -0700 X-Server-Uuid: 02CED230-5797-4B57-9875-D5D2FEE4708A Received: from mail-irva-13.broadcom.com (10.11.16.103) by IRVEXCHHUB02.corp.ad.broadcom.com (10.9.200.133) with Microsoft SMTP Server id 8.2.247.2; Thu, 14 Jul 2011 14:29:23 -0700 Received: from mail-sj1-12.sj.broadcom.com (mail-sj1-12.sj.broadcom.com [10.17.16.106]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 3107774D06; Thu, 14 Jul 2011 14:29:37 -0700 (PDT) Received: from lc-sj1-3560.broadcom.com (lc-sj1-3560.sj.broadcom.com [10.17.194.250]) by mail-sj1-12.sj.broadcom.com (Postfix) with ESMTP id 39FB620521; Thu, 14 Jul 2011 14:29:34 -0700 (PDT) Received: by lc-sj1-3560.broadcom.com (Postfix, from userid 25250) id 726B72C19D25; Thu, 14 Jul 2011 14:29:31 -0700 (PDT) From: "Franky Lin" To: gregkh@suse.de cc: devel@linuxdriverproject.org, linux-wireless@vger.kernel.org Subject: [PATCH 26/35] staging: brcm80211: use mac_pton() instead of own implementation Date: Thu, 14 Jul 2011 14:29:22 -0700 Message-ID: <1310678971-28952-27-git-send-email-frankyl@broadcom.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1310678971-28952-1-git-send-email-frankyl@broadcom.com> References: <1310678971-28952-1-git-send-email-frankyl@broadcom.com> MIME-Version: 1.0 X-WSS-ID: 6201BF733B420695917-05-01 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 14 Jul 2011 21:31:46 +0000 (UTC) From: Arend van Spriel The function brcmu_ether_atoe() does exactly the same as mac_pton(). The driver now uses the latter and brcmu_ether_atoe() has been removed as it is not used anymore. Signed-off-by: Arend van Spriel Reviewed-by: Roland Vossen --- drivers/staging/brcm80211/brcmsmac/main.c | 5 +++-- drivers/staging/brcm80211/brcmutil/utils.c | 15 --------------- drivers/staging/brcm80211/include/brcmu_utils.h | 3 --- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c index 85d161c..ebcb7e8 100644 --- a/drivers/staging/brcm80211/brcmsmac/main.c +++ b/drivers/staging/brcm80211/brcmsmac/main.c @@ -15,6 +15,7 @@ */ #include +#include #include #include #include @@ -4584,8 +4585,8 @@ int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device, uint unit, err = 21; goto fail; } - brcmu_ether_atoe(macaddr, wlc_hw->etheraddr); - if (is_broadcast_ether_addr(wlc_hw->etheraddr) || + if (!mac_pton(macaddr, wlc_hw->etheraddr) || + is_broadcast_ether_addr(wlc_hw->etheraddr) || is_zero_ether_addr(wlc_hw->etheraddr)) { wiphy_err(wiphy, "wl%d: brcms_b_attach: bad macaddr %s\n", unit, macaddr); diff --git a/drivers/staging/brcm80211/brcmutil/utils.c b/drivers/staging/brcm80211/brcmutil/utils.c index cad1600..2151e0b 100644 --- a/drivers/staging/brcm80211/brcmutil/utils.c +++ b/drivers/staging/brcm80211/brcmutil/utils.c @@ -350,21 +350,6 @@ struct sk_buff *brcmu_pktq_mdeq(struct pktq *pq, uint prec_bmp, } EXPORT_SYMBOL(brcmu_pktq_mdeq); -/* parse a xx:xx:xx:xx:xx:xx format ethernet address */ -int brcmu_ether_atoe(char *p, u8 *ea) -{ - int i = 0; - - for (;;) { - ea[i++] = (char)simple_strtoul(p, &p, 16); - if (!*p++ || i == 6) - break; - } - - return i == 6; -} -EXPORT_SYMBOL(brcmu_ether_atoe); - #if defined(BCMDBG) /* pretty hex print a pkt buffer chain */ void brcmu_prpkt(const char *msg, struct sk_buff *p0) diff --git a/drivers/staging/brcm80211/include/brcmu_utils.h b/drivers/staging/brcm80211/include/brcmu_utils.h index 8a340f0..513fa34 100644 --- a/drivers/staging/brcm80211/include/brcmu_utils.h +++ b/drivers/staging/brcm80211/include/brcmu_utils.h @@ -133,9 +133,6 @@ extern uint brcmu_pktfrombuf(struct sk_buff *p, uint offset, int len, unsigned char *buf); extern uint brcmu_pkttotlen(struct sk_buff *p); -/* ethernet address */ -extern int brcmu_ether_atoe(char *p, u8 *ea); - /* ip address */ struct ipv4_addr;