From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935160AbcHBMjy (ORCPT ); Tue, 2 Aug 2016 08:39:54 -0400 Received: from mga11.intel.com ([192.55.52.93]:28088 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965007AbcHBMj3 (ORCPT ); Tue, 2 Aug 2016 08:39:29 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,460,1464678000"; d="scan'208";a="1006964828" From: Baole Ni To: gregkh@linuxfoundation.org, maurochehab@gmail.com, mchehab@infradead.org, mchehab@redhat.com, m.chehab@samsung.com, m.szyprowski@samsung.com, kyungmin.park@samsung.com, k.kozlowski@samsung.com Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, aaro.koskinen@iki.fi, david.daney@cavium.com, nevola@gmail.com, cristina.moraru09@gmail.com, aybuke.147@gmail.com, bhaktipriya96@gmail.com, chuansheng.liu@intel.com, baolex.ni@intel.com Subject: [PATCH 0949/1285] Replace numeric parameter like 0444 with macro Date: Tue, 2 Aug 2016 20:01:47 +0800 Message-Id: <20160802120147.13302-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/staging/octeon/ethernet.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c index e9cd5f2..d0841ed 100644 --- a/drivers/staging/octeon/ethernet.c +++ b/drivers/staging/octeon/ethernet.c @@ -40,13 +40,13 @@ #include static int num_packet_buffers = 1024; -module_param(num_packet_buffers, int, 0444); +module_param(num_packet_buffers, int, S_IRUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(num_packet_buffers, "\n" "\tNumber of packet buffers to allocate and store in the\n" "\tFPA. By default, 1024 packet buffers are used.\n"); int pow_receive_group = 15; -module_param(pow_receive_group, int, 0444); +module_param(pow_receive_group, int, S_IRUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(pow_receive_group, "\n" "\tPOW group to receive packets from. All ethernet hardware\n" "\twill be configured to send incoming packets to this POW\n" @@ -54,14 +54,14 @@ MODULE_PARM_DESC(pow_receive_group, "\n" "\tgroup for the kernel to process."); int pow_send_group = -1; -module_param(pow_send_group, int, 0644); +module_param(pow_send_group, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(pow_send_group, "\n" "\tPOW group to send packets to other software on. This\n" "\tcontrols the creation of the virtual device pow0.\n" "\talways_use_pow also depends on this value."); int always_use_pow; -module_param(always_use_pow, int, 0444); +module_param(always_use_pow, int, S_IRUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(always_use_pow, "\n" "\tWhen set, always send to the pow group. This will cause\n" "\tpackets sent to real ethernet devices to be sent to the\n" @@ -73,7 +73,7 @@ MODULE_PARM_DESC(always_use_pow, "\n" "\tthis option."); char pow_send_list[128] = ""; -module_param_string(pow_send_list, pow_send_list, sizeof(pow_send_list), 0444); +module_param_string(pow_send_list, pow_send_list, sizeof(pow_send_list), S_IRUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(pow_send_list, "\n" "\tComma separated list of ethernet devices that should use the\n" "\tPOW for transmit instead of the actual ethernet hardware. This\n" @@ -83,7 +83,7 @@ MODULE_PARM_DESC(pow_send_list, "\n" "\tusing the pow_send_group."); int rx_napi_weight = 32; -module_param(rx_napi_weight, int, 0444); +module_param(rx_napi_weight, int, S_IRUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(rx_napi_weight, "The NAPI WEIGHT parameter."); -- 2.9.2