linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] FS: Making aproriate return type
@ 2017-05-11  4:14 Pushkar Jambhlekar
  2017-05-11  4:20 ` Al Viro
  0 siblings, 1 reply; 2+ messages in thread
From: Pushkar Jambhlekar @ 2017-05-11  4:14 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel, linux-kernel, Pushkar Jambhlekar

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] FS: Making aproriate return type
  2017-05-11  4:14 [PATCH] FS: Making aproriate return type Pushkar Jambhlekar
@ 2017-05-11  4:20 ` Al Viro
  0 siblings, 0 replies; 2+ messages in thread
From: Al Viro @ 2017-05-11  4:20 UTC (permalink / raw)
  To: Pushkar Jambhlekar; +Cc: linux-fsdevel, linux-kernel

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...

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-11  4:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-11  4:14 [PATCH] FS: Making aproriate return type Pushkar Jambhlekar
2017-05-11  4:20 ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).