From 65533304c5b74dc667529e8ce96ab22abf751042 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Tue, 15 Jun 2010 17:26:28 +0300 Subject: [PATCH] --- yaml --- r: 206651 b: refs/heads/master c: c9ff921abecda352e987a6aae169118a3fc9aa5d h: refs/heads/master i: 206649: c78b9feed8d27a020ac7d97c453c5e3c87167865 206647: 8c4edeed5be389a387b262ae7a8a170c1eeb6679 v: v3 --- [refs] | 2 +- trunk/sound/pci/riptide/riptide.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index e4668e26d578..a192abb80bb2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bcfde3347cadfc8967e9481b5a9ceae16ef95e38 +refs/heads/master: c9ff921abecda352e987a6aae169118a3fc9aa5d diff --git a/trunk/sound/pci/riptide/riptide.c b/trunk/sound/pci/riptide/riptide.c index ad4462677615..59d79962f236 100644 --- a/trunk/sound/pci/riptide/riptide.c +++ b/trunk/sound/pci/riptide/riptide.c @@ -97,6 +97,7 @@ #include #include #include +#include #include #include #include @@ -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; }