Linux-ext4 Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] ext4: use true,false for bool variable
@ 2019-12-25  2:45 zhengbin
  2020-01-09 10:22 ` Jan Kara
  0 siblings, 1 reply; 3+ messages in thread
From: zhengbin @ 2019-12-25  2:45 UTC (permalink / raw)
  To: tytso, adilger.kernel, linux-ext4; +Cc: zhengbin13, yi.zhang

Fixes coccicheck warning:

fs/ext4/extents.c:5271:6-12: WARNING: Assignment of 0/1 to bool variable
fs/ext4/extents.c:5287:4-10: WARNING: Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 fs/ext4/extents.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 0e8708b..d8611be 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -5268,7 +5268,7 @@ ext4_ext_shift_path_extents(struct ext4_ext_path *path, ext4_lblk_t shift,
 {
 	int depth, err = 0;
 	struct ext4_extent *ex_start, *ex_last;
-	bool update = 0;
+	bool update = false;
 	depth = path->p_depth;

 	while (depth >= 0) {
@@ -5284,7 +5284,7 @@ ext4_ext_shift_path_extents(struct ext4_ext_path *path, ext4_lblk_t shift,
 				goto out;

 			if (ex_start == EXT_FIRST_EXTENT(path[depth].p_hdr))
-				update = 1;
+				update = true;

 			while (ex_start <= ex_last) {
 				if (SHIFT == SHIFT_LEFT) {
--
2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: use true,false for bool variable
  2019-12-25  2:45 [PATCH] ext4: use true,false for bool variable zhengbin
@ 2020-01-09 10:22 ` Jan Kara
  2020-01-13 19:04   ` Theodore Y. Ts'o
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2020-01-09 10:22 UTC (permalink / raw)
  To: zhengbin; +Cc: tytso, adilger.kernel, linux-ext4, yi.zhang

On Wed 25-12-19 10:45:59, zhengbin wrote:
> Fixes coccicheck warning:
> 
> fs/ext4/extents.c:5271:6-12: WARNING: Assignment of 0/1 to bool variable
> fs/ext4/extents.c:5287:4-10: WARNING: Assignment of 0/1 to bool variable
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>

Looks good to me. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/ext4/extents.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index 0e8708b..d8611be 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -5268,7 +5268,7 @@ ext4_ext_shift_path_extents(struct ext4_ext_path *path, ext4_lblk_t shift,
>  {
>  	int depth, err = 0;
>  	struct ext4_extent *ex_start, *ex_last;
> -	bool update = 0;
> +	bool update = false;
>  	depth = path->p_depth;
> 
>  	while (depth >= 0) {
> @@ -5284,7 +5284,7 @@ ext4_ext_shift_path_extents(struct ext4_ext_path *path, ext4_lblk_t shift,
>  				goto out;
> 
>  			if (ex_start == EXT_FIRST_EXTENT(path[depth].p_hdr))
> -				update = 1;
> +				update = true;
> 
>  			while (ex_start <= ex_last) {
>  				if (SHIFT == SHIFT_LEFT) {
> --
> 2.7.4
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: use true,false for bool variable
  2020-01-09 10:22 ` Jan Kara
@ 2020-01-13 19:04   ` Theodore Y. Ts'o
  0 siblings, 0 replies; 3+ messages in thread
From: Theodore Y. Ts'o @ 2020-01-13 19:04 UTC (permalink / raw)
  To: Jan Kara; +Cc: zhengbin, adilger.kernel, linux-ext4, yi.zhang

On Thu, Jan 09, 2020 at 11:22:54AM +0100, Jan Kara wrote:
> On Wed 25-12-19 10:45:59, zhengbin wrote:
> > Fixes coccicheck warning:
> > 
> > fs/ext4/extents.c:5271:6-12: WARNING: Assignment of 0/1 to bool variable
> > fs/ext4/extents.c:5287:4-10: WARNING: Assignment of 0/1 to bool variable
> > 
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Signed-off-by: zhengbin <zhengbin13@huawei.com>
> 
> Looks good to me. You can add:
> 
> Reviewed-by: Jan Kara <jack@suse.cz>

Applied, thanks.

					- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-25  2:45 [PATCH] ext4: use true,false for bool variable zhengbin
2020-01-09 10:22 ` Jan Kara
2020-01-13 19:04   ` Theodore Y. Ts'o

Linux-ext4 Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-ext4/0 linux-ext4/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-ext4 linux-ext4/ https://lore.kernel.org/linux-ext4 \
		linux-ext4@vger.kernel.org
	public-inbox-index linux-ext4

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-ext4


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git