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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20160802111905.15755-1-baolex.ni@intel.com>
Date:	Tue,  2 Aug 2016 19:19:05 +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,
	maintainers@...echerrydvr.com, andrey.utkin@...p.bluecherry.net,
	ismael@...ev.co.uk, bp@...en8.de
Cc:	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
	hans.verkuil@...co.com, Julia.Lawall@...6.fr,
	chuansheng.liu@...el.com, baolex.ni@...el.com,
	nenggun.kim@...sung.com, hdegoede@...hat.com
Subject: [PATCH 0507/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/pci/ttpci/av7110.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/media/pci/ttpci/av7110.c b/drivers/media/pci/ttpci/av7110.c
index 382caf2..b51b3cd 100644
--- a/drivers/media/pci/ttpci/av7110.c
+++ b/drivers/media/pci/ttpci/av7110.c
@@ -89,30 +89,30 @@ static int wss_cfg_16_9 = 0x0007;
 static int tv_standard;
 static int full_ts;
 
-module_param_named(debug, av7110_debug, int, 0644);
+module_param_named(debug, av7110_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(debug, "debug level (bitmask, default 0)");
-module_param(vidmode, int, 0444);
+module_param(vidmode, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(vidmode,"analog video out: 0 off, 1 CVBS+RGB (default), 2 CVBS+YC, 3 YC");
-module_param(pids_off, int, 0444);
+module_param(pids_off, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(pids_off,"clear video/audio/PCR PID filters when demux is closed");
-module_param(adac, int, 0444);
+module_param(adac, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(adac,"audio DAC type: 0 TI, 1 CRYSTAL, 2 MSP (use if autodetection fails)");
-module_param(hw_sections, int, 0444);
+module_param(hw_sections, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(hw_sections, "0 use software section filter, 1 use hardware");
-module_param(rgb_on, int, 0444);
+module_param(rgb_on, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(rgb_on, "For Siemens DVB-C cards only: Enable RGB control"
 		" signal on SCART pin 16 to switch SCART video mode from CVBS to RGB");
-module_param(volume, int, 0444);
+module_param(volume, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(volume, "initial volume: default 255 (range 0-255)");
-module_param(budgetpatch, int, 0444);
+module_param(budgetpatch, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(budgetpatch, "use budget-patch hardware modification: default 0 (0 no, 1 autodetect, 2 always)");
-module_param(full_ts, int, 0444);
+module_param(full_ts, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(full_ts, "enable code for full-ts hardware modification: 0 disable (default), 1 enable");
-module_param(wss_cfg_4_3, int, 0444);
+module_param(wss_cfg_4_3, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(wss_cfg_4_3, "WSS 4:3 - default 0x4008 - bit 15: disable, 14: burst mode, 13..0: wss data");
-module_param(wss_cfg_16_9, int, 0444);
+module_param(wss_cfg_16_9, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(wss_cfg_16_9, "WSS 16:9 - default 0x0007 - bit 15: disable, 14: burst mode, 13..0: wss data");
-module_param(tv_standard, int, 0444);
+module_param(tv_standard, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(tv_standard, "TV standard: 0 PAL (default), 1 NTSC");
 
 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
-- 
2.9.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ