Skip to content

Commit

Permalink
efivarfs: Use sizeof() instead of magic number
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matt Fleming committed Jan 31, 2013
1 parent deb9410 commit 94a193f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/firmware/efivars.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 94a193f

Please sign in to comment.