mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baole Ni <baolex.ni@intel.com>
To: balbi@kernel.org, gregkh@linuxfoundation.org,
	m.chehab@samsung.com, m.szyprowski@samsung.com,
	kyungmin.park@samsung.com, k.kozlowski@samsung.com
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	r.baldyga@samsung.com, chuansheng.liu@intel.com,
	baolex.ni@intel.com, viro@zeniv.linux.org.uk,
	kirill.shutemov@linux.intel.com, nicstange@gmail.com,
	oneukum@suse.com
Subject: [PATCH 0979/1285] Replace numeric parameter like 0444 with macro
Date: Tue,  2 Aug 2016 20:04:49 +0800	[thread overview]
Message-ID: <20160802120449.15337-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/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

                 reply	other threads:[~2016-08-02 14:46 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=20160802120449.15337-1-baolex.ni@intel.com \
    --to=baolex.ni@intel.com \
    --cc=balbi@kernel.org \
    --cc=chuansheng.liu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=k.kozlowski@samsung.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=m.szyprowski@samsung.com \
    --cc=nicstange@gmail.com \
    --cc=oneukum@suse.com \
    --cc=r.baldyga@samsung.com \
    --cc=viro@zeniv.linux.org.uk \
    /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®