提交 dd665be0 编写于 作者: A Arnd Bergmann 提交者: Russell King

ARM: 8584/1: floppy: avoid gcc-6 warning

gcc-6.0 warns about comparisons between two identical expressions,
which is what we get in the floppy driver when writing to the FD_DOR
register:

drivers/block/floppy.c: In function 'set_dor':
drivers/block/floppy.c:810:44: error: self-comparison always evaluates to true [-Werror=tautological-compare]
   fd_outb(newdor, FD_DOR);

It would be nice to use a static inline function instead of the
macro, to avoid the warning, but we cannot do that because the
FD_DOR definition is incomplete at this point.

Adding a cast to (u32) is a harmless way to shut up the warning,
just not very nice.
Signed-off-by: NArnd Bergmann <arnd@arndb.de>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 14c4a533
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#define fd_outb(val,port) \ #define fd_outb(val,port) \
do { \ do { \
if ((port) == FD_DOR) \ if ((port) == (u32)FD_DOR) \
fd_setdor((val)); \ fd_setdor((val)); \
else \ else \
outb((val),(port)); \ outb((val),(port)); \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册