[PATCH v2] ext4: remove set but rewrite variables

Subsystems: ext4 file system, filesystems (vfs and infrastructure), the rest

STALE1926d LANDED: 1 (0M)

1 review trailer; landed in mainline as b2d2e7573548 on 2021-06-23.

2 messages, 2 authors, 2021-06-17 · open the first message on its own page

[PATCH v2] ext4: remove set but rewrite variables

From: Tian Tao <tiantao6@hisilicon.com>
Date: 2021-05-20 06:55:58

In the ext4_dx_add_entry function, the at variable is assigned but will
reset just after “again:” label. So delete the unnecessary assignment.
this will not chang the logic.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Artem Blagodarenko <redacted>
---

v2: update the commit message.
---
 fs/ext4/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index afb9d05..18bbf15 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2497,7 +2497,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct ext4_filename *fname,
 
 			/* Which index block gets the new entry? */
 			if (at - entries >= icount1) {
-				frame->at = at = at - entries - icount1 + entries2;
+				frame->at = at - entries - icount1 + entries2;
 				frame->entries = entries = entries2;
 				swap(frame->bh, bh2);
 			}
-- 
2.7.4

Re: [PATCH v2] ext4: remove set but rewrite variables

From: "Theodore Ts'o" <tytso@mit.edu>
Date: 2021-06-17 15:01:24

On Thu, May 20, 2021 at 02:55:52PM +0800, Tian Tao wrote:
In the ext4_dx_add_entry function, the at variable is assigned but will
reset just after “again:” label. So delete the unnecessary assignment.
this will not chang the logic.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Artem Blagodarenko <redacted>
Applied, thanks.

					- Ted
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help