Skip to content

Commit c9ff921

Browse files
Andy Shevchenkotiwai
authored andcommitted
ALSA: alsa: riptide: don't use own hex_to_bin() method
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent bcfde33 commit c9ff921

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎sound/pci/riptide/riptide.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
#include <linux/gameport.h>
9898
#include <linux/device.h>
9999
#include <linux/firmware.h>
100+
#include <linux/kernel.h>
100101
#include <asm/io.h>
101102
#include <sound/core.h>
102103
#include <sound/info.h>
@@ -667,13 +668,12 @@ static u32 atoh(const unsigned char *in, unsigned int len)
667668
unsigned char c;
668669

669670
while (len) {
671+
int value;
672+
670673
c = in[len - 1];
671-
if ((c >= '0') && (c <= '9'))
672-
sum += mult * (c - '0');
673-
else if ((c >= 'A') && (c <= 'F'))
674-
sum += mult * (c - ('A' - 10));
675-
else if ((c >= 'a') && (c <= 'f'))
676-
sum += mult * (c - ('a' - 10));
674+
value = hex_to_bin(c);
675+
if (value >= 0)
676+
sum += mult * value;
677677
mult *= 16;
678678
--len;
679679
}

0 commit comments

Comments
 (0)