Commit 539938da authored by Thomas Meyer's avatar Thomas Meyer Committed by Greg Kroah-Hartman

configfs: Fix bool initialization/comparison

commit 3f6928c3 upstream.

Bool initializations should use true and false. Bool tests don't need
comparisons.
Signed-off-by: default avatarThomas Meyer <thomas@m3y3r.de>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent da281558
...@@ -166,7 +166,7 @@ configfs_read_bin_file(struct file *file, char __user *buf, ...@@ -166,7 +166,7 @@ configfs_read_bin_file(struct file *file, char __user *buf,
retval = -ETXTBSY; retval = -ETXTBSY;
goto out; goto out;
} }
buffer->read_in_progress = 1; buffer->read_in_progress = true;
if (buffer->needs_read_fill) { if (buffer->needs_read_fill) {
/* perform first read with buf == NULL to get extent */ /* perform first read with buf == NULL to get extent */
...@@ -325,7 +325,7 @@ configfs_write_bin_file(struct file *file, const char __user *buf, ...@@ -325,7 +325,7 @@ configfs_write_bin_file(struct file *file, const char __user *buf,
len = -ETXTBSY; len = -ETXTBSY;
goto out; goto out;
} }
buffer->write_in_progress = 1; buffer->write_in_progress = true;
/* buffer grows? */ /* buffer grows? */
if (*ppos + count > buffer->bin_buffer_size) { if (*ppos + count > buffer->bin_buffer_size) {
...@@ -429,8 +429,8 @@ static int check_perm(struct inode * inode, struct file * file, int type) ...@@ -429,8 +429,8 @@ static int check_perm(struct inode * inode, struct file * file, int type)
} }
mutex_init(&buffer->mutex); mutex_init(&buffer->mutex);
buffer->needs_read_fill = 1; buffer->needs_read_fill = 1;
buffer->read_in_progress = 0; buffer->read_in_progress = false;
buffer->write_in_progress = 0; buffer->write_in_progress = false;
buffer->ops = ops; buffer->ops = ops;
file->private_data = buffer; file->private_data = buffer;
goto Done; goto Done;
...@@ -488,10 +488,10 @@ static int configfs_release_bin_file(struct inode *inode, struct file *filp) ...@@ -488,10 +488,10 @@ static int configfs_release_bin_file(struct inode *inode, struct file *filp)
ssize_t len = 0; ssize_t len = 0;
int ret; int ret;
buffer->read_in_progress = 0; buffer->read_in_progress = false;
if (buffer->write_in_progress) { if (buffer->write_in_progress) {
buffer->write_in_progress = 0; buffer->write_in_progress = false;
len = bin_attr->write(item, buffer->bin_buffer, len = bin_attr->write(item, buffer->bin_buffer,
buffer->bin_buffer_size); buffer->bin_buffer_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment