* [PATCH 0979/1285] Replace numeric parameter like 0444 with macro
@ 2016-08-02 12:04 Baole Ni
0 siblings, 0 replies; only message in thread
From: Baole Ni @ 2016-08-02 12:04 UTC (permalink / raw)
To: balbi, gregkh, m.chehab, m.szyprowski, kyungmin.park, k.kozlowski
Cc: linux-usb, linux-kernel, r.baldyga, chuansheng.liu, baolex.ni,
viro, kirill.shutemov, nicstange, oneukum
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/usb/gadget/udc/net2272.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c
index 18f5ebd..74b38f3 100644
--- a/drivers/usb/gadget/udc/net2272.c
+++ b/drivers/usb/gadget/udc/net2272.c
@@ -68,7 +68,7 @@ static const char * const ep_name[] = {
* If use_dma is disabled, pio will be used instead.
*/
static bool use_dma = 0;
-module_param(use_dma, bool, 0644);
+module_param(use_dma, bool, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
/*
* dma_ep: selects the endpoint for use with dma (1=ep-a, 2=ep-b)
@@ -82,7 +82,7 @@ module_param(use_dma, bool, 0644);
* terminate prematurely (See NET2272 Errata 630-0213-0101)
*/
static ushort dma_ep = 1;
-module_param(dma_ep, ushort, 0644);
+module_param(dma_ep, ushort, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
/*
* dma_mode: net2272 dma mode setting (see LOCCTL1 definiton):
@@ -91,7 +91,7 @@ module_param(dma_ep, ushort, 0644);
* mode 2 == Burst mode
*/
static ushort dma_mode = 2;
-module_param(dma_mode, ushort, 0644);
+module_param(dma_mode, ushort, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
#else
#define use_dma 0
#define dma_ep 1
@@ -106,7 +106,7 @@ module_param(dma_mode, ushort, 0644);
* mode 3 == ep-a 1k, ep-b disabled, ep-c 512db
*/
static ushort fifo_mode = 0;
-module_param(fifo_mode, ushort, 0644);
+module_param(fifo_mode, ushort, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
/*
* enable_suspend: When enabled, the driver will respond to
@@ -115,7 +115,7 @@ module_param(fifo_mode, ushort, 0644);
* self-powered devices. For bus powered devices set this to 1.
*/
static ushort enable_suspend = 0;
-module_param(enable_suspend, ushort, 0644);
+module_param(enable_suspend, ushort, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
static void assert_out_naking(struct net2272_ep *ep, const char *where)
{
--
2.9.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-08-02 14:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 12:04 [PATCH 0979/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®