From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Subject: [PATCH 08/12] net: use new hex_to_bin() method
Date: Thu, 18 Feb 2010 20:55:47 +0200 [thread overview]
Message-ID: <1266519351-3218-9-git-send-email-andy.shevchenko@gmail.com> (raw)
In-Reply-To: <1266519351-3218-8-git-send-email-andy.shevchenko@gmail.com>
From: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Instead of using own implementation involve hex_to_bin() function. It requires
to have hex_to_bin() introduced by one of previous path in series.
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
---
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 564d4d7..87c57cb 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.5.6.5
next prev parent reply other threads:[~2010-02-18 18:59 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-18 18:55 [PATCH 00/12] Clean up code to use native kernel functions when convert or check hex digits Andy Shevchenko
2010-02-18 18:55 ` [PATCH 01/12] isdn: remove ishexdigit() in regard to isxdigit() Andy Shevchenko
2010-02-18 18:55 ` [PATCH 02/12] audit: use kernel's method to get byte in hex form Andy Shevchenko
2010-02-18 18:55 ` [PATCH 03/12] staging: remove unused methods Andy Shevchenko
2010-02-18 18:55 ` [PATCH 04/12] scsi: ibmmca: use kernel native convertor Andy Shevchenko
2010-02-18 18:55 ` [PATCH 05/12] lib: introduce common method to convert hex digits Andy Shevchenko
2010-02-18 18:55 ` [PATCH 06/12] drivers: net: optimize hex2bin() Andy Shevchenko
2010-02-18 18:55 ` [PATCH 07/12] usb: atm: speedtch: use new hex_to_bin() method Andy Shevchenko
2010-02-18 18:55 ` Andy Shevchenko [this message]
2010-02-18 18:55 ` [PATCH 09/12] drivers: net: use kernel's method to get byte in hex form Andy Shevchenko
2010-02-18 18:55 ` [PATCH 10/12] drivers: net: use new hex_to_bin() method Andy Shevchenko
2010-02-18 18:55 ` [PATCH 11/12] drivers: isdn: " Andy Shevchenko
2010-02-18 18:55 ` [PATCH 12/12] drivers: wireless: use kernel's method to get byte in hex form Andy Shevchenko
2010-02-18 23:55 ` [PATCH 11/12] drivers: isdn: use new hex_to_bin() method Tilman Schmidt
2010-02-19 9:53 ` [PATCHv2] " Andy Shevchenko
2010-02-19 14:53 ` [PATCH 03/12] staging: remove unused methods Greg KH
2010-02-22 20:21 ` [PATCH 02/12] audit: use kernel's method to get byte in hex form Eric Paris
2010-02-22 21:18 ` Andy Shevchenko
2010-02-18 23:36 ` [PATCH 01/12] isdn: remove ishexdigit() in regard to isxdigit() Tilman Schmidt
2010-02-19 11:41 ` [PATCH 00/12] Clean up code to use native kernel functions when convert or check hex digits Andy Shevchenko
2010-02-19 23:44 ` Tilman Schmidt
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=1266519351-3218-9-git-send-email-andy.shevchenko@gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=ext-andriy.shevchenko@nokia.com \
--cc=linux-kernel@vger.kernel.org \
/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
Powered by JetHome