[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <c1ca828fb308042aa32428b345abcb43ccb02c39.1272617852.git.ext-andriy.shevchenko@nokia.com>
Date: Fri, 30 Apr 2010 12:34:03 +0300
From: Andy Shevchenko <ext-andriy.shevchenko@...ia.com>
To: linux-kernel@...r.kernel.org
Cc: Andy Shevchenko <ext-andriy.shevchenko@...ia.com>,
Greg Kroah-Hartman <gregkh@...e.de>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH 04/10] drivers: net: use new hex_to_bin() method
Instead of using own implementation involve hex_to_bin() function. It requires
to have hex_to_bin() introduced by starter patch in series.
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@...ia.com>
Cc: Greg Kroah-Hartman <gregkh@...e.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>
---
drivers/net/sb1250-mac.c | 32 ++------------------------------
1 files changed, 2 insertions(+), 30 deletions(-)
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c
index 9944e5d..34f8753 100644
--- a/drivers/net/sb1250-mac.c
+++ b/drivers/net/sb1250-mac.c
@@ -2184,34 +2184,6 @@ static void sbmac_setmulti(struct sbmac_softc *sc)
#if defined(SBMAC_ETH0_HWADDR) || defined(SBMAC_ETH1_HWADDR) || defined(SBMAC_ETH2_HWADDR) || defined(SBMAC_ETH3_HWADDR)
/**********************************************************************
- * SBMAC_PARSE_XDIGIT(str)
- *
- * Parse a hex digit, returning its value
- *
- * Input parameters:
- * str - character
- *
- * Return value:
- * hex value, or -1 if invalid
- ********************************************************************* */
-
-static int sbmac_parse_xdigit(char str)
-{
- int digit;
-
- if ((str >= '0') && (str <= '9'))
- digit = str - '0';
- else if ((str >= 'a') && (str <= 'f'))
- digit = str - 'a' + 10;
- else if ((str >= 'A') && (str <= 'F'))
- digit = str - 'A' + 10;
- else
- return -1;
-
- return digit;
-}
-
-/**********************************************************************
* SBMAC_PARSE_HWADDR(str,hwaddr)
*
* Convert a string in the form xx:xx:xx:xx:xx:xx into a 6-byte
@@ -2231,7 +2203,7 @@ static int sbmac_parse_hwaddr(char *str, unsigned char *hwaddr)
int idx = 6;
while (*str && (idx > 0)) {
- digit1 = sbmac_parse_xdigit(*str);
+ digit1 = hex_to_bin(*str);
if (digit1 < 0)
return -1;
str++;
@@ -2243,7 +2215,7 @@ static int sbmac_parse_hwaddr(char *str, unsigned char *hwaddr)
digit1 = 0;
}
else {
- digit2 = sbmac_parse_xdigit(*str);
+ digit2 = hex_to_bin(*str);
if (digit2 < 0)
return -1;
str++;
--
1.6.3.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists