bcachefs: Fix some spurious gcc warnings
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 3 Dec 2020 18:09:08 +0000 (13:09 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:49 +0000 (17:08 -0400)
These only come up when building in userspace, for some reason.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_key_cache.c
fs/bcachefs/movinggc.c

index 83156bc45e7bed4272d8527cc656b5a759752320..7416e7a4989389b5f37c944c760497b920844310 100644 (file)
@@ -317,7 +317,7 @@ static int btree_key_cache_flush_pos(struct btree_trans *trans,
        struct bch_fs *c = trans->c;
        struct journal *j = &c->journal;
        struct btree_iter *c_iter = NULL, *b_iter = NULL;
-       struct bkey_cached *ck;
+       struct bkey_cached *ck = NULL;
        int ret;
 
        b_iter = bch2_trans_get_iter(trans, key.btree_id, key.pos,
index a9775cc84f66332d258169985deed2ae1fc156c5..f0cfd109a02215cbab3f29938383661d5dfee4d1 100644 (file)
@@ -61,7 +61,7 @@ static enum data_cmd copygc_pred(struct bch_fs *c, void *arg,
        copygc_heap *h = &c->copygc_heap;
        struct bkey_ptrs_c ptrs = bch2_bkey_ptrs_c(k);
        const union bch_extent_entry *entry;
-       struct extent_ptr_decoded p;
+       struct extent_ptr_decoded p = { 0 };
 
        bkey_for_each_ptr_decode(k.k, ptrs, p, entry) {
                struct bch_dev *ca = bch_dev_bkey_exists(c, p.ptr.dev);