From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756189AbcHBLis (ORCPT ); Tue, 2 Aug 2016 07:38:48 -0400 Received: from mga09.intel.com ([134.134.136.24]:15779 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755935AbcHBLgs (ORCPT ); Tue, 2 Aug 2016 07:36:48 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,459,1464678000"; d="scan'208";a="1006928899" From: Baole Ni To: jdelvare@suse.com, maurochehab@gmail.com, mchehab@infradead.org, mchehab@redhat.com, m.chehab@samsung.com, lho@apm.com, dougthompson@xmission.com, bp@alien8.de Cc: linux-kernel@vger.kernel.org, chuansheng.liu@intel.com, baolex.ni@intel.com, lee.jones@linaro.org Subject: [PATCH 0169/1285] Replace numeric parameter like 0444 with macro Date: Tue, 2 Aug 2016 18:46:15 +0800 Message-Id: <20160802104615.25006-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/firmware/edd.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c index e229576..17ff3ac 100644 --- a/drivers/firmware/edd.c +++ b/drivers/firmware/edd.c @@ -559,29 +559,29 @@ edd_has_edd30(struct edd_device *edev) } -static EDD_DEVICE_ATTR(raw_data, 0444, edd_show_raw_data, edd_has_edd_info); -static EDD_DEVICE_ATTR(version, 0444, edd_show_version, edd_has_edd_info); -static EDD_DEVICE_ATTR(extensions, 0444, edd_show_extensions, edd_has_edd_info); -static EDD_DEVICE_ATTR(info_flags, 0444, edd_show_info_flags, edd_has_edd_info); -static EDD_DEVICE_ATTR(sectors, 0444, edd_show_sectors, edd_has_edd_info); -static EDD_DEVICE_ATTR(legacy_max_cylinder, 0444, +static EDD_DEVICE_ATTR(raw_data, S_IRUSR | S_IRGRP | S_IROTH, edd_show_raw_data, edd_has_edd_info); +static EDD_DEVICE_ATTR(version, S_IRUSR | S_IRGRP | S_IROTH, edd_show_version, edd_has_edd_info); +static EDD_DEVICE_ATTR(extensions, S_IRUSR | S_IRGRP | S_IROTH, edd_show_extensions, edd_has_edd_info); +static EDD_DEVICE_ATTR(info_flags, S_IRUSR | S_IRGRP | S_IROTH, edd_show_info_flags, edd_has_edd_info); +static EDD_DEVICE_ATTR(sectors, S_IRUSR | S_IRGRP | S_IROTH, edd_show_sectors, edd_has_edd_info); +static EDD_DEVICE_ATTR(legacy_max_cylinder, S_IRUSR | S_IRGRP | S_IROTH, edd_show_legacy_max_cylinder, edd_has_legacy_max_cylinder); -static EDD_DEVICE_ATTR(legacy_max_head, 0444, edd_show_legacy_max_head, +static EDD_DEVICE_ATTR(legacy_max_head, S_IRUSR | S_IRGRP | S_IROTH, edd_show_legacy_max_head, edd_has_legacy_max_head); -static EDD_DEVICE_ATTR(legacy_sectors_per_track, 0444, +static EDD_DEVICE_ATTR(legacy_sectors_per_track, S_IRUSR | S_IRGRP | S_IROTH, edd_show_legacy_sectors_per_track, edd_has_legacy_sectors_per_track); -static EDD_DEVICE_ATTR(default_cylinders, 0444, edd_show_default_cylinders, +static EDD_DEVICE_ATTR(default_cylinders, S_IRUSR | S_IRGRP | S_IROTH, edd_show_default_cylinders, edd_has_default_cylinders); -static EDD_DEVICE_ATTR(default_heads, 0444, edd_show_default_heads, +static EDD_DEVICE_ATTR(default_heads, S_IRUSR | S_IRGRP | S_IROTH, edd_show_default_heads, edd_has_default_heads); -static EDD_DEVICE_ATTR(default_sectors_per_track, 0444, +static EDD_DEVICE_ATTR(default_sectors_per_track, S_IRUSR | S_IRGRP | S_IROTH, edd_show_default_sectors_per_track, edd_has_default_sectors_per_track); -static EDD_DEVICE_ATTR(interface, 0444, edd_show_interface, edd_has_edd30); -static EDD_DEVICE_ATTR(host_bus, 0444, edd_show_host_bus, edd_has_edd30); -static EDD_DEVICE_ATTR(mbr_signature, 0444, edd_show_mbr_signature, edd_has_mbr_signature); +static EDD_DEVICE_ATTR(interface, S_IRUSR | S_IRGRP | S_IROTH, edd_show_interface, edd_has_edd30); +static EDD_DEVICE_ATTR(host_bus, S_IRUSR | S_IRGRP | S_IROTH, edd_show_host_bus, edd_has_edd30); +static EDD_DEVICE_ATTR(mbr_signature, S_IRUSR | S_IRGRP | S_IROTH, edd_show_mbr_signature, edd_has_mbr_signature); /* These are default attributes that are added for every edd -- 2.9.2