From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754315AbcHBLO7 (ORCPT ); Tue, 2 Aug 2016 07:14:59 -0400 Received: from mga11.intel.com ([192.55.52.93]:44139 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753800AbcHBLNb (ORCPT ); Tue, 2 Aug 2016 07:13:31 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,459,1464678000"; d="scan'208";a="1033562592" From: Baole Ni To: tony.luck@intel.com, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, chuansheng.liu@intel.com, baolex.ni@intel.com Subject: [PATCH 0032/1285] Replace numeric parameter like 0444 with macro Date: Tue, 2 Aug 2016 18:35:51 +0800 Message-Id: <20160802103551.15907-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/x86/kernel/cpu/mcheck/mce.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 92e5e37..95b3028 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -2345,10 +2345,10 @@ static ssize_t store_int_with_restart(struct device *s, return ret; } -static DEVICE_ATTR(trigger, 0644, show_trigger, set_trigger); -static DEVICE_INT_ATTR(tolerant, 0644, mca_cfg.tolerant); -static DEVICE_INT_ATTR(monarch_timeout, 0644, mca_cfg.monarch_timeout); -static DEVICE_BOOL_ATTR(dont_log_ce, 0644, mca_cfg.dont_log_ce); +static DEVICE_ATTR(trigger, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, show_trigger, set_trigger); +static DEVICE_INT_ATTR(tolerant, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, mca_cfg.tolerant); +static DEVICE_INT_ATTR(monarch_timeout, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, mca_cfg.monarch_timeout); +static DEVICE_BOOL_ATTR(dont_log_ce, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, mca_cfg.dont_log_ce); static struct dev_ext_attribute dev_attr_check_interval = { __ATTR(check_interval, 0644, device_show_int, store_int_with_restart), -- 2.9.2