From patchwork Tue Aug 2 10:56:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "baolex.ni" X-Patchwork-Id: 9259869 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 C8D706077C for ; Tue, 2 Aug 2016 18:06:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0C6C28304 for ; Tue, 2 Aug 2016 18:06:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5106284B6; Tue, 2 Aug 2016 18:06:56 +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=unavailable 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 472F528304 for ; Tue, 2 Aug 2016 18:06:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968186AbcHBSDx (ORCPT ); Tue, 2 Aug 2016 14:03:53 -0400 Received: from mga11.intel.com ([192.55.52.93]:43413 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755876AbcHBLgZ (ORCPT ); Tue, 2 Aug 2016 07:36:25 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 02 Aug 2016 04:34:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,460,1464678000"; d="scan'208";a="1006933658" Received: from shsibuild003.sh.intel.com ([10.239.146.225]) by orsmga001.jf.intel.com with ESMTP; 02 Aug 2016 04:34:10 -0700 From: Baole Ni To: dmitry.torokhov@gmail.com, hal.rosenstock@gmail.com, dledford@redhat.com, sean.hefty@intel.com, bp@alien8.de Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, hdegoede@redhat.com, pali.rohar@gmail.com, chris@diamand.org, sassmann@kpanic.de, pospeselr@gmail.com, chuansheng.liu@intel.com, baolex.ni@intel.com Subject: [PATCH 0283/1285] Replace numeric parameter like 0444 with macro Date: Tue, 2 Aug 2016 18:56:30 +0800 Message-Id: <20160802105630.32684-1-baolex.ni@intel.com> X-Mailer: git-send-email 2.9.2 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@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/input/mouse/psmouse-base.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 5784e20..fccd10d 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -53,27 +53,27 @@ static const struct kernel_param_ops param_ops_proto_abbrev = { .get = psmouse_get_maxproto, }; #define param_check_proto_abbrev(name, p) __param_check(name, p, unsigned int) -module_param_named(proto, psmouse_max_proto, proto_abbrev, 0644); +module_param_named(proto, psmouse_max_proto, proto_abbrev, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(proto, "Highest protocol extension to probe (bare, imps, exps, any). Useful for KVM switches."); static unsigned int psmouse_resolution = 200; -module_param_named(resolution, psmouse_resolution, uint, 0644); +module_param_named(resolution, psmouse_resolution, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(resolution, "Resolution, in dpi."); static unsigned int psmouse_rate = 100; -module_param_named(rate, psmouse_rate, uint, 0644); +module_param_named(rate, psmouse_rate, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(rate, "Report rate, in reports per second."); static bool psmouse_smartscroll = true; -module_param_named(smartscroll, psmouse_smartscroll, bool, 0644); +module_param_named(smartscroll, psmouse_smartscroll, bool, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(smartscroll, "Logitech Smartscroll autorepeat, 1 = enabled (default), 0 = disabled."); static unsigned int psmouse_resetafter = 5; -module_param_named(resetafter, psmouse_resetafter, uint, 0644); +module_param_named(resetafter, psmouse_resetafter, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(resetafter, "Reset device after so many bad packets (0 = never)."); static unsigned int psmouse_resync_time; -module_param_named(resync_time, psmouse_resync_time, uint, 0644); +module_param_named(resync_time, psmouse_resync_time, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(resync_time, "How long can mouse stay idle before forcing resync (in seconds, 0 = never)."); PSMOUSE_DEFINE_ATTR(protocol, S_IWUSR | S_IRUGO,