From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Fri, 14 Dec 2012 09:56:27 +0100 Subject: [U-Boot] [PATCH 2/2] FAT: use toupper/tolower instead of recoding them In-Reply-To: <1355395656-5838-3-git-send-email-richard.genoud@gmail.com> References: <50BE21CC.4030603@denx.de> <1355395656-5838-3-git-send-email-richard.genoud@gmail.com> Message-ID: <50CAE9BB.5090206@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 13/12/2012 11:47, Richard Genoud wrote: > toupper/tolower function are already declared, so use them. > > Signed-off-by: Richard Genoud > --- > 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 > #include > #include > +#include > > #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 > #include > #include > +#include > #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 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 =====================================================================