diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-05-10 17:49:09 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-05-10 14:51:01 -0700 |
commit | 532062b099563cba7a93bd9bd50554948661f013 (patch) | |
tree | b680c15e0a70ad194dfdd38142c924e36dd16701 /drivers/atm/iphase.c | |
parent | aed6864035b1e51ba16323b54aa3e4861c1a0a3e (diff) | |
download | linux-stable-532062b099563cba7a93bd9bd50554948661f013.tar.gz linux-stable-532062b099563cba7a93bd9bd50554948661f013.tar.bz2 linux-stable-532062b099563cba7a93bd9bd50554948661f013.zip |
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>
Diffstat (limited to 'drivers/atm/iphase.c')
-rw-r--r-- | drivers/atm/iphase.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 933e3ff2ee8d..e3f5d073caa6 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -47,6 +47,7 @@ #include <linux/errno.h> #include <linux/atm.h> #include <linux/atmdev.h> +#include <linux/ctype.h> #include <linux/sonet.h> #include <linux/skbuff.h> #include <linux/time.h> @@ -996,10 +997,12 @@ static void xdump( u_char* cp, int length, char* prefix ) } pBuf += sprintf( pBuf, " " ); for(col = 0;count + col < length && col < 16; col++){ - if (isprint((int)cp[count + col])) - pBuf += sprintf( pBuf, "%c", cp[count + col] ); - else - pBuf += sprintf( pBuf, "." ); + u_char c = cp[count + col]; + + if (isascii(c) && isprint(c)) + pBuf += sprintf(pBuf, "%c", c); + else + pBuf += sprintf(pBuf, "."); } printk("%s\n", prntBuf); count += col; |