* [PATCH] bcachefs: fix invalid declaration after label in str_hash.c
@ 2024-12-12 10:49 Zhou Ding
2024-12-13 3:27 ` Hongbo Li
0 siblings, 1 reply; 2+ messages in thread
From: Zhou Ding @ 2024-12-12 10:49 UTC (permalink / raw)
To: kent.overstreet; +Cc: linux-bcachefs, linux-kernel, Zhou Ding
We get 1 error when building kernel withW=1:
fs/bcachefs/str_hash.c:164:2: error: a label can only be part of a statement and a declaration is not a statement
To resolve this, the code after the found: label was enclosed in a block
to comply with C89 rules, without affecting the logic of the code.
Signed-off-by: Zhou Ding <zhouding@cmss.chinamobile.com>
---
fs/bcachefs/str_hash.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/bcachefs/str_hash.c b/fs/bcachefs/str_hash.c
index ed3c852fc0be..08625947ed99 100644
--- a/fs/bcachefs/str_hash.c
+++ b/fs/bcachefs/str_hash.c
@@ -160,7 +160,7 @@ static int check_inode_hash_info_matches_root(struct btree_trans *trans, u64 inu
bch_err(c, "%s(): inum %llu not found", __func__, inum);
ret = -BCH_ERR_fsck_repair_unimplemented;
goto err;
-found:
+found:{
struct bch_inode_unpacked inode;
ret = bch2_inode_unpack(k, &inode);
if (ret)
@@ -174,6 +174,7 @@ static int check_inode_hash_info_matches_root(struct btree_trans *trans, u64 inu
ret = -BCH_ERR_fsck_repair_unimplemented;
}
}
+}
err:
bch2_trans_iter_exit(trans, &iter);
return ret;
--
2.33.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] bcachefs: fix invalid declaration after label in str_hash.c
2024-12-12 10:49 [PATCH] bcachefs: fix invalid declaration after label in str_hash.c Zhou Ding
@ 2024-12-13 3:27 ` Hongbo Li
0 siblings, 0 replies; 2+ messages in thread
From: Hongbo Li @ 2024-12-13 3:27 UTC (permalink / raw)
To: Zhou Ding, kent.overstreet; +Cc: linux-bcachefs, linux-kernel
On 2024/12/12 18:49, Zhou Ding wrote:
> We get 1 error when building kernel withW=1:
> fs/bcachefs/str_hash.c:164:2: error: a label can only be part of a statement and a declaration is not a statement
>
> To resolve this, the code after the found: label was enclosed in a block
> to comply with C89 rules, without affecting the logic of the code.
>
> Signed-off-by: Zhou Ding <zhouding@cmss.chinamobile.com>
> ---
> fs/bcachefs/str_hash.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/bcachefs/str_hash.c b/fs/bcachefs/str_hash.c
> index ed3c852fc0be..08625947ed99 100644
> --- a/fs/bcachefs/str_hash.c
> +++ b/fs/bcachefs/str_hash.c
> @@ -160,7 +160,7 @@ static int check_inode_hash_info_matches_root(struct btree_trans *trans, u64 inu
> bch_err(c, "%s(): inum %llu not found", __func__, inum);
> ret = -BCH_ERR_fsck_repair_unimplemented;
> goto err;
> -found:
It has been fixed in [1].:)
Thanks,
Hongbo
[1]
https://lore.kernel.org/linux-bcachefs/qnfn3xzh6ve5cukeugxucloynbstf2itos3ddlmzu2w4sp7md7@7bkk2byif2ja/T/#t
> +found:{
> struct bch_inode_unpacked inode;
> ret = bch2_inode_unpack(k, &inode);
> if (ret)
> @@ -174,6 +174,7 @@ static int check_inode_hash_info_matches_root(struct btree_trans *trans, u64 inu
> ret = -BCH_ERR_fsck_repair_unimplemented;
> }
> }
> +}
> err:
> bch2_trans_iter_exit(trans, &iter);
> return ret;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-12-13 3:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-12 10:49 [PATCH] bcachefs: fix invalid declaration after label in str_hash.c Zhou Ding
2024-12-13 3:27 ` Hongbo Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®