From: Andy Shevchenko Date: Mon, 29 Apr 2013 23:18:11 +0000 (-0700) Subject: lib, net: make isodigit() public and use it X-Git-Tag: v3.12-rc1~986^2~224 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e0fb404c86d6c86dc33e284310eb5d28d192dcf;p=kernel%2Fkernel-generic.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/ctype.h b/include/linux/ctype.h index 8acfe31..653589e 100644 --- a/include/linux/ctype.h +++ b/include/linux/ctype.h @@ -61,4 +61,10 @@ static inline char _tolower(const char c) return c | 0x20; } +/* Fast check for octal digit */ +static inline int isodigit(const char c) +{ + return c >= '0' && c <= '7'; +} + #endif diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 5276b99..4603245 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -281,7 +281,6 @@ static inline int parse_lineno(const char *str, unsigned int *val) * allow the user to express a query which matches a format * containing embedded spaces. */ -#define isodigit(c) ((c) >= '0' && (c) <= '7') static char *unescape(char *str) { char *in = str; diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index 25d58e76..ce2d180 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c @@ -1208,7 +1208,6 @@ EXPORT_SYMBOL_GPL(sunrpc_cache_pipe_upcall); * key and content are both parsed by cache */ -#define isodigit(c) (isdigit(c) && c <= '7') int qword_get(char **bpp, char *dest, int bufsize) { /* return bytes copied, or -1 on error */