From patchwork Tue Aug 2 10:40:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "baolex.ni" X-Patchwork-Id: 9255649 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 2C63B6077C for ; Tue, 2 Aug 2016 11:23:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CCC3284D4 for ; Tue, 2 Aug 2016 11:23:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1120D28513; Tue, 2 Aug 2016 11:23:59 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ED562284D4 for ; Tue, 2 Aug 2016 11:23:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bUXlC-0008DS-9r; Tue, 02 Aug 2016 11:21:22 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bUXhz-0007bd-Vd for xen-devel@lists.xenproject.org; Tue, 02 Aug 2016 11:18:04 +0000 Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id 55/5C-29022-B6180A75; Tue, 02 Aug 2016 11:18:03 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCLMWRWlGSWpSXmKPExsXS1tYhopvVuCD c4MZ+I4vvWyYzOTB6HP5whSWAMYo1My8pvyKBNePl5stsBZuEKpZ9ns7ewPiFv4uRk0NIoELi 4fFmFhBbQoBX4siyGawQtr/E0XNNrBA1dRKPVveydzFycLAJqEj0T68DCYsAhf/8nwwU5uJgF ljNKLHg9VsmkISwgKfE/N7PjCA2i4CqxMaGa6wgvbwCFhJ79jtAjJeTePn6J/MERu4FjAyrGD WKU4vKUot0Dc31kooy0zNKchMzc3QNDUz1clOLixPTU3MSk4r1kvNzNzECfcsABDsYL572PMQ oycGkJMrr8mV+uBBfUn5KZUZicUZ8UWlOavEhRhkODiUJ3sP1C8KFBItS01Mr0jJzgEEGk5bg 4FES4b1YA5TmLS5IzC3OTIdInWJUlBLn7QLpEwBJZJTmwbXBAvsSo6yUMC8j0CFCPAWpRbmZJ ajyrxjFORiVhHl/gEzhycwrgZv+CmgxE9DiEwZgi0sSEVJSDYyHI2eqiNl+M3J45+k/3XWdnQ ZDkfGsafVfjh3/K5v5bN+Uz64mgj8Va57kzQldyrhw3xdl3z1fr1vZ6Ey6Eul5o7fi3997po/ UL019lzpb9+eyF5XX1XUc2j5cSVvQvHKrxporaZasWx15tblD37MUvYr9UZNYWV/8KnruHJ5m ze/WTyvM1HKVWIozEg21mIuKEwGbiyn1ZwIAAA== X-Env-Sender: baolex.ni@intel.com X-Msg-Ref: server-10.tower-206.messagelabs.com!1470136681!35322118!1 X-Originating-IP: [134.134.136.20] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzU1MzU4\n X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23455 invoked from network); 2 Aug 2016 11:18:02 -0000 Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by server-10.tower-206.messagelabs.com with SMTP; 2 Aug 2016 11:18:02 -0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 02 Aug 2016 04:18:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,459,1464678000"; d="scan'208";a="858083838" Received: from shsibuild003.sh.intel.com ([10.239.146.225]) by orsmga003.jf.intel.com with ESMTP; 02 Aug 2016 04:18:00 -0700 From: Baole Ni To: konrad.wilk@oracle.com, roger.pau@citrix.com, pavel@ucw.cz, gregkh@linuxfoundation.org, hpa@zytor.com, x86@kernel.org Date: Tue, 2 Aug 2016 18:40:21 +0800 Message-Id: <20160802104021.20157-1-baolex.ni@intel.com> X-Mailer: git-send-email 2.9.2 X-Mailman-Approved-At: Tue, 02 Aug 2016 11:21:21 +0000 Cc: martin.petersen@oracle.com, linux-kernel@vger.kernel.org, baolex.ni@intel.com, xen-devel@lists.xenproject.org, chuansheng.liu@intel.com, kent.overstreet@gmail.com Subject: [Xen-devel] [PATCH 0096/1285] Replace numeric parameter like 0444 with macro X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" 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 Acked-by: Roger Pau Monné --- drivers/block/xen-blkback/blkback.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index 4809c15..73251ce 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c @@ -63,7 +63,7 @@ */ static int xen_blkif_max_buffer_pages = 1024; -module_param_named(max_buffer_pages, xen_blkif_max_buffer_pages, int, 0644); +module_param_named(max_buffer_pages, xen_blkif_max_buffer_pages, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(max_buffer_pages, "Maximum number of free pages to keep in each block backend buffer"); @@ -79,7 +79,7 @@ MODULE_PARM_DESC(max_buffer_pages, */ static int xen_blkif_max_pgrants = 1056; -module_param_named(max_persistent_grants, xen_blkif_max_pgrants, int, 0644); +module_param_named(max_persistent_grants, xen_blkif_max_pgrants, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(max_persistent_grants, "Maximum number of grants to map persistently"); @@ -88,7 +88,7 @@ MODULE_PARM_DESC(max_persistent_grants, * are CPUs if user has not specified a value. */ unsigned int xenblk_max_queues; -module_param_named(max_queues, xenblk_max_queues, uint, 0644); +module_param_named(max_queues, xenblk_max_queues, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(max_queues, "Maximum number of hardware queues per virtual disk." \ "By default it is the number of online CPUs."); @@ -116,7 +116,7 @@ MODULE_PARM_DESC(max_ring_page_order, "Maximum order of pages to be used for the /* Run-time switchable: /sys/module/blkback/parameters/ */ static unsigned int log_stats; -module_param(log_stats, int, 0644); +module_param(log_stats, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); #define BLKBACK_INVALID_HANDLE (~0)