[PATCH 1054/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>
---
 fs/nfs/super.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 2137e02..786efd6 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2863,22 +2863,22 @@ static const struct kernel_param_ops param_ops_portnr = {
 };
 #define param_check_portnr(name, p) __param_check(name, p, unsigned int);
 
-module_param_named(callback_tcpport, nfs_callback_set_tcpport, portnr, 0644);
-module_param(nfs_idmap_cache_timeout, int, 0644);
-module_param(nfs4_disable_idmapping, bool, 0644);
+module_param_named(callback_tcpport, nfs_callback_set_tcpport, portnr, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(nfs_idmap_cache_timeout, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(nfs4_disable_idmapping, bool, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 module_param_string(nfs4_unique_id, nfs4_client_id_uniquifier,
-			NFS4_CLIENT_ID_UNIQ_LEN, 0600);
+			NFS4_CLIENT_ID_UNIQ_LEN, S_IRUSR | S_IWUSR);
 MODULE_PARM_DESC(nfs4_disable_idmapping,
 		"Turn off NFSv4 idmapping when using 'sec=sys'");
-module_param(max_session_slots, ushort, 0644);
+module_param(max_session_slots, ushort, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(max_session_slots, "Maximum number of outstanding NFSv4.1 "
 		"requests the client will negotiate");
-module_param(send_implementation_id, ushort, 0644);
+module_param(send_implementation_id, ushort, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(send_implementation_id,
 		"Send implementation ID with NFSv4.1 exchange_id");
 MODULE_PARM_DESC(nfs4_unique_id, "nfs_client_id4 uniquifier string");
 
-module_param(recover_lost_locks, bool, 0644);
+module_param(recover_lost_locks, bool, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(recover_lost_locks,
 		 "If the server reports that a lock might be lost, "
 		 "try to recover it risking data corruption.");
-- 
2.9.2

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



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux