Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rt2860: use new hex_to_bin() method

Instead of using own implementation involve hex_to_bin() function.

Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andy Shevchenko and committed by
Linus Torvalds
1356de06 69e4469a

+2 -15
+2 -13
drivers/staging/rt2860/common/rtmp_init.c
··· 2810 2810 } 2811 2811 2812 2812 /* IRQL = PASSIVE_LEVEL */ 2813 - u8 BtoH(char ch) 2814 - { 2815 - if (ch >= '0' && ch <= '9') 2816 - return (ch - '0'); /* Handle numerals */ 2817 - if (ch >= 'A' && ch <= 'F') 2818 - return (ch - 'A' + 0xA); /* Handle capitol hex digits */ 2819 - if (ch >= 'a' && ch <= 'f') 2820 - return (ch - 'a' + 0xA); /* Handle small hex digits */ 2821 - return (255); 2822 - } 2823 - 2824 2813 /* */ 2825 2814 /* FUNCTION: AtoH(char *, u8 *, int) */ 2826 2815 /* */ ··· 2836 2847 destTemp = (u8 *)dest; 2837 2848 2838 2849 while (destlen--) { 2839 - *destTemp = BtoH(*srcptr++) << 4; /* Put 1st ascii byte in upper nibble. */ 2840 - *destTemp += BtoH(*srcptr++); /* Add 2nd ascii byte to above. */ 2850 + *destTemp = hex_to_bin(*srcptr++) << 4; /* Put 1st ascii byte in upper nibble. */ 2851 + *destTemp += hex_to_bin(*srcptr++); /* Add 2nd ascii byte to above. */ 2841 2852 destTemp++; 2842 2853 } 2843 2854 }
-2
drivers/staging/rt2860/rtmp.h
··· 2356 2356 2357 2357 void AtoH(char *src, u8 *dest, int destlen); 2358 2358 2359 - u8 BtoH(char ch); 2360 - 2361 2359 void RTMPPatchMacBbpBug(struct rt_rtmp_adapter *pAd); 2362 2360 2363 2361 void RTMPInitTimer(struct rt_rtmp_adapter *pAd,