public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Michael Ellerman <mpe@ellerman.id.au>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v1 1/1] powerpc/prom_init: Move custom isspace() to its own namespace
Date: Mon, 7 Jun 2021 20:12:59 +0300	[thread overview]
Message-ID: <YL5Tm7jZaaQ0POH5@smile.fi.intel.com> (raw)
In-Reply-To: <20210510144925.58195-1-andriy.shevchenko@linux.intel.com>

On Mon, May 10, 2021 at 05:49:25PM +0300, Andy Shevchenko wrote:
> If by some reason any of the headers will include ctype.h
> we will have a name collision. Avoid this by moving isspace()
> to the dedicate namespace.
> 
> First appearance of the code is in the commit cf68787b68a2
> ("powerpc/prom_init: Evaluate mem kernel parameter for early allocation").

Any comments on this?

> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  arch/powerpc/kernel/prom_init.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
> index 41ed7e33d897..6845cbbc0cd4 100644
> --- a/arch/powerpc/kernel/prom_init.c
> +++ b/arch/powerpc/kernel/prom_init.c
> @@ -701,13 +701,13 @@ static int __init prom_setprop(phandle node, const char *nodename,
>  }
>  
>  /* We can't use the standard versions because of relocation headaches. */
> -#define isxdigit(c)	(('0' <= (c) && (c) <= '9') \
> -			 || ('a' <= (c) && (c) <= 'f') \
> -			 || ('A' <= (c) && (c) <= 'F'))
> +#define prom_isxdigit(c)	(('0' <= (c) && (c) <= '9') \
> +				 || ('a' <= (c) && (c) <= 'f') \
> +				 || ('A' <= (c) && (c) <= 'F'))
>  
> -#define isdigit(c)	('0' <= (c) && (c) <= '9')
> -#define islower(c)	('a' <= (c) && (c) <= 'z')
> -#define toupper(c)	(islower(c) ? ((c) - 'a' + 'A') : (c))
> +#define prom_isdigit(c)		('0' <= (c) && (c) <= '9')
> +#define prom_islower(c)		('a' <= (c) && (c) <= 'z')
> +#define prom_toupper(c)		(prom_islower(c) ? ((c) - 'a' + 'A') : (c))
>  
>  static unsigned long prom_strtoul(const char *cp, const char **endp)
>  {
> @@ -716,14 +716,14 @@ static unsigned long prom_strtoul(const char *cp, const char **endp)
>  	if (*cp == '0') {
>  		base = 8;
>  		cp++;
> -		if (toupper(*cp) == 'X') {
> +		if (prom_toupper(*cp) == 'X') {
>  			cp++;
>  			base = 16;
>  		}
>  	}
>  
> -	while (isxdigit(*cp) &&
> -	       (value = isdigit(*cp) ? *cp - '0' : toupper(*cp) - 'A' + 10) < base) {
> +	while (prom_isxdigit(*cp) &&
> +	       (value = prom_isdigit(*cp) ? *cp - '0' : prom_toupper(*cp) - 'A' + 10) < base) {
>  		result = result * base + value;
>  		cp++;
>  	}
> -- 
> 2.30.2
> 

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2021-06-07 17:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 14:49 [PATCH v1 1/1] powerpc/prom_init: Move custom isspace() to its own namespace Andy Shevchenko
2021-06-07 17:12 ` Andy Shevchenko [this message]
2021-06-09  7:00   ` Michael Ellerman
2021-06-18  3:51 ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YL5Tm7jZaaQ0POH5@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lkp@intel.com \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox