[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20160802111653.14331-1-baolex.ni@intel.com>
Date: Tue, 2 Aug 2016 19:16:53 +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, awalls@...metrocast.net,
a.hajda@...sung.com, bp@...en8.de
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
chuansheng.liu@...el.com, baolex.ni@...el.com,
sw0312.kim@...sung.com, jh1009.sung@...sung.com
Subject: [PATCH 0486/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/ivtv/ivtv-driver.c | 48 ++++++++++++++++++------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c
index 374033a..e3646f8 100644
--- a/drivers/media/pci/ivtv/ivtv-driver.c
+++ b/drivers/media/pci/ivtv/ivtv-driver.c
@@ -141,32 +141,32 @@ int ivtv_fw_debug;
static int tunertype = -1;
static int newi2c = -1;
-module_param_array(tuner, int, &tuner_c, 0644);
-module_param_array(radio, int, &radio_c, 0644);
-module_param_array(cardtype, int, &cardtype_c, 0644);
-module_param_string(pal, pal, sizeof(pal), 0644);
-module_param_string(secam, secam, sizeof(secam), 0644);
-module_param_string(ntsc, ntsc, sizeof(ntsc), 0644);
-module_param_named(debug,ivtv_debug, int, 0644);
+module_param_array(tuner, int, &tuner_c, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param_array(radio, int, &radio_c, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param_array(cardtype, int, &cardtype_c, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param_string(pal, pal, sizeof(pal), S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param_string(secam, secam, sizeof(secam), S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param_string(ntsc, ntsc, sizeof(ntsc), S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param_named(debug,ivtv_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
#ifdef CONFIG_VIDEO_ADV_DEBUG
-module_param_named(fw_debug, ivtv_fw_debug, int, 0644);
+module_param_named(fw_debug, ivtv_fw_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
#endif
-module_param(ivtv_pci_latency, int, 0644);
-module_param(ivtv_yuv_mode, int, 0644);
-module_param(ivtv_yuv_threshold, int, 0644);
-module_param(ivtv_first_minor, int, 0644);
-
-module_param(enc_mpg_buffers, int, 0644);
-module_param(enc_yuv_buffers, int, 0644);
-module_param(enc_vbi_buffers, int, 0644);
-module_param(enc_pcm_buffers, int, 0644);
-module_param(dec_mpg_buffers, int, 0644);
-module_param(dec_yuv_buffers, int, 0644);
-module_param(dec_vbi_buffers, int, 0644);
-
-module_param(tunertype, int, 0644);
-module_param(newi2c, int, 0644);
-module_param_array(i2c_clock_period, int, &i2c_clock_period_c, 0644);
+module_param(ivtv_pci_latency, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(ivtv_yuv_mode, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(ivtv_yuv_threshold, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(ivtv_first_minor, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+
+module_param(enc_mpg_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(enc_yuv_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(enc_vbi_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(enc_pcm_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(dec_mpg_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(dec_yuv_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(dec_vbi_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+
+module_param(tunertype, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(newi2c, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param_array(i2c_clock_period, int, &i2c_clock_period_c, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(tuner, "Tuner type selection,\n"
"\t\t\tsee tuner.h for values");
--
2.9.2
Powered by blists - more mailing lists