Commit 5012542
btrfs: remove redundant zero/NULL initializations in btrfs_alloc_root()
We have allocated the root with kzalloc() so all the memory is already
zero initialized, therefore it's redundant to assign 0 and NULL to several
of the root members. Remove all of them except the atomic initializations
since atomic_t is an opaque type and it's not a good practice to assume
its internals.
This slightly reduces the binary size.
With gcc 14.2.0-19 from Debian on x86_64, before this change:
$ size fs/btrfs/btrfs.ko
text data bss dec hex filename
1939404 162963 15592 2117959 205147 fs/btrfs/btrfs.ko
After this change:
$ size fs/btrfs/btrfs.ko
text data bss dec hex filename
1939212 162963 15592 2117767 205087 fs/btrfs/btrfs.ko
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent e539c07 commit 5012542
1 file changed
+0
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | 655 | | |
659 | 656 | | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | 657 | | |
664 | 658 | | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | 659 | | |
670 | 660 | | |
671 | 661 | | |
| |||
699 | 689 | | |
700 | 690 | | |
701 | 691 | | |
702 | | - | |
703 | 692 | | |
704 | | - | |
705 | | - | |
706 | 693 | | |
707 | 694 | | |
708 | 695 | | |
| |||
0 commit comments