]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
FAT: use toupper/tolower instead of recoding them
authorRichard Genoud <richard.genoud@gmail.com>
Thu, 13 Dec 2012 00:47:36 +0000 (00:47 +0000)
committerTom Rini <trini@ti.com>
Mon, 4 Feb 2013 14:05:46 +0000 (09:05 -0500)
toupper/tolower function are already declared, so use them.

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Stefano Babic <sbabic@denx.de>
fs/fat/fat.c
fs/fat/fat_write.c
include/fat.h

index 25d3318cd0a8d8baaefee5cd6bc91977511a08ac..7bb5dba4e29831a0d3dbd3f0926f1f1ccb6f82e3 100644 (file)
@@ -33,6 +33,7 @@
 #include <part.h>
 #include <malloc.h>
 #include <linux/compiler.h>
+#include <linux/ctype.h>
 
 /*
  * Convert a string to lowercase.
@@ -40,7 +41,7 @@
 static void downcase(char *str)
 {
        while (*str != '\0') {
-               TOLOWER(*str);
+               *str = tolower(*str);
                str++;
        }
 }
index 4a1bda0a37effd984885800ec4679be6f0f71666..819c33b1abdb16a7f6bb75de6ca2b2871dd28899 100644 (file)
@@ -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++;
        }
 }
index 706cd7a4bd3467444d3b870bad8ac23743a5ad3a..b28c3fd66855e6d559cdea308c481d3995dea8d0 100644 (file)
@@ -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)))