[linux-yocto] [PATCH 11/15] include/linux: Resolve Compile Warning

Daniel Dragomir daniel.dragomir at windriver.com
Fri Jan 8 07:51:42 PST 2016


From: John Jacques <john.jacques at intel.com>

Some versions of gcc warn if a bool (in this case the
result of the ending the macro with '!= 0'.  Also
casting to (unsigned long) as this is what the print
formats expect.

Signed-off-by: John Jacques <john.jacques at intel.com>
---
 include/linux/blkdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 5d93a66..cdb7e38 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -621,7 +621,7 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q)
 
 #define list_entry_rq(ptr)	list_entry((ptr), struct request, queuelist)
 
-#define rq_data_dir(rq)		(((rq)->cmd_flags & 1) != 0)
+#define rq_data_dir(rq)		(unsigned int)((rq)->cmd_flags & 1)
 
 /*
  * Driver can handle struct request, if it either has an old style
-- 
1.9.1



More information about the linux-yocto mailing list