Message ID | 22e345124a6e35e4dbc07e9564475b5c97b37a41.1729075703.git.fdmanana@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs: some cleanups around read_block_for_search() | expand |
On Wed, Oct 16, 2024 at 03:20:22PM +0100, fdmanana@kernel.org wrote: > From: Filipe Manana <fdmanana@suse.com> > > It's pointless to initialize the has_first_key field of the stack local > btrfs_tree_parent_check structure since it all fields not explicitly > initialized are zeroed out, plus it's a bit odd because the field is > of type bool and we are assigning 0 instead of false to it (however it's > not incorrect since 0 is converted to false). Just remove the explicit > initialization due to its redundancy. Makes sense, I've noticed there's one more to remove from btrfs_qgroup_trace_subtree() you can squash it to this patch too.
On Wed, Oct 16, 2024 at 4:49 PM David Sterba <dsterba@suse.cz> wrote: > > On Wed, Oct 16, 2024 at 03:20:22PM +0100, fdmanana@kernel.org wrote: > > From: Filipe Manana <fdmanana@suse.com> > > > > It's pointless to initialize the has_first_key field of the stack local > > btrfs_tree_parent_check structure since it all fields not explicitly > > initialized are zeroed out, plus it's a bit odd because the field is > > of type bool and we are assigning 0 instead of false to it (however it's > > not incorrect since 0 is converted to false). Just remove the explicit > > initialization due to its redundancy. > > Makes sense, I've noticed there's one more to remove from > btrfs_qgroup_trace_subtree() you can squash it to this patch too. Ah yes, done and added to for-next. Thanks.
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 09c0d18a7b5a..0a0c84eb1c42 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -4285,7 +4285,6 @@ void btrfs_readahead_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr, u64 owner_root, u64 gen, int level) { struct btrfs_tree_parent_check check = { - .has_first_key = 0, .level = level, .transid = gen };