[PATCH 0444/1285] Replace numeric parameter like 0444 with macro

From: Baole Ni
Date: Tue Aug 02 2016 - 12:56:58 EST


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>
---
drivers/media/pci/bt8xx/bttv-driver.c | 62 +++++++++++++++++------------------
1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index df54e17..9353226 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -107,37 +107,37 @@ static unsigned int coring;
static unsigned int v4l2 = 1;

/* insmod args */
-module_param(bttv_verbose, int, 0644);
-module_param(bttv_gpio, int, 0644);
-module_param(bttv_debug, int, 0644);
-module_param(irq_debug, int, 0644);
-module_param(debug_latency, int, 0644);
-module_param(disable_ir, int, 0444);
-
-module_param(fdsr, int, 0444);
-module_param(gbuffers, int, 0444);
-module_param(gbufsize, int, 0444);
-module_param(reset_crop, int, 0444);
-
-module_param(v4l2, int, 0644);
-module_param(bigendian, int, 0644);
-module_param(irq_iswitch, int, 0644);
-module_param(combfilter, int, 0444);
-module_param(lumafilter, int, 0444);
-module_param(automute, int, 0444);
-module_param(chroma_agc, int, 0444);
-module_param(agc_crush, int, 0444);
-module_param(whitecrush_upper, int, 0444);
-module_param(whitecrush_lower, int, 0444);
-module_param(vcr_hack, int, 0444);
-module_param(uv_ratio, int, 0444);
-module_param(full_luma_range, int, 0444);
-module_param(coring, int, 0444);
-
-module_param_array(radio, int, NULL, 0444);
-module_param_array(video_nr, int, NULL, 0444);
-module_param_array(radio_nr, int, NULL, 0444);
-module_param_array(vbi_nr, int, NULL, 0444);
+module_param(bttv_verbose, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(bttv_gpio, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(bttv_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(irq_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(debug_latency, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(disable_ir, int, S_IRUSR | S_IRGRP | S_IROTH);
+
+module_param(fdsr, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(gbuffers, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(gbufsize, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(reset_crop, int, S_IRUSR | S_IRGRP | S_IROTH);
+
+module_param(v4l2, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(bigendian, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(irq_iswitch, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(combfilter, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(lumafilter, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(automute, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(chroma_agc, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(agc_crush, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(whitecrush_upper, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(whitecrush_lower, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(vcr_hack, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(uv_ratio, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(full_luma_range, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(coring, int, S_IRUSR | S_IRGRP | S_IROTH);
+
+module_param_array(radio, int, NULL, S_IRUSR | S_IRGRP | S_IROTH);
+module_param_array(video_nr, int, NULL, S_IRUSR | S_IRGRP | S_IROTH);
+module_param_array(radio_nr, int, NULL, S_IRUSR | S_IRGRP | S_IROTH);
+module_param_array(vbi_nr, int, NULL, S_IRUSR | S_IRGRP | S_IROTH);

MODULE_PARM_DESC(radio, "The TV card supports radio, default is 0 (no)");
MODULE_PARM_DESC(bigendian, "byte order of the framebuffer, default is native endian");
--
2.9.2