From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932870AbcHBLxK (ORCPT ); Tue, 2 Aug 2016 07:53:10 -0400 Received: from mga04.intel.com ([192.55.52.120]:21960 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756343AbcHBLwp (ORCPT ); Tue, 2 Aug 2016 07:52:45 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,460,1464678000"; d="scan'208";a="1028260125" From: Baole Ni To: mchehab@kernel.org, maurochehab@gmail.com, mchehab@infradead.org, mchehab@redhat.com, m.chehab@samsung.com, awalls@md.metrocast.net, a.hajda@samsung.com, bp@alien8.de Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, chuansheng.liu@intel.com, baolex.ni@intel.com, elfring@users.sourceforge.net Subject: [PATCH 0455/1285] Replace numeric parameter like 0444 with macro Date: Tue, 2 Aug 2016 19:13:35 +0800 Message-Id: <20160802111335.12211-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/media/pci/cx18/cx18-driver.c | 62 ++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c index 260e462..15b2ede 100644 --- a/drivers/media/pci/cx18/cx18-driver.c +++ b/drivers/media/pci/cx18/cx18-driver.c @@ -109,37 +109,37 @@ static int retry_mmio = 1; int cx18_debug; -module_param_array(tuner, int, &tuner_c, 0644); -module_param_array(radio, int, &radio_c, 0644); -module_param_array(cardtype, int, &cardtype_c, 0644); -module_param_string(pal, pal, sizeof(pal), 0644); -module_param_string(secam, secam, sizeof(secam), 0644); -module_param_string(ntsc, ntsc, sizeof(ntsc), 0644); -module_param_named(debug, cx18_debug, int, 0644); -module_param(mmio_ndelay, int, 0644); -module_param(retry_mmio, int, 0644); -module_param(cx18_pci_latency, int, 0644); -module_param(cx18_first_minor, int, 0644); - -module_param(enc_ts_buffers, int, 0644); -module_param(enc_mpg_buffers, int, 0644); -module_param(enc_idx_buffers, int, 0644); -module_param(enc_yuv_buffers, int, 0644); -module_param(enc_vbi_buffers, int, 0644); -module_param(enc_pcm_buffers, int, 0644); - -module_param(enc_ts_bufsize, int, 0644); -module_param(enc_mpg_bufsize, int, 0644); -module_param(enc_idx_bufsize, int, 0644); -module_param(enc_yuv_bufsize, int, 0644); -module_param(enc_pcm_bufsize, int, 0644); - -module_param(enc_ts_bufs, int, 0644); -module_param(enc_mpg_bufs, int, 0644); -module_param(enc_idx_bufs, int, 0644); -module_param(enc_yuv_bufs, int, 0644); -module_param(enc_vbi_bufs, int, 0644); -module_param(enc_pcm_bufs, int, 0644); +module_param_array(tuner, int, &tuner_c, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param_array(radio, int, &radio_c, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param_array(cardtype, int, &cardtype_c, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param_string(pal, pal, sizeof(pal), S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param_string(secam, secam, sizeof(secam), S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param_string(ntsc, ntsc, sizeof(ntsc), S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param_named(debug, cx18_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(mmio_ndelay, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(retry_mmio, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(cx18_pci_latency, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(cx18_first_minor, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + +module_param(enc_ts_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_mpg_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_idx_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_yuv_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_vbi_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_pcm_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + +module_param(enc_ts_bufsize, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_mpg_bufsize, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_idx_bufsize, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_yuv_bufsize, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_pcm_bufsize, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + +module_param(enc_ts_bufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_mpg_bufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_idx_bufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_yuv_bufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_vbi_bufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(enc_pcm_bufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(tuner, "Tuner type selection,\n" "\t\t\tsee tuner.h for values"); -- 2.9.2