From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: linux-kernel@vger.kernel.org,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
linux390@de.ibm.com, linux-s390@vger.kernel.org
Subject: Re: [PATCH] drivers: s390: remove custom implementation of hex_to_bin()
Date: Mon, 13 Sep 2010 10:04:27 +0200 [thread overview]
Message-ID: <20100913080427.GA2310@osiris.boeblingen.de.ibm.com> (raw)
In-Reply-To: <1284212198-25849-1-git-send-email-andy.shevchenko@gmail.com>
On Sat, Sep 11, 2010 at 04:36:38PM +0300, Andy Shevchenko wrote:
> diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c
> index 13cb601..76058a5 100644
> --- a/drivers/s390/cio/blacklist.c
> +++ b/drivers/s390/cio/blacklist.c
> @@ -79,17 +79,15 @@ static int pure_hex(char **cp, unsigned int *val, int min_digit,
> int max_digit, int max_val)
> {
> int diff;
> - unsigned int value;
>
> diff = 0;
> *val = 0;
>
> - while (isxdigit(**cp) && (diff <= max_digit)) {
> + while (diff <= max_digit) {
> + int value = hex_to_bin(**cp);
>
> - if (isdigit(**cp))
> - value = **cp - '0';
> - else
> - value = tolower(**cp) - 'a' + 10;
> + if (value < 0)
> + break;
> *val = *val * 16 + value;
> (*cp)++;
> diff++;
Applied, thanks!
prev parent reply other threads:[~2010-09-13 8:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-11 13:36 Andy Shevchenko
2010-09-13 8:04 ` Heiko Carstens [this message]
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=20100913080427.GA2310@osiris.boeblingen.de.ibm.com \
--to=heiko.carstens@de.ibm.com \
--cc=andy.shevchenko@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux390@de.ibm.com \
--cc=schwidefsky@de.ibm.com \
/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
all inboxes | Powered by JetHome®