Skip to content

Commit

Permalink
lib, net: make isodigit() public and use it
Browse files Browse the repository at this point in the history
There are at least two users of isodigit().  Let's make it a public
function of ctype.h.

Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
andy-shev authored and torvalds committed Apr 30, 2013
1 parent 095d141 commit 2e0fb40
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
6 changes: 6 additions & 0 deletions include/linux/ctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion lib/dynamic_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion net/sunrpc/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 2e0fb40

Please sign in to comment.