From patchwork Tue Aug 2 11:48:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "baolex.ni" X-Patchwork-Id: 9256653 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 5DC7560754 for ; Tue, 2 Aug 2016 12:28:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F73E2851D for ; Tue, 2 Aug 2016 12:28:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 43C2128523; Tue, 2 Aug 2016 12:28:42 +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 115942851D for ; Tue, 2 Aug 2016 12:28:40 +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 1bUYll-0005yi-H0; Tue, 02 Aug 2016 12:26:01 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bUYlk-0005yW-1C for xen-devel@lists.xenproject.org; Tue, 02 Aug 2016 12:26:00 +0000 Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id 00/43-17024-75190A75; Tue, 02 Aug 2016 12:25:59 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrILMWRWlGSWpSXmKPExsXS1tYhohs2cUG 4weZpWhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bDZ5uYCv6LVnx/bNfA2CbcxcjJISRQIXFl 3StGEFtCgFfiyLIZrBC2v8SyI5eZIGrqJP61tbJ3MXJwsAmoSPRPr+ti5OIQEdjPKLHt5yNmk BpmgW5GielrxUBqhAU8JV5+twExWQRUJX62Z4BU8AqYS/Sd7GKBmC4n8fL1T+YJjNwLGBlWMa oXpxaVpRbpmuklFWWmZ5TkJmbm6BoamujlphYXJ6an5iQmFesl5+duYgR6lQEIdjD+neB8iFG Sg0lJlNfly/xwIb6k/JTKjMTijPii0pzU4kOMMhwcShK8ohMWhAsJFqWmp1akZeYAwwsmLcHB oyTCexIkzVtckJhbnJkOkTrFqCglzisOkhAASWSU5sG1wUL6EqOslDAvI9AhQjwFqUW5mSWo8 q8YxTkYlYR5v/YDTeHJzCuBm/4KaDET0OITBmCLSxIRUlINjIfk3x9n++pS/Oi2263FJ648WJ 23/bN+6RG+o+LrmH00I5K3fm78xVp6Z0Nl7qQdvJmPncQvL+2znf1ltt+625dmrOzJmSl3u2J PjuKMumlfdxuqWlxezGWolPRnQdsbq3rn1N2eos6iWZd3n2n+vfPW+jObL1/h/H/V22XD3b+r b7g/nObKetpQiaU4I9FQi7moOBEAypY4GWQCAAA= X-Env-Sender: baolex.ni@intel.com X-Msg-Ref: server-16.tower-27.messagelabs.com!1470140757!57315839!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 45528 invoked from network); 2 Aug 2016 12:25:58 -0000 Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by server-16.tower-27.messagelabs.com with SMTP; 2 Aug 2016 12:25:58 -0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 02 Aug 2016 05:25:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,460,1464678000"; d="scan'208";a="858132577" Received: from shsibuild003.sh.intel.com ([10.239.146.225]) by orsmga003.jf.intel.com with ESMTP; 02 Aug 2016 05:25:51 -0700 From: Baole Ni To: wei.liu2@citrix.com, kvalo@codeaurora.org, linuxwifi@intel.com, m.chehab@samsung.com, pawel@osciak.com, m.szyprowski@samsung.com, kyungmin.park@samsung.com, k.kozlowski@samsung.com Date: Tue, 2 Aug 2016 19:48:12 +0800 Message-Id: <20160802114812.3632-1-baolex.ni@intel.com> X-Mailer: git-send-email 2.9.2 Cc: baolex.ni@intel.com, xen-devel@lists.xenproject.org, chuansheng.liu@intel.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [Xen-devel] [PATCH 0805/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: Wei Liu --- drivers/net/xen-netback/netback.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index edbae0b..e6e6598 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -53,22 +53,22 @@ * enabled by default. */ bool separate_tx_rx_irq = true; -module_param(separate_tx_rx_irq, bool, 0644); +module_param(separate_tx_rx_irq, bool, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); /* The time that packets can stay on the guest Rx internal queue * before they are dropped. */ unsigned int rx_drain_timeout_msecs = 10000; -module_param(rx_drain_timeout_msecs, uint, 0444); +module_param(rx_drain_timeout_msecs, uint, S_IRUSR | S_IRGRP | S_IROTH); /* The length of time before the frontend is considered unresponsive * because it isn't providing Rx slots. */ unsigned int rx_stall_timeout_msecs = 60000; -module_param(rx_stall_timeout_msecs, uint, 0444); +module_param(rx_stall_timeout_msecs, uint, S_IRUSR | S_IRGRP | S_IROTH); unsigned int xenvif_max_queues; -module_param_named(max_queues, xenvif_max_queues, uint, 0644); +module_param_named(max_queues, xenvif_max_queues, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(max_queues, "Maximum number of queues per virtual interface"); @@ -78,7 +78,7 @@ MODULE_PARM_DESC(max_queues, */ #define FATAL_SKB_SLOTS_DEFAULT 20 static unsigned int fatal_skb_slots = FATAL_SKB_SLOTS_DEFAULT; -module_param(fatal_skb_slots, uint, 0444); +module_param(fatal_skb_slots, uint, S_IRUSR | S_IRGRP | S_IROTH); /* The amount to copy out of the first guest Tx slot into the skb's * linear area. If the first slot has more data, it will be mapped @@ -92,7 +92,7 @@ module_param(fatal_skb_slots, uint, 0444); /* This is the maximum number of flows in the hash cache. */ #define XENVIF_HASH_CACHE_SIZE_DEFAULT 64 unsigned int xenvif_hash_cache_size = XENVIF_HASH_CACHE_SIZE_DEFAULT; -module_param_named(hash_cache_size, xenvif_hash_cache_size, uint, 0644); +module_param_named(hash_cache_size, xenvif_hash_cache_size, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(hash_cache_size, "Number of flows in the hash cache"); static void xenvif_idx_release(struct xenvif_queue *queue, u16 pending_idx,