[PATCH 0990/1285] Replace numeric parameter like 0444 with macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <chuansheng.liu@xxxxxxxxx>
Signed-off-by: Baole Ni <baolex.ni@xxxxxxxxx>
---
 drivers/usb/wusbcore/wusbhc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/wusbcore/wusbhc.c b/drivers/usb/wusbcore/wusbhc.c
index 94f401a..1aaa452 100644
--- a/drivers/usb/wusbcore/wusbhc.c
+++ b/drivers/usb/wusbcore/wusbhc.c
@@ -84,7 +84,7 @@ static ssize_t wusb_trust_timeout_store(struct device *dev,
 out:
 	return result < 0 ? result : size;
 }
-static DEVICE_ATTR(wusb_trust_timeout, 0644, wusb_trust_timeout_show,
+static DEVICE_ATTR(wusb_trust_timeout, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, wusb_trust_timeout_show,
 					     wusb_trust_timeout_store);
 
 /*
@@ -145,7 +145,7 @@ static ssize_t wusb_chid_store(struct device *dev,
 	result = wusbhc_chid_set(wusbhc, &chid);
 	return result < 0 ? result : size;
 }
-static DEVICE_ATTR(wusb_chid, 0644, wusb_chid_show, wusb_chid_store);
+static DEVICE_ATTR(wusb_chid, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, wusb_chid_show, wusb_chid_store);
 
 
 static ssize_t wusb_phy_rate_show(struct device *dev,
@@ -174,7 +174,7 @@ static ssize_t wusb_phy_rate_store(struct device *dev,
 	wusbhc->phy_rate = phy_rate;
 	return size;
 }
-static DEVICE_ATTR(wusb_phy_rate, 0644, wusb_phy_rate_show,
+static DEVICE_ATTR(wusb_phy_rate, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, wusb_phy_rate_show,
 			wusb_phy_rate_store);
 
 static ssize_t wusb_dnts_show(struct device *dev,
@@ -205,7 +205,7 @@ static ssize_t wusb_dnts_store(struct device *dev,
 
 	return size;
 }
-static DEVICE_ATTR(wusb_dnts, 0644, wusb_dnts_show, wusb_dnts_store);
+static DEVICE_ATTR(wusb_dnts, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, wusb_dnts_show, wusb_dnts_store);
 
 static ssize_t wusb_retry_count_show(struct device *dev,
 				  struct device_attribute *attr,
@@ -234,7 +234,7 @@ static ssize_t wusb_retry_count_store(struct device *dev,
 
 	return size;
 }
-static DEVICE_ATTR(wusb_retry_count, 0644, wusb_retry_count_show,
+static DEVICE_ATTR(wusb_retry_count, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, wusb_retry_count_show,
 	wusb_retry_count_store);
 
 /* Group all the WUSBHC attributes */
-- 
2.9.2

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux