From patchwork Tue Aug 2 12:08:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "baolex.ni" X-Patchwork-Id: 9256929 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 61F2660865 for ; Tue, 2 Aug 2016 12:47:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53637284F6 for ; Tue, 2 Aug 2016 12:47:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47FBF2852F; Tue, 2 Aug 2016 12:47:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5CF62852D for ; Tue, 2 Aug 2016 12:47:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965416AbcHBMrz (ORCPT ); Tue, 2 Aug 2016 08:47:55 -0400 Received: from mga03.intel.com ([134.134.136.65]:46163 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965333AbcHBMpv (ORCPT ); Tue, 2 Aug 2016 08:45:51 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 02 Aug 2016 05:45:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,460,1464678000"; d="scan'208";a="743094574" Received: from shsibuild003.sh.intel.com ([10.239.146.225]) by FMSMGA003.fm.intel.com with ESMTP; 02 Aug 2016 05:45:43 -0700 From: Baole Ni To: tomi.valkeinen@ti.com, plagnioj@jcrosoft.com, m.chehab@samsung.com, gregkh@linuxfoundation.org, m.szyprowski@samsung.com, kyungmin.park@samsung.com, k.kozlowski@samsung.com Cc: linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, chuansheng.liu@intel.com, baolex.ni@intel.com, oneukum@suse.com Subject: [PATCH 1011/1285] Replace numeric parameter like 0444 with macro Date: Tue, 2 Aug 2016 20:08:05 +0800 Message-Id: <20160802120805.17489-1-baolex.ni@intel.com> X-Mailer: git-send-email 2.9.2 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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/video/fbdev/omap/omapfb_main.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c index 6429f33..e03c066 100644 --- a/drivers/video/fbdev/omap/omapfb_main.c +++ b/drivers/video/fbdev/omap/omapfb_main.c @@ -1307,8 +1307,8 @@ static ssize_t omapfb_show_caps_text(struct device *dev, return size; } -static DEVICE_ATTR(caps_num, 0444, omapfb_show_caps_num, NULL); -static DEVICE_ATTR(caps_text, 0444, omapfb_show_caps_text, NULL); +static DEVICE_ATTR(caps_num, S_IRUSR | S_IRGRP | S_IROTH, omapfb_show_caps_num, NULL); +static DEVICE_ATTR(caps_text, S_IRUSR | S_IRGRP | S_IROTH, omapfb_show_caps_text, NULL); /* panel sysfs entries */ static ssize_t omapfb_show_panel_name(struct device *dev, @@ -1370,9 +1370,9 @@ static ssize_t omapfb_show_bklight_max(struct device *dev, static struct device_attribute dev_attr_panel_name = __ATTR(name, 0444, omapfb_show_panel_name, NULL); -static DEVICE_ATTR(backlight_level, 0664, +static DEVICE_ATTR(backlight_level, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH, omapfb_show_bklight_level, omapfb_store_bklight_level); -static DEVICE_ATTR(backlight_max, 0444, omapfb_show_bklight_max, NULL); +static DEVICE_ATTR(backlight_max, S_IRUSR | S_IRGRP | S_IROTH, omapfb_show_bklight_max, NULL); static struct attribute *panel_attrs[] = { &dev_attr_panel_name.attr, @@ -1928,13 +1928,13 @@ static void __exit omapfb_cleanup(void) platform_driver_unregister(&omapfb_driver); } -module_param_named(accel, def_accel, uint, 0664); -module_param_array_named(vram, def_vram, ulong, &def_vram_cnt, 0664); -module_param_named(vxres, def_vxres, long, 0664); -module_param_named(vyres, def_vyres, long, 0664); -module_param_named(rotate, def_rotate, uint, 0664); -module_param_named(mirror, def_mirror, uint, 0664); -module_param_named(manual_update, manual_update, bool, 0664); +module_param_named(accel, def_accel, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH); +module_param_array_named(vram, def_vram, ulong, &def_vram_cnt, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH); +module_param_named(vxres, def_vxres, long, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH); +module_param_named(vyres, def_vyres, long, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH); +module_param_named(rotate, def_rotate, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH); +module_param_named(mirror, def_mirror, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH); +module_param_named(manual_update, manual_update, bool, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH); module_init(omapfb_init); module_exit(omapfb_cleanup);