]> git.karo-electronics.de Git - linux-beck.git/commitdiff
V4L/DVB: drivers: usbvideo: remove custom implementation of hex_to_bin()
authorAndy Shevchenko <andy.shevchenko@gmail.com>
Tue, 27 Jul 2010 12:32:49 +0000 (09:32 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 9 Aug 2010 02:43:06 +0000 (23:43 -0300)
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/usbvideo/usbvideo.c

index 5ac37c6c43131503dc95cbf4e496bee1ee2d1460..f1fcf9744961fde9f2aca7e6f3ac1018f9f22c57 100644 (file)
@@ -282,19 +282,15 @@ static void usbvideo_OverlayChar(struct uvd *uvd, struct usbvideo_frame *frame,
        };
        unsigned short digit;
        int ix, iy;
+       int value;
 
        if ((uvd == NULL) || (frame == NULL))
                return;
 
-       if (ch >= '0' && ch <= '9')
-               ch -= '0';
-       else if (ch >= 'A' && ch <= 'F')
-               ch = 10 + (ch - 'A');
-       else if (ch >= 'a' && ch <= 'f')
-               ch = 10 + (ch - 'a');
-       else
+       value = hex_to_bin(ch);
+       if (value < 0)
                return;
-       digit = digits[ch];
+       digit = digits[value];
 
        for (iy=0; iy < 5; iy++) {
                for (ix=0; ix < 3; ix++) {