Commit bd379f9e authored by J. R. Okajima's avatar J. R. Okajima
Browse files

aufs: for v5.1-rc1, minor, convert some BUILD_BUG_ON into static_assert



With a little hope to make it easier to read.
Signed-off-by: default avatarJ. R. Okajima <hooanon05g@gmail.com>
parent 32bbcb2c
...@@ -341,9 +341,6 @@ void __init au_dy_init(void) ...@@ -341,9 +341,6 @@ void __init au_dy_init(void)
{ {
int i; int i;
/* make sure that 'struct au_dykey *' can be any type */
BUILD_BUG_ON(offsetof(struct au_dyaop, da_key));
for (i = 0; i < AuDyLast; i++) for (i = 0; i < AuDyLast; i++)
INIT_HLIST_BL_HEAD(dynop + i); INIT_HLIST_BL_HEAD(dynop + i);
} }
......
...@@ -44,6 +44,8 @@ struct au_dyaop { ...@@ -44,6 +44,8 @@ struct au_dyaop {
struct au_dykey da_key; struct au_dykey da_key;
struct address_space_operations da_op; /* not const */ struct address_space_operations da_op; /* not const */
}; };
/* make sure that 'struct au_dykey *' can be any type */
static_assert(!offsetof(struct au_dyaop, da_key));
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
......
...@@ -116,7 +116,7 @@ int au_loopback_init(void) ...@@ -116,7 +116,7 @@ int au_loopback_init(void)
int err; int err;
struct super_block *sb __maybe_unused; struct super_block *sb __maybe_unused;
BUILD_BUG_ON(sizeof(sb->s_magic) != sizeof(unsigned long)); BUILD_BUG_ON(sizeof(sb->s_magic) != sizeof(*au_warn_loopback_array));
err = 0; err = 0;
au_warn_loopback_array = kcalloc(au_warn_loopback_step, au_warn_loopback_array = kcalloc(au_warn_loopback_step,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment