From: Baole Ni <baolex.ni@intel.com>
To: mchehab@kernel.org, maurochehab@gmail.com, mchehab@infradead.org,
mchehab@redhat.com, m.chehab@samsung.com,
ezequiel@vanguardiasur.com.ar, andrey.utkin@corp.bluecherry.net,
ismael@iodev.co.uk, bp@alien8.de
Cc: mjpeg-users@lists.sourceforge.net, linux-media@vger.kernel.org,
linux-kernel@vger.kernel.org, hans.verkuil@cisco.com,
arnd@arndb.de, chuansheng.liu@intel.com, baolex.ni@intel.com,
hdegoede@redhat.com
Subject: [PATCH 0514/1285] Replace numeric parameter like 0444 with macro
Date: Tue, 2 Aug 2016 19:19:52 +0800 [thread overview]
Message-ID: <20160802111952.16230-1-baolex.ni@intel.com> (raw)
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/zoran/zoran_card.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/media/pci/zoran/zoran_card.c b/drivers/media/pci/zoran/zoran_card.c
index 9d2697f..7915dac 100644
--- a/drivers/media/pci/zoran/zoran_card.c
+++ b/drivers/media/pci/zoran/zoran_card.c
@@ -61,7 +61,7 @@
extern const struct zoran_format zoran_formats[];
static int card[BUZ_MAX] = { [0 ... (BUZ_MAX-1)] = -1 };
-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");
/*
@@ -73,7 +73,7 @@ MODULE_PARM_DESC(card, "Card type");
*/
static unsigned long vidmem; /* default = 0 - Video memory base address */
-module_param(vidmem, ulong, 0444);
+module_param(vidmem, ulong, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(vidmem, "Default video memory base address");
/*
@@ -81,46 +81,46 @@ MODULE_PARM_DESC(vidmem, "Default video memory base address");
*/
static unsigned int default_input; /* default 0 = Composite, 1 = S-Video */
-module_param(default_input, uint, 0444);
+module_param(default_input, uint, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(default_input,
"Default input (0=Composite, 1=S-Video, 2=Internal)");
static int default_mux = 1; /* 6 Eyes input selection */
-module_param(default_mux, int, 0644);
+module_param(default_mux, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(default_mux,
"Default 6 Eyes mux setting (Input selection)");
static int default_norm; /* default 0 = PAL, 1 = NTSC 2 = SECAM */
-module_param(default_norm, int, 0444);
+module_param(default_norm, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(default_norm, "Default norm (0=PAL, 1=NTSC, 2=SECAM)");
/* /dev/videoN, -1 for autodetect */
static int video_nr[BUZ_MAX] = { [0 ... (BUZ_MAX-1)] = -1 };
-module_param_array(video_nr, int, NULL, 0444);
+module_param_array(video_nr, int, NULL, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(video_nr, "Video device number (-1=Auto)");
int v4l_nbufs = 4;
int v4l_bufsize = 864; /* Everybody should be able to work with this setting */
-module_param(v4l_nbufs, int, 0644);
+module_param(v4l_nbufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(v4l_nbufs, "Maximum number of V4L buffers to use");
-module_param(v4l_bufsize, int, 0644);
+module_param(v4l_bufsize, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(v4l_bufsize, "Maximum size per V4L buffer (in kB)");
int jpg_nbufs = 32;
int jpg_bufsize = 512; /* max size for 100% quality full-PAL frame */
-module_param(jpg_nbufs, int, 0644);
+module_param(jpg_nbufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(jpg_nbufs, "Maximum number of JPG buffers to use");
-module_param(jpg_bufsize, int, 0644);
+module_param(jpg_bufsize, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(jpg_bufsize, "Maximum size per JPG buffer (in kB)");
int pass_through = 0; /* 1=Pass through TV signal when device is not used */
/* 0=Show color bar when device is not used (LML33: only if lml33dpath=1) */
-module_param(pass_through, int, 0644);
+module_param(pass_through, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(pass_through,
"Pass TV signal through to TV-out when idling");
int zr36067_debug = 1;
-module_param_named(debug, zr36067_debug, int, 0644);
+module_param_named(debug, zr36067_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(debug, "Debug level (0-5)");
#define ZORAN_VERSION "0.10.1"
--
2.9.2
reply other threads:[~2016-08-02 17:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160802111952.16230-1-baolex.ni@intel.com \
--to=baolex.ni@intel.com \
--cc=andrey.utkin@corp.bluecherry.net \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=chuansheng.liu@intel.com \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=hans.verkuil@cisco.com \
--cc=hdegoede@redhat.com \
--cc=ismael@iodev.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=maurochehab@gmail.com \
--cc=mchehab@infradead.org \
--cc=mchehab@kernel.org \
--cc=mchehab@redhat.com \
--cc=mjpeg-users@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®