]> Git Repo - linux.git/commitdiff
efivarfs: Use sizeof() instead of magic number
authorMatt Fleming <[email protected]>
Fri, 11 Jan 2013 13:30:46 +0000 (13:30 +0000)
committerMatt Fleming <[email protected]>
Thu, 31 Jan 2013 14:44:44 +0000 (14:44 +0000)
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 <[email protected]>
Cc: Chun-Yi Lee <[email protected]>
Cc: Andy Whitcroft <[email protected]>
Reported-by: Lingzhu Xiang <[email protected]>
Signed-off-by: Matt Fleming <[email protected]>
drivers/firmware/efivars.c

index f5596db0cf583dc16226bc629a42977de0f9fa05..371c441295253f536ccd8147d18b990c5d4f31df 100644 (file)
@@ -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);
        }
This page took 0.063497 seconds and 4 git commands to generate.