[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1494477592.2028.7.camel@perches.com>
Date: Wed, 10 May 2017 21:39:52 -0700
From: Joe Perches <joe@...ches.com>
To: Pushkar Jambhlekar <pushkar.iit@...il.com>,
Al Viro <viro@...iv.linux.org.uk>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] FS: Fixing return type of unsigned_offsets
On Thu, 2017-05-11 at 09:57 +0530, Pushkar Jambhlekar wrote:
> Fixing Sparse warning. It should return bool, instead it returns
> int.
[]
> diff --git a/fs/read_write.c b/fs/read_write.c
[]
> @@ -33,9 +33,9 @@ const struct file_operations generic_ro_fops = {
>
> EXPORT_SYMBOL(generic_ro_fops);
>
> -static inline int unsigned_offsets(struct file *file)
> +static inline bool unsigned_offsets(struct file *file)
> {
> - return file->f_mode & FMODE_UNSIGNED_OFFSET;
> + return !!(file->f_mode & FMODE_UNSIGNED_OFFSET);
trivia: the !! isn't necessary as by definition
all non-zero assigns to bool are converted to 1.
Powered by blists - more mailing lists