From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935436AbcHBQUK (ORCPT ); Tue, 2 Aug 2016 12:20:10 -0400 Received: from mga01.intel.com ([192.55.52.88]:55833 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934289AbcHBMRf (ORCPT ); Tue, 2 Aug 2016 08:17:35 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,460,1464678000"; d="scan'208";a="743082987" From: Baole Ni To: boris.brezillon@free-electrons.com, richard@nod.at, dwmw2@infradead.org, computersforpeace@gmail.com, m.chehab@samsung.com, pawel@osciak.com, m.szyprowski@samsung.com, kyungmin.park@samsung.com, k.kozlowski@samsung.com Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, chuansheng.liu@intel.com, baolex.ni@intel.com, grundler@chromium.org, lporzio@micron.com Subject: [PATCH 0703/1285] Replace numeric parameter like 0444 with macro Date: Tue, 2 Aug 2016 19:38:13 +0800 Message-Id: <20160802113813.28923-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/mtd/nand/nandsim.c | 48 +++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 1eb9344..08e78fd 100644 --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/mtd/nand/nandsim.c @@ -115,30 +115,30 @@ static u_char id_bytes[8] = { [4 ... 7] = 0xFF, }; -module_param_array(id_bytes, byte, NULL, 0400); -module_param_named(first_id_byte, id_bytes[0], byte, 0400); -module_param_named(second_id_byte, id_bytes[1], byte, 0400); -module_param_named(third_id_byte, id_bytes[2], byte, 0400); -module_param_named(fourth_id_byte, id_bytes[3], byte, 0400); -module_param(access_delay, uint, 0400); -module_param(programm_delay, uint, 0400); -module_param(erase_delay, uint, 0400); -module_param(output_cycle, uint, 0400); -module_param(input_cycle, uint, 0400); -module_param(bus_width, uint, 0400); -module_param(do_delays, uint, 0400); -module_param(log, uint, 0400); -module_param(dbg, uint, 0400); -module_param_array(parts, ulong, &parts_num, 0400); -module_param(badblocks, charp, 0400); -module_param(weakblocks, charp, 0400); -module_param(weakpages, charp, 0400); -module_param(bitflips, uint, 0400); -module_param(gravepages, charp, 0400); -module_param(overridesize, uint, 0400); -module_param(cache_file, charp, 0400); -module_param(bbt, uint, 0400); -module_param(bch, uint, 0400); +module_param_array(id_bytes, byte, NULL, S_IRUSR); +module_param_named(first_id_byte, id_bytes[0], byte, S_IRUSR); +module_param_named(second_id_byte, id_bytes[1], byte, S_IRUSR); +module_param_named(third_id_byte, id_bytes[2], byte, S_IRUSR); +module_param_named(fourth_id_byte, id_bytes[3], byte, S_IRUSR); +module_param(access_delay, uint, S_IRUSR); +module_param(programm_delay, uint, S_IRUSR); +module_param(erase_delay, uint, S_IRUSR); +module_param(output_cycle, uint, S_IRUSR); +module_param(input_cycle, uint, S_IRUSR); +module_param(bus_width, uint, S_IRUSR); +module_param(do_delays, uint, S_IRUSR); +module_param(log, uint, S_IRUSR); +module_param(dbg, uint, S_IRUSR); +module_param_array(parts, ulong, &parts_num, S_IRUSR); +module_param(badblocks, charp, S_IRUSR); +module_param(weakblocks, charp, S_IRUSR); +module_param(weakpages, charp, S_IRUSR); +module_param(bitflips, uint, S_IRUSR); +module_param(gravepages, charp, S_IRUSR); +module_param(overridesize, uint, S_IRUSR); +module_param(cache_file, charp, S_IRUSR); +module_param(bbt, uint, S_IRUSR); +module_param(bch, uint, S_IRUSR); MODULE_PARM_DESC(id_bytes, "The ID bytes returned by NAND Flash 'read ID' command"); MODULE_PARM_DESC(first_id_byte, "The first byte returned by NAND Flash 'read ID' command (manufacturer ID) (obsolete)"); -- 2.9.2