From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965311AbcHBMok (ORCPT ); Tue, 2 Aug 2016 08:44:40 -0400 Received: from mga09.intel.com ([134.134.136.24]:5258 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964948AbcHBMni (ORCPT ); Tue, 2 Aug 2016 08:43:38 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,460,1464678000"; d="scan'208";a="1033603429" From: Baole Ni To: 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 0990/1285] Replace numeric parameter like 0444 with macro Date: Tue, 2 Aug 2016 20:05:56 +0800 Message-Id: <20160802120556.16077-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/wusbcore/wusbhc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/wusbcore/wusbhc.c b/drivers/usb/wusbcore/wusbhc.c index 94f401a..1aaa452 100644 --- a/drivers/usb/wusbcore/wusbhc.c +++ b/drivers/usb/wusbcore/wusbhc.c @@ -84,7 +84,7 @@ static ssize_t wusb_trust_timeout_store(struct device *dev, out: return result < 0 ? result : size; } -static DEVICE_ATTR(wusb_trust_timeout, 0644, wusb_trust_timeout_show, +static DEVICE_ATTR(wusb_trust_timeout, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, wusb_trust_timeout_show, wusb_trust_timeout_store); /* @@ -145,7 +145,7 @@ static ssize_t wusb_chid_store(struct device *dev, result = wusbhc_chid_set(wusbhc, &chid); return result < 0 ? result : size; } -static DEVICE_ATTR(wusb_chid, 0644, wusb_chid_show, wusb_chid_store); +static DEVICE_ATTR(wusb_chid, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, wusb_chid_show, wusb_chid_store); static ssize_t wusb_phy_rate_show(struct device *dev, @@ -174,7 +174,7 @@ static ssize_t wusb_phy_rate_store(struct device *dev, wusbhc->phy_rate = phy_rate; return size; } -static DEVICE_ATTR(wusb_phy_rate, 0644, wusb_phy_rate_show, +static DEVICE_ATTR(wusb_phy_rate, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, wusb_phy_rate_show, wusb_phy_rate_store); static ssize_t wusb_dnts_show(struct device *dev, @@ -205,7 +205,7 @@ static ssize_t wusb_dnts_store(struct device *dev, return size; } -static DEVICE_ATTR(wusb_dnts, 0644, wusb_dnts_show, wusb_dnts_store); +static DEVICE_ATTR(wusb_dnts, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, wusb_dnts_show, wusb_dnts_store); static ssize_t wusb_retry_count_show(struct device *dev, struct device_attribute *attr, @@ -234,7 +234,7 @@ static ssize_t wusb_retry_count_store(struct device *dev, return size; } -static DEVICE_ATTR(wusb_retry_count, 0644, wusb_retry_count_show, +static DEVICE_ATTR(wusb_retry_count, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, wusb_retry_count_show, wusb_retry_count_store); /* Group all the WUSBHC attributes */ -- 2.9.2