mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
FAT: use toupper/tolower instead of recoding them
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>
This commit is contained in:
parent
c7db645a6b
commit
fb7e16cc1c
3 changed files with 4 additions and 5 deletions
|
@ -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++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)))
|
||||
|
|
Loading…
Reference in a new issue