mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Andy Shevchenko <ext-andriy.shevchenko@nokia.com>,
	Jaroslav Kysela <perex@perex.cz>,
	alsa-devel@alsa-project.org
Subject: Re: [PATCH] alsa: riptide: don't use own hex_to_bin() method
Date: Thu, 17 Jun 2010 09:43:06 +0200	[thread overview]
Message-ID: <s5h1vc6m7ed.wl%tiwai@suse.de> (raw)
In-Reply-To: <1276611988-28658-1-git-send-email-andy.shevchenko@gmail.com>

At Tue, 15 Jun 2010 17:26:28 +0300,
Andy Shevchenko wrote:
> 
> From: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
> 
> Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
> Cc: Jaroslav Kysela <perex@perex.cz>
> Cc: Takashi Iwai <tiwai@suse.de>
> Cc: alsa-devel@alsa-project.org

Applied now.  Thanks.


Takashi

> ---
>  sound/pci/riptide/riptide.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
> index ad44626..59d7996 100644
> --- a/sound/pci/riptide/riptide.c
> +++ b/sound/pci/riptide/riptide.c
> @@ -97,6 +97,7 @@
>  #include <linux/gameport.h>
>  #include <linux/device.h>
>  #include <linux/firmware.h>
> +#include <linux/kernel.h>
>  #include <asm/io.h>
>  #include <sound/core.h>
>  #include <sound/info.h>
> @@ -667,13 +668,12 @@ static u32 atoh(const unsigned char *in, unsigned int len)
>  	unsigned char c;
>  
>  	while (len) {
> +		int value;
> +
>  		c = in[len - 1];
> -		if ((c >= '0') && (c <= '9'))
> -			sum += mult * (c - '0');
> -		else if ((c >= 'A') && (c <= 'F'))
> -			sum += mult * (c - ('A' - 10));
> -		else if ((c >= 'a') && (c <= 'f'))
> -			sum += mult * (c - ('a' - 10));
> +		value = hex_to_bin(c);
> +		if (value >= 0)
> +			sum += mult * value;
>  		mult *= 16;
>  		--len;
>  	}
> -- 
> 1.6.6.1
> 

      reply	other threads:[~2010-06-17  7:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-15 14:26 Andy Shevchenko
2010-06-17  7:43 ` Takashi Iwai [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=s5h1vc6m7ed.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=ext-andriy.shevchenko@nokia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    /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®