Commit cbfd0c10 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Linus Torvalds

include/linux/fs.h: fix unsigned enum warning with gcc-4.2

With arm-linux-gcc-4.2, almost every file we build in the kernel ends up
with this warning:

  include/linux/fs.h:2648: warning: comparison of unsigned expression < 0 is always false

Later versions don't have this problem, but it's easy enough to work
around.

Link: http://lkml.kernel.org/r/20161216105634.235457-12-arnd@arndb.deSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Cc: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8c9e7bb7
...@@ -2678,7 +2678,7 @@ static const char * const kernel_read_file_str[] = { ...@@ -2678,7 +2678,7 @@ static const char * const kernel_read_file_str[] = {
static inline const char *kernel_read_file_id_str(enum kernel_read_file_id id) static inline const char *kernel_read_file_id_str(enum kernel_read_file_id id)
{ {
if (id < 0 || id >= READING_MAX_ID) if ((unsigned)id >= READING_MAX_ID)
return kernel_read_file_str[READING_UNKNOWN]; return kernel_read_file_str[READING_UNKNOWN];
return kernel_read_file_str[id]; return kernel_read_file_str[id];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment