mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org,
	Trond Myklebust <Trond.Myklebust@netapp.com>,
	linux-nfs@vger.kernel.org
Subject: Re: [PATCHv1.5 2/3] sunrpc/cache: don't use custom hex_to_bin() converter
Date: Wed, 22 Sep 2010 15:03:40 -0400	[thread overview]
Message-ID: <20100922190340.GF26903@fieldses.org> (raw)
In-Reply-To: <9ff9c1f334999e0128fe6426aaad4e9d465f310f.1285051188.git.andy.shevchenko@gmail.com>

On Tue, Sep 21, 2010 at 09:40:25AM +0300, Andy Shevchenko wrote:
> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
> Cc: linux-nfs@vger.kernel.org

Thanks, applied for 2.6.37.

--b.

> ---
>  net/sunrpc/cache.c |   20 +++++++++++++-------
>  1 files changed, 13 insertions(+), 7 deletions(-)
> 
> diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
> index 5b7b56f..c944a24 100644
> --- a/net/sunrpc/cache.c
> +++ b/net/sunrpc/cache.c
> @@ -1171,13 +1171,19 @@ int qword_get(char **bpp, char *dest, int bufsize)
>  	if (bp[0] == '\\' && bp[1] == 'x') {
>  		/* HEX STRING */
>  		bp += 2;
> -		while (isxdigit(bp[0]) && isxdigit(bp[1]) && len < bufsize) {
> -			int byte = isdigit(*bp) ? *bp-'0' : toupper(*bp)-'A'+10;
> -			bp++;
> -			byte <<= 4;
> -			byte |= isdigit(*bp) ? *bp-'0' : toupper(*bp)-'A'+10;
> -			*dest++ = byte;
> -			bp++;
> +		while (len < bufsize) {
> +			int h, l;
> +
> +			h = hex_to_bin(bp[0]);
> +			if (h < 0)
> +				break;
> +
> +			l = hex_to_bin(bp[1]);
> +			if (l < 0)
> +				break;
> +
> +			*dest++ = (h << 4) | l;
> +			bp += 2;
>  			len++;
>  		}
>  	} else {
> -- 
> 1.7.2.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2010-09-22 19:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-21  6:40 [PATCHv1.5 1/3] drivers: atm: use native kernel's hex_to_bin() func Andy Shevchenko
2010-09-21  6:40 ` [PATCHv1.5 2/3] sunrpc/cache: don't use custom hex_to_bin() converter Andy Shevchenko
2010-09-22  1:08   ` David Miller
2010-09-22 19:03   ` J. Bruce Fields [this message]
2010-09-21  6:40 ` [PATCHv1.5 3/3] net: core: use kernel's converter from hex to bin Andy Shevchenko
2010-09-22  1:08   ` David Miller
2010-09-22  1:07 ` [PATCHv1.5 1/3] drivers: atm: use native kernel's hex_to_bin() func David Miller

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=20100922190340.GF26903@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=Trond.Myklebust@netapp.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=netdev@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