Skip to content

Commit

Permalink
fs: fat: Fix warning in normalize_longname()
Browse files Browse the repository at this point in the history
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: 25bb9da ("fs: fat: check and normalize file name")
Signed-off-by: Tom Rini <[email protected]>
Signed-off-by: Alexander Graf <[email protected]>
  • Loading branch information
trini authored and agraf committed Oct 16, 2018
1 parent 1c3b2f4 commit 819c80f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/fat/fat_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ static int split_filename(char *filename, char **dirname, char **basename)
static int normalize_longname(char *l_filename, const char *filename)
{
const char *p, legal[] = "!#$%&\'()-.@^`_{}~";
char c;
unsigned char c;
int name_len;

/* Check that the filename is valid */
Expand Down

0 comments on commit 819c80f

Please sign in to comment.