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.

Signed-off-by: Chuansheng Liu <[email protected]>
Signed-off-by: Baole Ni <[email protected]>
---
 drivers/firmware/edd.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c
index e229576..17ff3ac 100644
--- a/drivers/firmware/edd.c
+++ b/drivers/firmware/edd.c
@@ -559,29 +559,29 @@ edd_has_edd30(struct edd_device *edev)
 }
 
 
-static EDD_DEVICE_ATTR(raw_data, 0444, edd_show_raw_data, edd_has_edd_info);
-static EDD_DEVICE_ATTR(version, 0444, edd_show_version, edd_has_edd_info);
-static EDD_DEVICE_ATTR(extensions, 0444, edd_show_extensions, 
edd_has_edd_info);
-static EDD_DEVICE_ATTR(info_flags, 0444, edd_show_info_flags, 
edd_has_edd_info);
-static EDD_DEVICE_ATTR(sectors, 0444, edd_show_sectors, edd_has_edd_info);
-static EDD_DEVICE_ATTR(legacy_max_cylinder, 0444,
+static EDD_DEVICE_ATTR(raw_data, S_IRUSR | S_IRGRP | S_IROTH, 
edd_show_raw_data, edd_has_edd_info);
+static EDD_DEVICE_ATTR(version, S_IRUSR | S_IRGRP | S_IROTH, edd_show_version, 
edd_has_edd_info);
+static EDD_DEVICE_ATTR(extensions, S_IRUSR | S_IRGRP | S_IROTH, 
edd_show_extensions, edd_has_edd_info);
+static EDD_DEVICE_ATTR(info_flags, S_IRUSR | S_IRGRP | S_IROTH, 
edd_show_info_flags, edd_has_edd_info);
+static EDD_DEVICE_ATTR(sectors, S_IRUSR | S_IRGRP | S_IROTH, edd_show_sectors, 
edd_has_edd_info);
+static EDD_DEVICE_ATTR(legacy_max_cylinder, S_IRUSR | S_IRGRP | S_IROTH,
                        edd_show_legacy_max_cylinder,
                       edd_has_legacy_max_cylinder);
-static EDD_DEVICE_ATTR(legacy_max_head, 0444, edd_show_legacy_max_head,
+static EDD_DEVICE_ATTR(legacy_max_head, S_IRUSR | S_IRGRP | S_IROTH, 
edd_show_legacy_max_head,
                       edd_has_legacy_max_head);
-static EDD_DEVICE_ATTR(legacy_sectors_per_track, 0444,
+static EDD_DEVICE_ATTR(legacy_sectors_per_track, S_IRUSR | S_IRGRP | S_IROTH,
                        edd_show_legacy_sectors_per_track,
                       edd_has_legacy_sectors_per_track);
-static EDD_DEVICE_ATTR(default_cylinders, 0444, edd_show_default_cylinders,
+static EDD_DEVICE_ATTR(default_cylinders, S_IRUSR | S_IRGRP | S_IROTH, 
edd_show_default_cylinders,
                       edd_has_default_cylinders);
-static EDD_DEVICE_ATTR(default_heads, 0444, edd_show_default_heads,
+static EDD_DEVICE_ATTR(default_heads, S_IRUSR | S_IRGRP | S_IROTH, 
edd_show_default_heads,
                       edd_has_default_heads);
-static EDD_DEVICE_ATTR(default_sectors_per_track, 0444,
+static EDD_DEVICE_ATTR(default_sectors_per_track, S_IRUSR | S_IRGRP | S_IROTH,
                       edd_show_default_sectors_per_track,
                       edd_has_default_sectors_per_track);
-static EDD_DEVICE_ATTR(interface, 0444, edd_show_interface, edd_has_edd30);
-static EDD_DEVICE_ATTR(host_bus, 0444, edd_show_host_bus, edd_has_edd30);
-static EDD_DEVICE_ATTR(mbr_signature, 0444, edd_show_mbr_signature, 
edd_has_mbr_signature);
+static EDD_DEVICE_ATTR(interface, S_IRUSR | S_IRGRP | S_IROTH, 
edd_show_interface, edd_has_edd30);
+static EDD_DEVICE_ATTR(host_bus, S_IRUSR | S_IRGRP | S_IROTH, 
edd_show_host_bus, edd_has_edd30);
+static EDD_DEVICE_ATTR(mbr_signature, S_IRUSR | S_IRGRP | S_IROTH, 
edd_show_mbr_signature, edd_has_mbr_signature);
 
 
 /* These are default attributes that are added for every edd
-- 
2.9.2

Reply via email to