2023-09-20 05:44:10

by Nick Desaulniers

[permalink] [raw]
Subject: [PATCH] bcachefs: Fix -Wself-assign

Fixes the following observed error reported by Nathan on IRC.

fs/bcachefs/io_misc.c:467:6: error: explicitly assigning value of
variable of type 'int' to itself [-Werror,-Wself-assign]
467 | ret = ret;
| ~~~ ^ ~~~

Reported-by: Nathan Chancellor <[email protected]>
Signed-off-by: Nick Desaulniers <[email protected]>
---
fs/bcachefs/io_misc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/bcachefs/io_misc.c b/fs/bcachefs/io_misc.c
index 668493bcfe36..32432bdddac4 100644
--- a/fs/bcachefs/io_misc.c
+++ b/fs/bcachefs/io_misc.c
@@ -462,9 +462,9 @@ case LOGGED_OP_FINSERT_shift_extents:
bch2_logged_op_update(trans, &op->k_i));
}

- fallthrough;
+ break;
case LOGGED_OP_FINSERT_finish:
- ret = ret;
+ break;
}
err:
bch2_logged_op_finish(trans, op_k);

---
base-commit: 29e400e3ea486bf942b214769fc9778098114113
change-id: 20230919-bcachefs_self_assign-2ac43143a8cc

Best regards,
--
Nick Desaulniers <[email protected]>