Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1639182 > unrolled thread

[PATCH] FS: Making aproriate return type

Started byPushkar Jambhlekar <pushkar.iit@gmail.com>
First post2017-05-11 06:20 +0200
Last post2017-05-11 06:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] FS: Making aproriate return type Pushkar Jambhlekar <pushkar.iit@gmail.com> - 2017-05-11 06:20 +0200
    Re: [PATCH] FS: Making aproriate return type Al Viro <viro@ZenIV.linux.org.uk> - 2017-05-11 06:30 +0200

#1639182 — [PATCH] FS: Making aproriate return type

FromPushkar Jambhlekar <pushkar.iit@gmail.com>
Date2017-05-11 06:20 +0200
Subject[PATCH] FS: Making aproriate return type
Message-ID<tFNK1-1q6-1@gated-at.bofh.it>
unsigned_offsets function returns fmode_t but function definition returns int. sparse generate warning.
Updating proper return type

Signed-off-by: Pushkar Jambhlekar <pushkar.iit@gmail.com>
---
 fs/read_write.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/read_write.c b/fs/read_write.c
index 47c1d44..d11eabc 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -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;
 }
-- 
2.7.4

[toc] | [next] | [standalone]


#1639185

FromAl Viro <viro@ZenIV.linux.org.uk>
Date2017-05-11 06:30 +0200
Message-ID<tFNTH-1w1-7@gated-at.bofh.it>
In reply to#1639182
On Thu, May 11, 2017 at 09:44:09AM +0530, Pushkar Jambhlekar wrote:
> 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...

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web