提交 cbfd0c10 编写于 作者: A Arnd Bergmann 提交者: 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: NArnd Bergmann <arnd@arndb.de>
Cc: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册