[PATCH] fs: ubifs: Remove unnecessary assignment

Variable self assignment has been found by clang. But Linux kernel already fixed this problem by commit 2a068daf5742 ("ubifs: Remove unnecessary assignment") and commit ae4c8081eb77 ("ubifs: remove unnecessary assignment").
Signed-off-by: Michal Simek michal.simek@amd.com ---
fs/ubifs/recovery.c | 1 - fs/ubifs/scan.c | 1 - 2 files changed, 2 deletions(-)
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c index 6b6884fb2098..12c0575cc976 100644 --- a/fs/ubifs/recovery.c +++ b/fs/ubifs/recovery.c @@ -439,7 +439,6 @@ static void clean_buf(const struct ubifs_info *c, void **buf, int lnum, { int empty_offs, pad_len;
- lnum = lnum; dbg_rcvry("cleaning corruption at %d:%d", lnum, *offs);
ubifs_assert(!(*offs & 7)); diff --git a/fs/ubifs/scan.c b/fs/ubifs/scan.c index 7a6e46df5d90..2335e9e2d256 100644 --- a/fs/ubifs/scan.c +++ b/fs/ubifs/scan.c @@ -169,7 +169,6 @@ struct ubifs_scan_leb *ubifs_start_scan(const struct ubifs_info *c, int lnum, void ubifs_end_scan(const struct ubifs_info *c, struct ubifs_scan_leb *sleb, int lnum, int offs) { - lnum = lnum; dbg_scan("stop scanning LEB %d at offset %d", lnum, offs); ubifs_assert(offs % c->min_io_size == 0);

Hello Michal,
Am Fri, Jan 24, 2025 at 02:17:57PM +0100 schrieb Michal Simek:
Variable self assignment has been found by clang. But Linux kernel already fixed this problem by commit 2a068daf5742 ("ubifs: Remove unnecessary assignment") and commit ae4c8081eb77 ("ubifs: remove unnecessary assignment").
Signed-off-by: Michal Simek michal.simek@amd.com
fs/ubifs/recovery.c | 1 - fs/ubifs/scan.c | 1 - 2 files changed, 2 deletions(-)
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c index 6b6884fb2098..12c0575cc976 100644 --- a/fs/ubifs/recovery.c +++ b/fs/ubifs/recovery.c @@ -439,7 +439,6 @@ static void clean_buf(const struct ubifs_info *c, void **buf, int lnum, { int empty_offs, pad_len;
lnum = lnum; dbg_rcvry("cleaning corruption at %d:%d", lnum, *offs);
ubifs_assert(!(*offs & 7));
diff --git a/fs/ubifs/scan.c b/fs/ubifs/scan.c index 7a6e46df5d90..2335e9e2d256 100644 --- a/fs/ubifs/scan.c +++ b/fs/ubifs/scan.c @@ -169,7 +169,6 @@ struct ubifs_scan_leb *ubifs_start_scan(const struct ubifs_info *c, int lnum, void ubifs_end_scan(const struct ubifs_info *c, struct ubifs_scan_leb *sleb, int lnum, int offs) {
- lnum = lnum; dbg_scan("stop scanning LEB %d at offset %d", lnum, offs); ubifs_assert(offs % c->min_io_size == 0);
Wow, these are old, both date back to 2009 in U-Boot.
Reviewed-by: Alexander Dahl ada@thorsis.com
Greets Alex

On Fri, Jan 24, 2025 at 2:18 PM Michal Simek michal.simek@amd.com wrote:
Variable self assignment has been found by clang. But Linux kernel already fixed this problem by commit 2a068daf5742 ("ubifs: Remove unnecessary assignment") and commit ae4c8081eb77 ("ubifs: remove unnecessary assignment").
Signed-off-by: Michal Simek michal.simek@amd.com
fs/ubifs/recovery.c | 1 - fs/ubifs/scan.c | 1 - 2 files changed, 2 deletions(-)
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c index 6b6884fb2098..12c0575cc976 100644 --- a/fs/ubifs/recovery.c +++ b/fs/ubifs/recovery.c @@ -439,7 +439,6 @@ static void clean_buf(const struct ubifs_info *c, void **buf, int lnum, { int empty_offs, pad_len;
lnum = lnum; dbg_rcvry("cleaning corruption at %d:%d", lnum, *offs); ubifs_assert(!(*offs & 7));
diff --git a/fs/ubifs/scan.c b/fs/ubifs/scan.c index 7a6e46df5d90..2335e9e2d256 100644 --- a/fs/ubifs/scan.c +++ b/fs/ubifs/scan.c @@ -169,7 +169,6 @@ struct ubifs_scan_leb *ubifs_start_scan(const struct ubifs_info *c, int lnum, void ubifs_end_scan(const struct ubifs_info *c, struct ubifs_scan_leb *sleb, int lnum, int offs) {
lnum = lnum; dbg_scan("stop scanning LEB %d at offset %d", lnum, offs); ubifs_assert(offs % c->min_io_size == 0);
Reviewed-by: Michael Trimarchi michael@amarulasolutions.com
-- 2.43.0
-- Michael Nazzareno Trimarchi Co-Founder & Chief Executive Officer M. +39 347 913 2170 michael@amarulasolutions.com __________________________________
Amarula Solutions BV Joop Geesinkweg 125, 1114 AB, Amsterdam, NL T. +31 (0)85 111 9172 info@amarulasolutions.com www.amarulasolutions.com

Hi Michal,
On 24.01.25 14:17, Michal Simek wrote:
Variable self assignment has been found by clang. But Linux kernel already fixed this problem by commit 2a068daf5742 ("ubifs: Remove unnecessary assignment") and commit ae4c8081eb77 ("ubifs: remove unnecessary assignment").
Signed-off-by: Michal Simek michal.simek@amd.com
fs/ubifs/recovery.c | 1 - fs/ubifs/scan.c | 1 - 2 files changed, 2 deletions(-)
Thanks! Yep, ubi/ubifs code base is old...
Reviewed-by: Heiko Schocher hs@denx.de
bye, Heiko

Hello Michal,
On 24.01.25 14:17, Michal Simek wrote:
Variable self assignment has been found by clang. But Linux kernel already fixed this problem by commit 2a068daf5742 ("ubifs: Remove unnecessary assignment") and commit ae4c8081eb77 ("ubifs: remove unnecessary assignment").
Signed-off-by: Michal Simek michal.simek@amd.com
fs/ubifs/recovery.c | 1 - fs/ubifs/scan.c | 1 - 2 files changed, 2 deletions(-)
Applied to u-boot-ubi master
Thanks!
bye, Heiko
participants (4)
-
Alexander Dahl
-
Heiko Schocher
-
Michael Nazzareno Trimarchi
-
Michal Simek