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

lib, net: make isodigit() public and use it

There are at least two users of isodigit(). Let's make it a public
function of ctype.h.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
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
2e0fb404 095d141b

+6 -2
+6
include/linux/ctype.h
··· 61 61 return c | 0x20; 62 62 } 63 63 64 + /* Fast check for octal digit */ 65 + static inline int isodigit(const char c) 66 + { 67 + return c >= '0' && c <= '7'; 68 + } 69 + 64 70 #endif
-1
lib/dynamic_debug.c
··· 281 281 * allow the user to express a query which matches a format 282 282 * containing embedded spaces. 283 283 */ 284 - #define isodigit(c) ((c) >= '0' && (c) <= '7') 285 284 static char *unescape(char *str) 286 285 { 287 286 char *in = str;
-1
net/sunrpc/cache.c
··· 1208 1208 * key and content are both parsed by cache 1209 1209 */ 1210 1210 1211 - #define isodigit(c) (isdigit(c) && c <= '7') 1212 1211 int qword_get(char **bpp, char *dest, int bufsize) 1213 1212 { 1214 1213 /* return bytes copied, or -1 on error */