Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1453947 > unrolled thread
| Started by | Baole Ni <baolex.ni@intel.com> |
|---|---|
| First post | 2016-08-02 14:00 +0200 |
| Last post | 2016-08-02 14:00 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 0455/1285] Replace numeric parameter like 0444 with macro Baole Ni <baolex.ni@intel.com> - 2016-08-02 14:00 +0200
| From | Baole Ni <baolex.ni@intel.com> |
|---|---|
| Date | 2016-08-02 14:00 +0200 |
| Subject | [PATCH 0455/1285] Replace numeric parameter like 0444 with macro |
| Message-ID | <s1Gwy-3Wp-55@gated-at.bofh.it> |
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/cx18/cx18-driver.c | 62 ++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c index 260e462..15b2ede 100644 --- a/drivers/media/pci/cx18/cx18-driver.c +++ b/drivers/media/pci/cx18/cx18-driver.c @@ -109,37 +109,37 @@ static int retry_mmio = 1; int cx18_debug; -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, cx18_debug, int, 0644); -module_param(mmio_ndelay, int, 0644); -module_param(retry_mmio, int, 0644); -module_param(cx18_pci_latency, int, 0644); -module_param(cx18_first_minor, int, 0644); - -module_param(enc_ts_buffers, int, 0644); -module_param(enc_mpg_buffers, int, 0644); -module_param(enc_idx_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(enc_ts_bufsize, int, 0644); -module_param(enc_mpg_bufsize, int, 0644); -module_param(enc_idx_bufsize, int, 0644); -module_param(enc_yuv_bufsize, int, 0644); -module_param(enc_pcm_bufsize, int, 0644); - -module_param(enc_ts_bufs, int, 0644); -module_param(enc_mpg_bufs, int, 0644); -module_param(enc_idx_bufs, int, 0644); -module_param(enc_yuv_bufs, int, 0644); -module_param(enc_vbi_bufs, int, 0644); -module_param(enc_pcm_bufs, 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, cx18_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(mmio_ndelay, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(retry_mmio, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(cx18_pci_latency, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(cx18_first_minor, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + +module_param(enc_ts_buffers, 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_idx_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(enc_ts_bufsize, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_mpg_bufsize, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_idx_bufsize, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_yuv_bufsize, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_pcm_bufsize, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + +module_param(enc_ts_bufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_mpg_bufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_idx_bufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_yuv_bufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_vbi_bufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_pcm_bufs, int, 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
Back to top | Article view | linux.kernel
csiph-web