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

From: Baole Ni
Date: Tue Aug 02 2016 - 10:46:36 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/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