From: Richard Genoud Date: Thu, 13 Dec 2012 00:47:36 +0000 (+0000) Subject: FAT: use toupper/tolower instead of recoding them X-Git-Tag: v2013.04-rc1~74 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fb7e16cc1c1f5d5bb212118b89218b2e706226b2;p=oweals%2Fu-boot.git FAT: use toupper/tolower instead of recoding them toupper/tolower function are already declared, so use them. Signed-off-by: Richard Genoud Acked-by: Marek Vasut Acked-by: Stefano Babic --- diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 25d3318cd0..7bb5dba4e2 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -33,6 +33,7 @@ #include #include #include +#include /* * Convert a string to lowercase. @@ -40,7 +41,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 4a1bda0a37..819c33b1ab 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 706cd7a4bd..b28c3fd668 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)))