* [PATCH 0504/1285] Replace numeric parameter like 0444 with macro
@ 2016-08-02 11:18 Baole Ni
0 siblings, 0 replies; only message in thread
From: Baole Ni @ 2016-08-02 11:18 UTC (permalink / raw)
To: mchehab, maurochehab, mchehab, mchehab, m.chehab, hverkuil, a.hajda, bp
Cc: linux-media, linux-kernel, akpm, chuansheng.liu, baolex.ni,
jh1009.sung, 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/saa7164/saa7164-core.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/media/pci/saa7164/saa7164-core.c b/drivers/media/pci/saa7164/saa7164-core.c
index 8bbd092..ade4d2c 100644
--- a/drivers/media/pci/saa7164/saa7164-core.c
+++ b/drivers/media/pci/saa7164/saa7164-core.c
@@ -49,44 +49,44 @@ MODULE_LICENSE("GPL");
*/
unsigned int saa_debug;
-module_param_named(debug, saa_debug, int, 0644);
+module_param_named(debug, saa_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(debug, "enable debug messages");
static unsigned int fw_debug;
-module_param(fw_debug, int, 0644);
+module_param(fw_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(fw_debug, "Firmware debug level def:2");
unsigned int encoder_buffers = SAA7164_MAX_ENCODER_BUFFERS;
-module_param(encoder_buffers, int, 0644);
+module_param(encoder_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(encoder_buffers, "Total buffers in read queue 16-512 def:64");
unsigned int vbi_buffers = SAA7164_MAX_VBI_BUFFERS;
-module_param(vbi_buffers, int, 0644);
+module_param(vbi_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(vbi_buffers, "Total buffers in read queue 16-512 def:64");
unsigned int waitsecs = 10;
-module_param(waitsecs, int, 0644);
+module_param(waitsecs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(waitsecs, "timeout on firmware messages");
static unsigned int card[] = {[0 ... (SAA7164_MAXBOARDS - 1)] = UNSET };
-module_param_array(card, int, NULL, 0444);
+module_param_array(card, int, NULL, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(card, "card type");
static unsigned int print_histogram = 64;
-module_param(print_histogram, int, 0644);
+module_param(print_histogram, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(print_histogram, "print histogram values once");
unsigned int crc_checking = 1;
-module_param(crc_checking, int, 0644);
+module_param(crc_checking, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(crc_checking, "enable crc sanity checking on buffers");
static unsigned int guard_checking = 1;
-module_param(guard_checking, int, 0644);
+module_param(guard_checking, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(guard_checking,
"enable dma sanity checking for buffer overruns");
static bool enable_msi = true;
-module_param(enable_msi, bool, 0444);
+module_param(enable_msi, bool, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(enable_msi,
"enable the use of an msi interrupt if available");
--
2.9.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-08-02 16:50 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:18 [PATCH 0504/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®