Skip to contentSkip to conversation

vfs: sparse: remove a warning on OPEN_FMODE()

PATCH In review [email protected] 1 participant 1 message Oct 1, 2010 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 vfs: sparse: remove a warning on OPEN_FMODE()

From: Namhyung Kim <[email protected]>

AND-ing FMODE_* constant with normal integer results in following sparse warnings. Fix it.

fs/open.c:662:21: warning: restricted fmode_t degrades to integer fs/anon_inodes.c:123:34: warning: restricted fmode_t degrades to integer

---

 include/linux/fs.h |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
include/linux/fs.h renamed from include/linux/fs.h~vfs-remove-a-warning-on-open_fmode +3 -1
diff -puN include/linux/fs.h~vfs-remove-a-warning-on-open_fmode include/linux/fs.h
@@ -2490,9 +2490,11 @@ int proc_nr_files(struct ctl_table *tabl
 
 int __init get_filesystem_list(char *buf);
 
+#define __FMODE_NONOTIFY	((__force int) FMODE_NONOTIFY)
+
 #define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE])
 #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \
-					    (flag & FMODE_NONOTIFY)))
+					    (flag & __FMODE_NONOTIFY)))
 
 #endif /* __KERNEL__ */
 #endif /* _LINUX_FS_H */

_