From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935590AbcHBQ4O (ORCPT ); Tue, 2 Aug 2016 12:56:14 -0400 Received: from mga01.intel.com ([192.55.52.88]:61754 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933058AbcHBMAE (ORCPT ); Tue, 2 Aug 2016 08:00:04 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,460,1464678000"; d="scan'208";a="1018201858" 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, sw0312.kim@samsung.com, jh1009.sung@samsung.com Subject: [PATCH 0486/1285] Replace numeric parameter like 0444 with macro Date: Tue, 2 Aug 2016 19:16:53 +0800 Message-Id: <20160802111653.14331-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/ivtv/ivtv-driver.c | 48 ++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c index 374033a..e3646f8 100644 --- a/drivers/media/pci/ivtv/ivtv-driver.c +++ b/drivers/media/pci/ivtv/ivtv-driver.c @@ -141,32 +141,32 @@ int ivtv_fw_debug; static int tunertype = -1; static int newi2c = -1; -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,ivtv_debug, 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,ivtv_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); #ifdef CONFIG_VIDEO_ADV_DEBUG -module_param_named(fw_debug, ivtv_fw_debug, int, 0644); +module_param_named(fw_debug, ivtv_fw_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); #endif -module_param(ivtv_pci_latency, int, 0644); -module_param(ivtv_yuv_mode, int, 0644); -module_param(ivtv_yuv_threshold, int, 0644); -module_param(ivtv_first_minor, int, 0644); - -module_param(enc_mpg_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(dec_mpg_buffers, int, 0644); -module_param(dec_yuv_buffers, int, 0644); -module_param(dec_vbi_buffers, int, 0644); - -module_param(tunertype, int, 0644); -module_param(newi2c, int, 0644); -module_param_array(i2c_clock_period, int, &i2c_clock_period_c, 0644); +module_param(ivtv_pci_latency, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(ivtv_yuv_mode, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(ivtv_yuv_threshold, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(ivtv_first_minor, 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_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(dec_mpg_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(dec_yuv_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(dec_vbi_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + +module_param(tunertype, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param(newi2c, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param_array(i2c_clock_period, int, &i2c_clock_period_c, 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