]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
efivarfs: remove unused efi_variable.Attributes and efivar_entry.kobj
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Tue, 7 Jan 2025 02:35:20 +0000 (18:35 -0800)
committerArd Biesheuvel <ardb@kernel.org>
Thu, 9 Jan 2025 14:25:14 +0000 (15:25 +0100)
These fields look to be remnants of older code: Attributes was likely
meant to stash the variable attributes, but doesn't because we always
read them from the variable store and kobj was likely left over from
an older iteration of code where we manually created the objects
instead of using a filesystem.

[ ardb: these fields were used by the sysfs based 'efivars' precursor to
efivarfs, which was removed in commit 0f5b2c69a4cb ("efi: vars:
Remove deprecated 'efivars' sysfs interface") ]

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
fs/efivarfs/internal.h
fs/efivarfs/super.c

index 74f0602a9e016c6dac6199b496219d8b98e54a64..64d15d1bb6bfc021ae3da9a191e8002d866ab3ed 100644 (file)
@@ -24,13 +24,11 @@ struct efivarfs_fs_info {
 struct efi_variable {
        efi_char16_t  VariableName[EFI_VAR_NAME_LEN/sizeof(efi_char16_t)];
        efi_guid_t    VendorGuid;
-       __u32         Attributes;
 };
 
 struct efivar_entry {
        struct efi_variable var;
        struct list_head list;
-       struct kobject kobj;
 };
 
 int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *,
index beba15673be8d351e2c77acfc6df472ea63ab351..d3c8528274aa668522fda7e6c0917ce93c3d6629 100644 (file)
@@ -245,7 +245,7 @@ static int efivarfs_callback(efi_char16_t *name16, efi_guid_t vendor,
 
        inode_lock(inode);
        inode->i_private = entry;
-       i_size_write(inode, size + sizeof(entry->var.Attributes));
+       i_size_write(inode, size + sizeof(__u32)); /* attributes + data */
        inode_unlock(inode);
        d_add(dentry, inode);