Skip to contentSkip to conversation

btrfs: Remove extra parentheses from condition in copy_items()

PATCH Superseded Matthias Kaehlcke 2 participants 2 messages Jul 26, 2017 – Jul 27, 2017 Btrfs file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: Remove extra parentheses from condition in copy_items()

There is no need for the extra pair of parentheses, remove it. This fixes the following warning when building with clang:

fs/btrfs/tree-log.c:3694:10: warning: equality comparison with extraneous
parentheses [-Wparentheses-equality]

                if ((i == (nr - 1)))
                     ~~^~~~~~~~~~~
---
 fs/btrfs/tree-log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/tree-log.c +1 -1
index f20ef211a73d..b92408a3f834 100644
@@ -3691,7 +3691,7 @@ static noinline int copy_items(struct btrfs_trans_handle *trans,
 
 		src_offset = btrfs_item_ptr_offset(src, start_slot + i);
 
-		if ((i == (nr - 1)))
+		if (i == (nr - 1))
 			last_key = ins_keys[i];
 
 		if (ins_keys[i].type == BTRFS_INODE_ITEM_KEY) {
Signature · 1 line
2.14.0.rc0.400.g1c36432dff-goog
#1 lore raw

fs/btrfs/tree-log.c static noinline int copy_items(struct btrfs_trans_handle *trans, · line 3694

Quoted 2 lines
fs/btrfs/tree-log.c +1 -1
-		if ((i == (nr - 1)))
+		if (i == (nr - 1))

Please remove the other set of redundant parentheses as well if you change that line.