From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966958AbcHBP0Y (ORCPT ); Tue, 2 Aug 2016 11:26:24 -0400 Received: from mga14.intel.com ([192.55.52.115]:46508 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934905AbcHBMdA (ORCPT ); Tue, 2 Aug 2016 08:33:00 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,460,1464678000"; d="scan'208";a="1006961320" From: Baole Ni To: lgirdwood@gmail.com, broonie@kernel.org, paulus@samba.org, mpe@ellerman.id.au, dwmw2@infradead.org, m.chehab@samsung.com, pawel@osciak.com, m.szyprowski@samsung.com, kyungmin.park@samsung.com, k.kozlowski@samsung.com Cc: linux-kernel@vger.kernel.org, chuansheng.liu@intel.com, baolex.ni@intel.com Subject: [PATCH 0872/1285] Replace numeric parameter like 0444 with macro Date: Tue, 2 Aug 2016 19:53:58 +0800 Message-Id: <20160802115358.8110-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/regulator/virtual.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/virtual.c b/drivers/regulator/virtual.c index a6f1c7a..0084a1e 100644 --- a/drivers/regulator/virtual.c +++ b/drivers/regulator/virtual.c @@ -266,11 +266,11 @@ static ssize_t set_mode(struct device *dev, struct device_attribute *attr, return count; } -static DEVICE_ATTR(min_microvolts, 0664, show_min_uV, set_min_uV); -static DEVICE_ATTR(max_microvolts, 0664, show_max_uV, set_max_uV); -static DEVICE_ATTR(min_microamps, 0664, show_min_uA, set_min_uA); -static DEVICE_ATTR(max_microamps, 0664, show_max_uA, set_max_uA); -static DEVICE_ATTR(mode, 0664, show_mode, set_mode); +static DEVICE_ATTR(min_microvolts, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH, show_min_uV, set_min_uV); +static DEVICE_ATTR(max_microvolts, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH, show_max_uV, set_max_uV); +static DEVICE_ATTR(min_microamps, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH, show_min_uA, set_min_uA); +static DEVICE_ATTR(max_microamps, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH, show_max_uA, set_max_uA); +static DEVICE_ATTR(mode, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH, show_mode, set_mode); static struct attribute *regulator_virtual_attributes[] = { &dev_attr_min_microvolts.attr, -- 2.9.2