Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1639189
| From | Joe Perches <joe@perches.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] FS: Fixing return type of unsigned_offsets |
| Date | 2017-05-11 06:50 +0200 |
| Message-ID | <tFOd4-1Ci-7@gated-at.bofh.it> (permalink) |
| References | <tFNTH-1w1-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] FS: Fixing return type of unsigned_offsets Pushkar Jambhlekar <pushkar.iit@gmail.com> - 2017-05-11 06:30 +0200
Re: [PATCH] FS: Fixing return type of unsigned_offsets Pushkar Jambhlekar <pushkar.iit@gmail.com> - 2017-05-11 06:50 +0200
Re: [PATCH] FS: Fixing return type of unsigned_offsets Joe Perches <joe@perches.com> - 2017-05-11 07:00 +0200
Re: [PATCH] FS: Fixing return type of unsigned_offsets Pushkar Jambhlekar <pushkar.iit@gmail.com> - 2017-05-11 07:10 +0200
Re: [PATCH] FS: Fixing return type of unsigned_offsets Al Viro <viro@ZenIV.linux.org.uk> - 2017-05-11 08:10 +0200
Re: [PATCH] FS: Fixing return type of unsigned_offsets Luc Van Oostenryck <luc.vanoostenryck@gmail.com> - 2017-05-11 22:10 +0200
Re: [PATCH] FS: Fixing return type of unsigned_offsets Joe Perches <joe@perches.com> - 2017-05-11 06:50 +0200
csiph-web