Skip to contentSkip to conversation

Replace numeric parameter like 0444 with macro

PATCH NAK Baole Ni 1 participant 1 message Aug 2, 2016 EFI

lore
Share & tools
lore

Baole Ni

author
#0 lore raw

PATCH 171/1285 Replace numeric parameter like 0444 with macro

I find that the developers often just specified the numeric value
when calling a macro which is defined with a parameter for access permission. As we know, these numeric value for access permission have had the corresponding macro, and that using macro can improve the robustness and readability of the code, thus, I suggest replacing the numeric parameter with the macro.

---
 drivers/firmware/efi/efivars.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/firmware/efi/efivars.c +5 -5
index 116b244..0510433 100644
@@ -390,11 +390,11 @@ static void efivar_release(struct kobject *kobj)
 	kfree(var);
 }
 
-static EFIVAR_ATTR(guid, 0400, efivar_guid_read, NULL);
-static EFIVAR_ATTR(attributes, 0400, efivar_attr_read, NULL);
-static EFIVAR_ATTR(size, 0400, efivar_size_read, NULL);
-static EFIVAR_ATTR(data, 0400, efivar_data_read, NULL);
-static EFIVAR_ATTR(raw_var, 0600, efivar_show_raw, efivar_store_raw);
+static EFIVAR_ATTR(guid, S_IRUSR, efivar_guid_read, NULL);
+static EFIVAR_ATTR(attributes, S_IRUSR, efivar_attr_read, NULL);
+static EFIVAR_ATTR(size, S_IRUSR, efivar_size_read, NULL);
+static EFIVAR_ATTR(data, S_IRUSR, efivar_data_read, NULL);
+static EFIVAR_ATTR(raw_var, S_IRUSR | S_IWUSR, efivar_show_raw, efivar_store_raw);
 
 static struct attribute *def_attrs[] = {
 	&efivar_attr_guid.attr,
Signature · 1 line
2.9.2