2021-01-27 21:37:33

by Abaci Team

[permalink] [raw]
Subject: [PATCH] btrfs: Simplify the calculation of variables

Fix the following coccicheck warnings:

./fs/btrfs/delayed-inode.c:1157:39-41: WARNING !A || A && B is
equivalent to !A || B.

Reported-by: Abaci Robot <[email protected]>
Suggested-by: Jiapeng Zhong <[email protected]>
Signed-off-by: Abaci Team <[email protected]>
---
fs/btrfs/delayed-inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index 70c0340..ec0b50b8 100644
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -1154,7 +1154,7 @@ static int __btrfs_run_delayed_items(struct btrfs_trans_handle *trans, int nr)
delayed_root = fs_info->delayed_root;

curr_node = btrfs_first_delayed_node(delayed_root);
- while (curr_node && (!count || (count && nr--))) {
+ while (curr_node && (!count || nr--)) {
ret = __btrfs_commit_inode_delayed_items(trans, path,
curr_node);
if (ret) {
--
1.8.3.1


2021-01-28 00:01:47

by Josef Bacik

[permalink] [raw]
Subject: Re: [PATCH] btrfs: Simplify the calculation of variables

On 1/27/21 3:11 AM, Abaci Team wrote:
> Fix the following coccicheck warnings:
>
> ./fs/btrfs/delayed-inode.c:1157:39-41: WARNING !A || A && B is
> equivalent to !A || B.
>
> Reported-by: Abaci Robot <[email protected]>
> Suggested-by: Jiapeng Zhong <[email protected]>
> Signed-off-by: Abaci Team <[email protected]>

Reviewed-by: Josef Bacik <[email protected]>

Thanks,

Josef

2021-01-28 10:51:20

by David Sterba

[permalink] [raw]
Subject: Re: [PATCH] btrfs: Simplify the calculation of variables

On Wed, Jan 27, 2021 at 04:11:37PM +0800, Abaci Team wrote:
> Fix the following coccicheck warnings:
>
> ./fs/btrfs/delayed-inode.c:1157:39-41: WARNING !A || A && B is
> equivalent to !A || B.
>
> Reported-by: Abaci Robot <[email protected]>
> Suggested-by: Jiapeng Zhong <[email protected]>
> Signed-off-by: Abaci Team <[email protected]>

Added to misc-next, thanks.