From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932818AbcHBORx (ORCPT ); Tue, 2 Aug 2016 10:17:53 -0400 Received: from mga14.intel.com ([192.55.52.115]:62714 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965384AbcHBMxo (ORCPT ); Tue, 2 Aug 2016 08:53:44 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,460,1464678000"; d="scan'208";a="149328092" From: Baole Ni To: anton@enomsg.org, ccross@android.com, keescook@chromium.org, tony.luck@intel.com, tomi.valkeinen@ti.com, m.chehab@samsung.com, gregkh@linuxfoundation.org, m.szyprowski@samsung.com, kyungmin.park@samsung.com, k.kozlowski@samsung.com Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org, mingo@kernel.org, oleg@redhat.com, akpm@linux-foundation.org, linux@rasmusvillemoes.dk, chuansheng.liu@intel.com, baolex.ni@intel.com Subject: [PATCH 1061/1285] Replace numeric parameter like 0444 with macro Date: Tue, 2 Aug 2016 20:12:53 +0800 Message-Id: <20160802121253.20846-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 --- kernel/cpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index d948e44..dd3162d 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -1513,7 +1513,7 @@ static ssize_t show_cpuhp_state(struct device *dev, return sprintf(buf, "%d\n", st->state); } -static DEVICE_ATTR(state, 0444, show_cpuhp_state, NULL); +static DEVICE_ATTR(state, S_IRUSR | S_IRGRP | S_IROTH, show_cpuhp_state, NULL); static ssize_t write_cpuhp_target(struct device *dev, struct device_attribute *attr, @@ -1562,7 +1562,7 @@ static ssize_t show_cpuhp_target(struct device *dev, return sprintf(buf, "%d\n", st->target); } -static DEVICE_ATTR(target, 0644, show_cpuhp_target, write_cpuhp_target); +static DEVICE_ATTR(target, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, show_cpuhp_target, write_cpuhp_target); static struct attribute *cpuhp_cpu_attrs[] = { &dev_attr_state.attr, @@ -1595,7 +1595,7 @@ static ssize_t show_cpuhp_states(struct device *dev, mutex_unlock(&cpuhp_state_mutex); return res; } -static DEVICE_ATTR(states, 0444, show_cpuhp_states, NULL); +static DEVICE_ATTR(states, S_IRUSR | S_IRGRP | S_IROTH, show_cpuhp_states, NULL); static struct attribute *cpuhp_cpu_root_attrs[] = { &dev_attr_states.attr, -- 2.9.2