From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935283AbcHBOoz (ORCPT ); Tue, 2 Aug 2016 10:44:55 -0400 Received: from mga03.intel.com ([134.134.136.65]:21635 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965038AbcHBMnI (ORCPT ); Tue, 2 Aug 2016 08:43:08 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,460,1464678000"; d="scan'208";a="1033603235" From: Baole Ni To: b-liu@ti.com, 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, chuansheng.liu@intel.com, baolex.ni@intel.com, mina86@mina86.com, deepa.kernel@gmail.com, mathias.nyman@linux.intel.com, stern@rowland.harvard.edu, oneukum@suse.com Subject: [PATCH 0985/1285] Replace numeric parameter like 0444 with macro Date: Tue, 2 Aug 2016 20:05:26 +0800 Message-Id: <20160802120526.15741-1-baolex.ni@intel.com> X-Mailer: git-send-email 2.9.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Baole Ni --- drivers/usb/musb/musb_core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index f824336..6182097 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1642,7 +1642,7 @@ EXPORT_SYMBOL_GPL(musb_interrupt); static bool use_dma = 1; /* "modprobe ... use_dma=0" etc */ -module_param(use_dma, bool, 0644); +module_param(use_dma, bool, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(use_dma, "enable/disable use of DMA"); void musb_dma_completion(struct musb *musb, u8 epnum, u8 transmit) @@ -1734,7 +1734,7 @@ musb_mode_store(struct device *dev, struct device_attribute *attr, return (status == 0) ? n : status; } -static DEVICE_ATTR(mode, 0644, musb_mode_show, musb_mode_store); +static DEVICE_ATTR(mode, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, musb_mode_show, musb_mode_store); static ssize_t musb_vbus_store(struct device *dev, struct device_attribute *attr, @@ -1786,7 +1786,7 @@ musb_vbus_show(struct device *dev, struct device_attribute *attr, char *buf) return sprintf(buf, "Vbus %s, timeout %lu msec\n", vbus ? "on" : "off", val); } -static DEVICE_ATTR(vbus, 0644, musb_vbus_show, musb_vbus_store); +static DEVICE_ATTR(vbus, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, musb_vbus_show, musb_vbus_store); /* Gadget drivers can't know that a host is connected so they might want * to start SRP, but users can. This allows userspace to trigger SRP. @@ -1809,7 +1809,7 @@ musb_srp_store(struct device *dev, struct device_attribute *attr, return n; } -static DEVICE_ATTR(srp, 0644, NULL, musb_srp_store); +static DEVICE_ATTR(srp, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, NULL, musb_srp_store); static struct attribute *musb_attributes[] = { &dev_attr_mode.attr, -- 2.9.2