diff options
| author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2013-04-29 19:18:11 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:19 -0400 |
| commit | 2e0fb404c86d6c86dc33e284310eb5d28d192dcf (patch) | |
| tree | c75a1dd1cab54473d3174aa00fc49d18deabfa5e | |
| parent | 095d141b2e40665289d44a42d387ffac2841ef82 (diff) | |
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>
| -rw-r--r-- | include/linux/ctype.h | 6 | ||||
| -rw-r--r-- | lib/dynamic_debug.c | 1 | ||||
| -rw-r--r-- | net/sunrpc/cache.c | 1 |
3 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/ctype.h b/include/linux/ctype.h index 8acfe312f947..653589e3e30e 100644 --- a/include/linux/ctype.h +++ b/include/linux/ctype.h | |||
| @@ -61,4 +61,10 @@ static inline char _tolower(const char c) | |||
| 61 | return c | 0x20; | 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 | #endif | 70 | #endif |
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 5276b99ca650..46032453abd5 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) | |||
| 281 | * allow the user to express a query which matches a format | 281 | * allow the user to express a query which matches a format |
| 282 | * containing embedded spaces. | 282 | * containing embedded spaces. |
| 283 | */ | 283 | */ |
| 284 | #define isodigit(c) ((c) >= '0' && (c) <= '7') | ||
| 285 | static char *unescape(char *str) | 284 | static char *unescape(char *str) |
| 286 | { | 285 | { |
| 287 | char *in = str; | 286 | char *in = str; |
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index 25d58e766014..ce2d180d05a4 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c | |||
| @@ -1208,7 +1208,6 @@ EXPORT_SYMBOL_GPL(sunrpc_cache_pipe_upcall); | |||
| 1208 | * key and content are both parsed by cache | 1208 | * key and content are both parsed by cache |
| 1209 | */ | 1209 | */ |
| 1210 | 1210 | ||
| 1211 | #define isodigit(c) (isdigit(c) && c <= '7') | ||
| 1212 | int qword_get(char **bpp, char *dest, int bufsize) | 1211 | int qword_get(char **bpp, char *dest, int bufsize) |
| 1213 | { | 1212 | { |
| 1214 | /* return bytes copied, or -1 on error */ | 1213 | /* return bytes copied, or -1 on error */ |
