From: Tobias Klauser Replace the custom is_digit()/is_hex_digit() macros with isdigit()/isxdigit() from Additionaly remove unused macro is_alpha() from Signed-off-by: Tobias Klauser Cc: Jeff Garzik Signed-off-by: Andrew Morton --- drivers/net/wan/cycx_x25.c | 5 +++-- drivers/net/wan/sdla_fr.c | 4 ++-- drivers/net/wan/sdla_x25.c | 8 ++++---- include/linux/cyclomx.h | 2 -- include/linux/wanpipe.h | 9 --------- 5 files changed, 9 insertions(+), 19 deletions(-) diff -puN drivers/net/wan/cycx_x25.c~drivers-net-wan-replace-custom-macro-with-isdigit-isxdigit drivers/net/wan/cycx_x25.c --- devel/drivers/net/wan/cycx_x25.c~drivers-net-wan-replace-custom-macro-with-isdigit-isxdigit 2005-09-10 14:44:46.000000000 -0700 +++ devel-akpm/drivers/net/wan/cycx_x25.c 2005-09-10 14:44:46.000000000 -0700 @@ -78,6 +78,7 @@ #define CYCLOMX_X25_DEBUG 1 +#include /* isdigit() */ #include /* return codes */ #include /* ARPHRD_HWX25 */ #include /* printk(), and other useful stuff */ @@ -418,7 +419,7 @@ static int cycx_wan_new_if(struct wan_de /* Set channel timeouts (default if not specified) */ chan->idle_tmout = conf->idle_timeout ? conf->idle_timeout : 90; - } else if (is_digit(conf->addr[0])) { /* PVC */ + } else if (isdigit(conf->addr[0])) { /* PVC */ s16 lcn = dec_to_uint(conf->addr, 0); if (lcn >= card->u.x.lo_pvc && lcn <= card->u.x.hi_pvc) @@ -1531,7 +1532,7 @@ static unsigned dec_to_uint(u8 *str, int if (!len) len = strlen(str); - for (; len && is_digit(*str); ++str, --len) + for (; len && isdigit(*str); ++str, --len) val = (val * 10) + (*str - (unsigned) '0'); return val; diff -puN drivers/net/wan/sdla_fr.c~drivers-net-wan-replace-custom-macro-with-isdigit-isxdigit drivers/net/wan/sdla_fr.c --- devel/drivers/net/wan/sdla_fr.c~drivers-net-wan-replace-custom-macro-with-isdigit-isxdigit 2005-09-10 14:44:46.000000000 -0700 +++ devel-akpm/drivers/net/wan/sdla_fr.c 2005-09-10 14:44:46.000000000 -0700 @@ -822,7 +822,7 @@ static int new_if(struct wan_device* wan chan->card = card; /* verify media address */ - if (is_digit(conf->addr[0])) { + if (isdigit(conf->addr[0])) { dlci = dec_to_uint(conf->addr, 0); @@ -3456,7 +3456,7 @@ static unsigned int dec_to_uint (unsigne if (!len) len = strlen(str); - for (val = 0; len && is_digit(*str); ++str, --len) + for (val = 0; len && isdigit(*str); ++str, --len) val = (val * 10) + (*str - (unsigned)'0'); return val; diff -puN drivers/net/wan/sdla_x25.c~drivers-net-wan-replace-custom-macro-with-isdigit-isxdigit drivers/net/wan/sdla_x25.c --- devel/drivers/net/wan/sdla_x25.c~drivers-net-wan-replace-custom-macro-with-isdigit-isxdigit 2005-09-10 14:44:46.000000000 -0700 +++ devel-akpm/drivers/net/wan/sdla_x25.c 2005-09-10 14:44:46.000000000 -0700 @@ -957,7 +957,7 @@ static int new_if(struct wan_device* wan chan->hold_timeout = (conf->hold_timeout) ? conf->hold_timeout : 10; - }else if (is_digit(conf->addr[0])){ /* PVC */ + }else if (isdigit(conf->addr[0])){ /* PVC */ int lcn = dec_to_uint(conf->addr, 0); if ((lcn >= card->u.x.lo_pvc) && (lcn <= card->u.x.hi_pvc)){ @@ -3875,7 +3875,7 @@ static unsigned int dec_to_uint (unsigne if (!len) len = strlen(str); - for (val = 0; len && is_digit(*str); ++str, --len) + for (val = 0; len && isdigit(*str); ++str, --len) val = (val * 10) + (*str - (unsigned)'0'); return val; @@ -3896,9 +3896,9 @@ static unsigned int hex_to_uint (unsigne for (val = 0; len; ++str, --len) { ch = *str; - if (is_digit(ch)) + if (isdigit(ch)) val = (val << 4) + (ch - (unsigned)'0'); - else if (is_hex_digit(ch)) + else if (isxdigit(ch)) val = (val << 4) + ((ch & 0xDF) - (unsigned)'A' + 10); else break; } diff -puN include/linux/cyclomx.h~drivers-net-wan-replace-custom-macro-with-isdigit-isxdigit include/linux/cyclomx.h --- devel/include/linux/cyclomx.h~drivers-net-wan-replace-custom-macro-with-isdigit-isxdigit 2005-09-10 14:44:46.000000000 -0700 +++ devel-akpm/include/linux/cyclomx.h 2005-09-10 14:44:46.000000000 -0700 @@ -37,8 +37,6 @@ #include #endif -#define is_digit(ch) (((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')?1:0) - /* Adapter Data Space. * This structure is needed because we handle multiple cards, otherwise * static data would do it. diff -puN include/linux/wanpipe.h~drivers-net-wan-replace-custom-macro-with-isdigit-isxdigit include/linux/wanpipe.h --- devel/include/linux/wanpipe.h~drivers-net-wan-replace-custom-macro-with-isdigit-isxdigit 2005-09-10 14:44:46.000000000 -0700 +++ devel-akpm/include/linux/wanpipe.h 2005-09-10 14:44:46.000000000 -0700 @@ -265,15 +265,6 @@ typedef struct { #include #include - -#define is_digit(ch) (((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')?1:0) -#define is_alpha(ch) ((((ch)>=(unsigned)'a'&&(ch)<=(unsigned)'z')||\ - ((ch)>=(unsigned)'A'&&(ch)<=(unsigned)'Z'))?1:0) -#define is_hex_digit(ch) ((((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')||\ - ((ch)>=(unsigned)'a'&&(ch)<=(unsigned)'f')||\ - ((ch)>=(unsigned)'A'&&(ch)<=(unsigned)'F'))?1:0) - - /****** Data Structures *****************************************************/ /* Adapter Data Space. _