From patchwork Fri Jul 23 13:18:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 59785 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id AD718B70E3 for ; Fri, 23 Jul 2010 23:21:49 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760036Ab0GWNUn (ORCPT ); Fri, 23 Jul 2010 09:20:43 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:54478 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754021Ab0GWNSr (ORCPT ); Fri, 23 Jul 2010 09:18:47 -0400 Received: by fxm14 with SMTP id 14so5007896fxm.19 for ; Fri, 23 Jul 2010 06:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references:in-reply-to:references; bh=xtI2YnbjyW2JijXW8keurzZP0/1mD3i9fw44rhscn/I=; b=lZAooJ7oAjgl1IIUrmrWhtfIY83krr/kpjlMUI3IRWiH6t8ZvwsYYtZ6+3+J7p++yd seF8GCrbsYnZ0f1ybeeDwo9cyWJ8IWYruN7bflTkiE3cGqtmO7oViC+Or1t3FPYf/leY yQf1C0DiUhzNFA3C59ejxCwpBLUyCMUon6Khg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=jvPpjobfPW/DveSzBw4gLpgomu8P/488Jv/vbx4gtHvSo5WEpOpOX+1R69Ha1JOfri Wx6p1SGFS1X6eZTWkQa+3q5sH1734SJWue7DKKyYbkFy39zg8SyoGYu+394+c4couw3a KEQHXAs4HGubZ6mNKs38Y1tyD7O+gzT16ekGM= Received: by 10.223.109.2 with SMTP id h2mr3270566fap.95.1279891125665; Fri, 23 Jul 2010 06:18:45 -0700 (PDT) Received: from localhost.localdomain (79-134-110-189.cust.suomicom.fi [79.134.110.189]) by mx.google.com with ESMTPS id q17sm86672faa.21.2010.07.23.06.18.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 23 Jul 2010 06:18:45 -0700 (PDT) From: Andy Shevchenko To: "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Chas Williams , linux-atm-general@lists.sourceforge.net Subject: [PATCH 1/5] drivers: atm: don't use private copy of hex_to_bin() Date: Fri, 23 Jul 2010 16:18:06 +0300 Message-Id: <244718f934418c4a183e91e333de95ed07c501d4.1279890832.git.andy.shevchenko@gmail.com> X-Mailer: git-send-email 1.7.1.1 In-Reply-To: References: In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Andy Shevchenko Cc: Chas Williams Cc: linux-atm-general@lists.sourceforge.net --- drivers/atm/nicstar.c | 15 ++------------- 1 files changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c index 729a149..2f3516b 100644 --- a/drivers/atm/nicstar.c +++ b/drivers/atm/nicstar.c @@ -154,7 +154,6 @@ static void which_list(ns_dev * card, struct sk_buff *skb); #endif static void ns_poll(unsigned long arg); static int ns_parse_mac(char *mac, unsigned char *esi); -static short ns_h2i(char c); static void ns_phy_put(struct atm_dev *dev, unsigned char value, unsigned long addr); static unsigned char ns_phy_get(struct atm_dev *dev, unsigned long addr); @@ -2824,9 +2823,9 @@ static int ns_parse_mac(char *mac, unsigned char *esi) return -1; j = 0; for (i = 0; i < 6; i++) { - if ((byte1 = ns_h2i(mac[j++])) < 0) + if ((byte1 = hex_to_bin(mac[j++])) < 0) return -1; - if ((byte0 = ns_h2i(mac[j++])) < 0) + if ((byte0 = hex_to_bin(mac[j++])) < 0) return -1; esi[i] = (unsigned char)(byte1 * 16 + byte0); if (i < 5) { @@ -2837,16 +2836,6 @@ static int ns_parse_mac(char *mac, unsigned char *esi) return 0; } -static short ns_h2i(char c) -{ - if (c >= '0' && c <= '9') - return (short)(c - '0'); - if (c >= 'A' && c <= 'F') - return (short)(c - 'A' + 10); - if (c >= 'a' && c <= 'f') - return (short)(c - 'a' + 10); - return -1; -} static void ns_phy_put(struct atm_dev *dev, unsigned char value, unsigned long addr)