]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: replace BUILD_BUG_ON by static_assert
authorDavid Sterba <dsterba@suse.com>
Tue, 1 Feb 2022 14:42:07 +0000 (15:42 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 14 Mar 2022 12:13:49 +0000 (13:13 +0100)
commit81169d0b67aee1ec8d5f3e74ae1e3975b2e44cda
tree5ea5614ade87650c895b1308f9c69cd3e59fad32
parenteb418a861cb28ed1c2d2c3bf2163f29d5ed6c0a3
btrfs: replace BUILD_BUG_ON by static_assert

The static_assert introduced in 6ae32334cc71 ("build_bug.h: add wrapper
for _Static_assert") has been supported by compilers for a long time
(gcc 4.6, clang 3.0) and can be used in header files. We don't need to
put BUILD_BUG_ON to random functions but rather keep it next to the
definition.

The exception here is the UAPI header btrfs_tree.h that could be
potentially included by userspace code and the static assert is not
defined (nor used in any other header).

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.h
fs/btrfs/ctree.h
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/sysfs.c