From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754219AbcHBLMc (ORCPT ); Tue, 2 Aug 2016 07:12:32 -0400 Received: from mga02.intel.com ([134.134.136.20]:30978 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754003AbcHBLMD (ORCPT ); Tue, 2 Aug 2016 07:12:03 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,459,1464678000"; d="scan'208";a="1006924119" From: Baole Ni To: ralf@linux-mips.org, fenghua.yu@intel.com, robert.jarzmik@free.fr, linux@armlinux.org.uk Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, chuansheng.liu@intel.com, baolex.ni@intel.com Subject: [PATCH 0014/1285] Replace numeric parameter like 0444 with macro Date: Tue, 2 Aug 2016 18:34:21 +0800 Message-Id: <20160802103421.14690-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 --- arch/mips/txx9/generic/7segled.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips/txx9/generic/7segled.c b/arch/mips/txx9/generic/7segled.c index 566c58b..1fcd1ec 100644 --- a/arch/mips/txx9/generic/7segled.c +++ b/arch/mips/txx9/generic/7segled.c @@ -55,8 +55,8 @@ static ssize_t raw_store(struct device *dev, return size; } -static DEVICE_ATTR(ascii, 0200, NULL, ascii_store); -static DEVICE_ATTR(raw, 0200, NULL, raw_store); +static DEVICE_ATTR(ascii, S_IWUSR, NULL, ascii_store); +static DEVICE_ATTR(raw, S_IWUSR, NULL, raw_store); static ssize_t map_seg7_show(struct device *dev, struct device_attribute *attr, @@ -76,7 +76,7 @@ static ssize_t map_seg7_store(struct device *dev, return size; } -static DEVICE_ATTR(map_seg7, 0600, map_seg7_show, map_seg7_store); +static DEVICE_ATTR(map_seg7, S_IRUSR | S_IWUSR, map_seg7_show, map_seg7_store); static struct bus_type tx_7segled_subsys = { .name = "7segled", -- 2.9.2