mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0507/1285] Replace numeric parameter like 0444 with macro
@ 2016-08-02 11:19 Baole Ni
  0 siblings, 0 replies; only message in thread
From: Baole Ni @ 2016-08-02 11:19 UTC (permalink / raw)
  To: mchehab, maurochehab, mchehab, mchehab, m.chehab, maintainers,
	andrey.utkin, ismael, bp
  Cc: linux-media, linux-kernel, hans.verkuil, Julia.Lawall,
	chuansheng.liu, baolex.ni, nenggun.kim, hdegoede

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@intel.com>
Signed-off-by: Baole Ni <baolex.ni@intel.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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-02 16:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 11:19 [PATCH 0507/1285] Replace numeric parameter like 0444 with macro Baole Ni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®