Browse Source

fs: fat: Fix warning in normalize_longname()

As observed with clang:
fs/fat/fat_write.c:1024:13: warning: comparison of constant 128
      with expression of type 'char' is always false
      [-Wtautological-constant-out-of-range-compare]
                if ((0x80 <= c) && (c <= 0xff))
                     ~~~~ ^  ~
fs/fat/fat_write.c:1024:25: warning: comparison of constant 255
      with expression of type 'char' is always true
      [-Wtautological-constant-out-of-range-compare]
                if ((0x80 <= c) && (c <= 0xff))
                                    ~ ^  ~~~~

Fixes: 25bb9dab14f4 ("fs: fat: check and normalize file name")
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Tom Rini 3 years ago
parent
commit
819c80f528
1 changed files with 1 additions and 1 deletions
  1. 1 1
      fs/fat/fat_write.c

+ 1 - 1
fs/fat/fat_write.c

@@ -1012,7 +1012,7 @@ again:
1012 1012
 static int normalize_longname(char *l_filename, const char *filename)
1013 1013
 {
1014 1014
 	const char *p, legal[] = "!#$%&\'()-.@^`_{}~";
1015
-	char c;
1015
+	unsigned char c;
1016 1016
 	int name_len;
1017 1017
 
1018 1018
 	/* Check that the filename is valid */