Skip to contentSkip to conversation

FS: Making aproriate return type

PATCH In review Pushkar Jambhlekar 2 participants 2 messages May 11, 2017 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 FS: Making aproriate return type

unsigned_offsets function returns fmode_t but function definition returns int. sparse generate warning. Updating proper return type

---
 fs/read_write.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/read_write.c +1 -1
index 47c1d44..d11eabc 100644
@@ -33,7 +33,7 @@ const struct file_operations generic_ro_fops = {
 
 EXPORT_SYMBOL(generic_ro_fops);
 
-static inline int unsigned_offsets(struct file *file)
+static inline fmode_t unsigned_offsets(struct file *file)
 {
 	return file->f_mode & FMODE_UNSIGNED_OFFSET;
 }
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 2 lines · Pushkar Jambhlekar

unsigned_offsets function returns fmode_t but function definition returns int. sparse generate warning. Updating proper return type

You do realize that it's a predicate? This is actually one case where bool would be appropriate...