public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] FAT: use toupper/tolower instead of recoding them
Date: Fri, 14 Dec 2012 09:56:27 +0100	[thread overview]
Message-ID: <50CAE9BB.5090206@denx.de> (raw)
In-Reply-To: <1355395656-5838-3-git-send-email-richard.genoud@gmail.com>

On 13/12/2012 11:47, Richard Genoud wrote:
> toupper/tolower function are already declared, so use them.
> 
> Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
> ---
>  fs/fat/fat.c       |    3 ++-
>  fs/fat/fat_write.c |    3 ++-
>  include/fat.h      |    3 ---
>  3 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/fat/fat.c b/fs/fat/fat.c
> index c79e3e3..cff0526 100644
> --- a/fs/fat/fat.c
> +++ b/fs/fat/fat.c
> @@ -33,6 +33,7 @@
>  #include <part.h>
>  #include <malloc.h>
>  #include <linux/compiler.h>
> +#include <linux/ctype.h>
>  
>  #ifdef CONFIG_SUPPORT_VFAT
>  #define VFAT_ENABLED 1
> @@ -46,7 +47,7 @@
>  static void downcase(char *str)
>  {
>  	while (*str != '\0') {
> -		TOLOWER(*str);
> +		*str = tolower(*str);
>  		str++;
>  	}
>  }
> diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
> index ed3eaa0..13c4de1 100644
> --- a/fs/fat/fat_write.c
> +++ b/fs/fat/fat_write.c
> @@ -28,6 +28,7 @@
>  #include <fat.h>
>  #include <asm/byteorder.h>
>  #include <part.h>
> +#include <linux/ctype.h>
>  #include "fat.c"
>  
>  static void uppercase(char *str, int len)
> @@ -35,7 +36,7 @@ static void uppercase(char *str, int len)
>  	int i;
>  
>  	for (i = 0; i < len; i++) {
> -		TOUPPER(*str);
> +		*str = toupper(*str);
>  		str++;
>  	}
>  }
> diff --git a/include/fat.h b/include/fat.h
> index 706cd7a..b28c3fd 100644
> --- a/include/fat.h
> +++ b/include/fat.h
> @@ -98,9 +98,6 @@
>  #endif
>  #endif
>  
> -#define TOLOWER(c)	if((c) >= 'A' && (c) <= 'Z'){(c)+=('a' - 'A');}
> -#define TOUPPER(c)	if ((c) >= 'a' && (c) <= 'z') \
> -				(c) -= ('a' - 'A');
>  #define START(dent)	(FAT2CPU16((dent)->start) \
>  			+ (mydata->fatsize != 32 ? 0 : \
>  			  (FAT2CPU16((dent)->starthi) << 16)))
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

  parent reply	other threads:[~2012-12-14  8:56 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04 13:04 [U-Boot] [PATCH] FAT: make FAT compile without VFAT Richard Genoud
2012-12-04 14:24 ` Marek Vasut
2012-12-04 15:32   ` Richard Genoud
2012-12-04 16:16 ` Stefano Babic
2012-12-13 10:47   ` [U-Boot] [PATCH 0/2] clean some FAT code Richard Genoud
2012-12-13 12:45     ` Marek Vasut
2012-12-13 12:57       ` Richard Genoud
2012-12-13 10:47   ` [U-Boot] [PATCH 1/2] FAT: remove ifdefs to make the code more readable Richard Genoud
2012-12-13 12:46     ` Marek Vasut
2012-12-13 13:00       ` Richard Genoud
2012-12-13 13:12         ` Marek Vasut
2012-12-13 13:16           ` Richard Genoud
2012-12-13 13:19             ` Marek Vasut
2012-12-13 13:30               ` [U-Boot] [PATCHv2] " Richard Genoud
2013-02-04 16:42                 ` [U-Boot] [U-Boot, PATCHv2] " Tom Rini
2012-12-13 13:09     ` [U-Boot] [PATCH 1/2] " Tom Rini
2012-12-13 13:15       ` Richard Genoud
2012-12-13 13:51       ` Marek Vasut
2012-12-13 14:24         ` Richard Genoud
2012-12-13 14:41           ` Tom Rini
2012-12-13 10:47   ` [U-Boot] [PATCH 2/2] FAT: use toupper/tolower instead of recoding them Richard Genoud
2012-12-13 12:47     ` Marek Vasut
2012-12-14  8:56     ` Stefano Babic [this message]
2013-02-04 16:41     ` [U-Boot] [U-Boot, " Tom Rini

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=50CAE9BB.5090206@denx.de \
    --to=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /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