Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

atm: Replace custom isprint() with generic analogue

Custom isprint() definition may collide with one form ctype.h.
In order to avoid this, replace it with a functional analogue
which is isascii() && isprint() in this case.

First appearance of the code is in the commit 636b38438001
("Import 2.3.43").

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Andy Shevchenko and committed by
David S. Miller
532062b0 aed68640

+7 -5
+7 -4
drivers/atm/iphase.c
··· 47 47 #include <linux/errno.h> 48 48 #include <linux/atm.h> 49 49 #include <linux/atmdev.h> 50 + #include <linux/ctype.h> 50 51 #include <linux/sonet.h> 51 52 #include <linux/skbuff.h> 52 53 #include <linux/time.h> ··· 997 996 } 998 997 pBuf += sprintf( pBuf, " " ); 999 998 for(col = 0;count + col < length && col < 16; col++){ 1000 - if (isprint((int)cp[count + col])) 1001 - pBuf += sprintf( pBuf, "%c", cp[count + col] ); 1002 - else 1003 - pBuf += sprintf( pBuf, "." ); 999 + u_char c = cp[count + col]; 1000 + 1001 + if (isascii(c) && isprint(c)) 1002 + pBuf += sprintf(pBuf, "%c", c); 1003 + else 1004 + pBuf += sprintf(pBuf, "."); 1004 1005 } 1005 1006 printk("%s\n", prntBuf); 1006 1007 count += col;
-1
drivers/atm/iphase.h
··· 124 124 #define IF_RXPKT(A) 125 125 #endif /* CONFIG_ATM_IA_DEBUG */ 126 126 127 - #define isprint(a) ((a >=' ')&&(a <= '~')) 128 127 #define ATM_DESC(skb) (skb->protocol) 129 128 #define IA_SKB_STATE(skb) (skb->protocol) 130 129 #define IA_DLED 1