diff options
author | Matt Fleming <matt.fleming@intel.com> | 2013-01-11 08:30:46 -0500 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2013-01-31 09:44:44 -0500 |
commit | 94a193fb7393a50625abd9ca21f8afea275a9f87 (patch) | |
tree | 3a2ae392ae294bc5f67da5f43f725819f8a1a913 /drivers/firmware | |
parent | deb94101c4fda22e152c2a311210cf09ae51adf6 (diff) |
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: Lingzhu Xiang <lxiang@redhat.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/efivars.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
1076 | 1076 | ||
1077 | mutex_lock(&inode->i_mutex); | 1077 | mutex_lock(&inode->i_mutex); |
1078 | inode->i_private = entry; | 1078 | inode->i_private = entry; |
1079 | i_size_write(inode, size+4); | 1079 | i_size_write(inode, size + sizeof(entry->var.Attributes)); |
1080 | mutex_unlock(&inode->i_mutex); | 1080 | mutex_unlock(&inode->i_mutex); |
1081 | d_add(dentry, inode); | 1081 | d_add(dentry, inode); |
1082 | } | 1082 | } |