Commit 94a193fb authored by Matt Fleming's avatar Matt Fleming

efivarfs: Use sizeof() instead of magic number

Instead of adding a magic 4 to the variable size, use sizeof() to make
it explicitly clear what the quantity represents (the variable's
attributes).

CC: Jeremy Kerr <jeremy.kerr@canonical.com>
Cc: Chun-Yi Lee <joeyli.kernel@gmail.com>
Cc: Andy Whitcroft <apw@canonical.com>
Reported-by: default avatarLingzhu Xiang <lxiang@redhat.com>
Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
parent deb94101
...@@ -1076,7 +1076,7 @@ static int efivarfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -1076,7 +1076,7 @@ static int efivarfs_fill_super(struct super_block *sb, void *data, int silent)
mutex_lock(&inode->i_mutex); mutex_lock(&inode->i_mutex);
inode->i_private = entry; inode->i_private = entry;
i_size_write(inode, size+4); i_size_write(inode, size + sizeof(entry->var.Attributes));
mutex_unlock(&inode->i_mutex); mutex_unlock(&inode->i_mutex);
d_add(dentry, inode); d_add(dentry, inode);
} }
......
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