]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
lib, net: make isodigit() public and use it
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 29 Apr 2013 23:18:11 +0000 (16:18 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 30 Apr 2013 01:28:19 +0000 (18:28 -0700)
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>
include/linux/ctype.h
lib/dynamic_debug.c
net/sunrpc/cache.c

index 8acfe312f947e0ff2dd2f01067b99c3e1c55ca17..653589e3e30e8b03dd1844011bae7ca19e41136b 100644 (file)
@@ -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
index 5276b99ca650df8fe6e6e07363f2639250418c5a..46032453abd50cfcfcc4ce277e8f8ec2d34fffc3 100644 (file)
@@ -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;
index 25d58e766014bf751ba404cac60893b2cfc5ecf9..ce2d180d05a472cdc2fa0951902aa538839417f1 100644 (file)
@@ -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 */