Skip to content

Commit

Permalink
efivars: Introduce PSTORE_EFI_ATTRIBUTES
Browse files Browse the repository at this point in the history
Consolidate the attributes listed for pstore operations in one place,
PSTORE_EFI_ATTRIBUTES.

Signed-off-by: Mike Waychison <mikew@google.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
  • Loading branch information
Mike Waychison authored and Tony Luck committed Jul 22, 2011
1 parent c475594 commit 7644c16
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/firmware/efivars.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ struct efivar_attribute {
ssize_t (*store)(struct efivar_entry *entry, const char *buf, size_t count);
};

#define PSTORE_EFI_ATTRIBUTES \
(EFI_VARIABLE_NON_VOLATILE | \
EFI_VARIABLE_BOOTSERVICE_ACCESS | \
EFI_VARIABLE_RUNTIME_ACCESS)

#define EFIVAR_ATTR(_name, _mode, _show, _store) \
struct efivar_attribute efivar_attr_##_name = { \
Expand Down Expand Up @@ -523,8 +527,9 @@ static u64 efi_pstore_write(enum pstore_type_id type, unsigned int part,

/* found */
found = entry;
efivars->ops->set_variable(entry->var.VariableName, &entry->var.VendorGuid,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
efivars->ops->set_variable(entry->var.VariableName,
&entry->var.VendorGuid,
PSTORE_EFI_ATTRIBUTES,
0, NULL);
}

Expand All @@ -534,8 +539,7 @@ static u64 efi_pstore_write(enum pstore_type_id type, unsigned int part,
for (i = 0; i < DUMP_NAME_LEN; i++)
efi_name[i] = name[i];

efivars->ops->set_variable(efi_name, &vendor,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
efivars->ops->set_variable(efi_name, &vendor, PSTORE_EFI_ATTRIBUTES,
size, psi->buf);

spin_unlock(&efivars->lock);
Expand Down

0 comments on commit 7644c16

Please sign in to comment.