Skip to content

Commit 2e0fb40

Browse files
andy-shevtorvalds
authored andcommitted
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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 095d141 commit 2e0fb40

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

include/linux/ctype.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,10 @@ static inline char _tolower(const char c)
6161
return c | 0x20;
6262
}
6363

64+
/* Fast check for octal digit */
65+
static inline int isodigit(const char c)
66+
{
67+
return c >= '0' && c <= '7';
68+
}
69+
6470
#endif

lib/dynamic_debug.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ static inline int parse_lineno(const char *str, unsigned int *val)
281281
* allow the user to express a query which matches a format
282282
* containing embedded spaces.
283283
*/
284-
#define isodigit(c) ((c) >= '0' && (c) <= '7')
285284
static char *unescape(char *str)
286285
{
287286
char *in = str;

net/sunrpc/cache.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,6 @@ EXPORT_SYMBOL_GPL(sunrpc_cache_pipe_upcall);
12081208
* key and content are both parsed by cache
12091209
*/
12101210

1211-
#define isodigit(c) (isdigit(c) && c <= '7')
12121211
int qword_get(char **bpp, char *dest, int bufsize)
12131212
{
12141213
/* return bytes copied, or -1 on error */

0 commit comments

Comments
 (0)