All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Pushkar Jambhlekar <pushkar.iit@gmail.com>,
	Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] FS: Fixing return type of unsigned_offsets
Date: Wed, 10 May 2017 21:39:52 -0700	[thread overview]
Message-ID: <1494477592.2028.7.camel@perches.com> (raw)
In-Reply-To: <1494476871-26474-1-git-send-email-pushkar.iit@gmail.com>

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.

  reply	other threads:[~2017-05-11  4:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11  4:27 [PATCH] FS: Fixing return type of unsigned_offsets Pushkar Jambhlekar
2017-05-11  4:39 ` Joe Perches [this message]
2017-05-11  4:43   ` Pushkar Jambhlekar
2017-05-11  4:55     ` Joe Perches
2017-05-11  4:55       ` Joe Perches
2017-05-11  5:04       ` Pushkar Jambhlekar
2017-05-11  6:07         ` Al Viro
2017-05-11 16:21           ` [PATCH] avoid useless warning for 'bool <- restricted type' conversion Luc Van Oostenryck
2017-05-11 19:41             ` Christopher Li
2017-05-11 19:48               ` Luc Van Oostenryck
2017-05-11 20:20               ` Luc Van Oostenryck
2017-05-11 20:09           ` [PATCH] FS: Fixing return type of unsigned_offsets Luc Van Oostenryck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1494477592.2028.7.camel@perches.com \
    --to=joe@perches.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pushkar.iit@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.