lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20160802112329.18704-1-baolex.ni@intel.com>
Date:	Tue,  2 Aug 2016 19:23:29 +0800
From:	Baole Ni <baolex.ni@...el.com>
To:	mchehab@...nel.org, maurochehab@...il.com, mchehab@...radead.org,
	mchehab@...hat.com, m.chehab@...sung.com, david@...deman.nu,
	s.nawrocki@...sung.com, kgene@...nel.org, k.kozlowski@...sung.com
Cc:	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
	chuansheng.liu@...el.com, baolex.ni@...el.com,
	rmk+kernel@....linux.org.uk, max@...mpel.org
Subject: [PATCH 0551/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.

Signed-off-by: Chuansheng Liu <chuansheng.liu@...el.com>
Signed-off-by: Baole Ni <baolex.ni@...el.com>
---
 drivers/media/rc/winbond-cir.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index d839f73..f8fb233 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -226,24 +226,24 @@ struct wbcir_data {
 };
 
 static enum wbcir_protocol protocol = IR_PROTOCOL_RC6;
-module_param(protocol, uint, 0444);
+module_param(protocol, uint, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(protocol, "IR protocol to use for the power-on command "
 		 "(0 = RC5, 1 = NEC, 2 = RC6A, default)");
 
 static bool invert; /* default = 0 */
-module_param(invert, bool, 0444);
+module_param(invert, bool, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(invert, "Invert the signal from the IR receiver");
 
 static bool txandrx; /* default = 0 */
-module_param(txandrx, bool, 0444);
+module_param(txandrx, bool, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(txandrx, "Allow simultaneous TX and RX");
 
 static unsigned int wake_sc = 0x800F040C;
-module_param(wake_sc, uint, 0644);
+module_param(wake_sc, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(wake_sc, "Scancode of the power-on IR command");
 
 static unsigned int wake_rc6mode = 6;
-module_param(wake_rc6mode, uint, 0644);
+module_param(wake_rc6mode, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(wake_rc6mode, "RC6 mode for the power-on command "
 		 "(0 = 0, 6 = 6A, default)");
 
-- 
2.9.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ