From: Matt Fleming Date: Fri, 11 Jan 2013 13:30:46 +0000 (+0000) Subject: efivarfs: Use sizeof() instead of magic number X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=94a193fb7393a50625abd9ca21f8afea275a9f87;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: Chun-Yi Lee Cc: Andy Whitcroft Reported-by: Lingzhu Xiang Signed-off-by: Matt Fleming --- diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index f5596db0cf58..371c44129525 100644 --- a/drivers/firmware/efivars.c +++ b/drivers/firmware/efivars.c @@ -1076,7 +1076,7 @@ static int efivarfs_fill_super(struct super_block *sb, void *data, int silent) mutex_lock(&inode->i_mutex); inode->i_private = entry; - i_size_write(inode, size+4); + i_size_write(inode, size + sizeof(entry->var.Attributes)); mutex_unlock(&inode->i_mutex); d_add(dentry, inode); }