Skip to content

Commit

Permalink
configfs: Fix bool initialization/comparison
Browse files Browse the repository at this point in the history
Bool initializations should use true and false. Bool tests don't need
comparisons.

Signed-off-by: Thomas Meyer <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
  • Loading branch information
thomasmey authored and Christoph Hellwig committed Oct 19, 2017
1 parent 33d930e commit 3f6928c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fs/configfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ configfs_read_bin_file(struct file *file, char __user *buf,
retval = -ETXTBSY;
goto out;
}
buffer->read_in_progress = 1;
buffer->read_in_progress = true;

if (buffer->needs_read_fill) {
/* perform first read with buf == NULL to get extent */
Expand Down Expand Up @@ -325,7 +325,7 @@ configfs_write_bin_file(struct file *file, const char __user *buf,
len = -ETXTBSY;
goto out;
}
buffer->write_in_progress = 1;
buffer->write_in_progress = true;

/* buffer grows? */
if (*ppos + count > buffer->bin_buffer_size) {
Expand Down Expand Up @@ -429,8 +429,8 @@ static int check_perm(struct inode * inode, struct file * file, int type)
}
mutex_init(&buffer->mutex);
buffer->needs_read_fill = 1;
buffer->read_in_progress = 0;
buffer->write_in_progress = 0;
buffer->read_in_progress = false;
buffer->write_in_progress = false;
buffer->ops = ops;
file->private_data = buffer;
goto Done;
Expand Down Expand Up @@ -488,10 +488,10 @@ static int configfs_release_bin_file(struct inode *inode, struct file *filp)
ssize_t len = 0;
int ret;

buffer->read_in_progress = 0;
buffer->read_in_progress = false;

if (buffer->write_in_progress) {
buffer->write_in_progress = 0;
buffer->write_in_progress = false;

len = bin_attr->write(item, buffer->bin_buffer,
buffer->bin_buffer_size);
Expand Down

0 comments on commit 3f6928c

Please sign in to comment.