lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20160802111849.15555-1-baolex.ni@intel.com>
Date:	Tue,  2 Aug 2016 19:18:49 +0800
From:	Baole Ni <baolex.ni@...el.com>
To:	mchehab@...nel.org, maurochehab@...il.com, mchehab@...radead.org,
	mchehab@...hat.com, m.chehab@...sung.com, hverkuil@...all.nl,
	a.hajda@...sung.com, bp@...en8.de
Cc:	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
	akpm@...ux-foundation.org, chuansheng.liu@...el.com,
	baolex.ni@...el.com, jh1009.sung@...sung.com,
	nenggun.kim@...sung.com, hdegoede@...hat.com
Subject: [PATCH 0504/1285] Replace numeric parameter like 0444 with macro

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 <chuansheng.liu@...el.com>
Signed-off-by: Baole Ni <baolex.ni@...el.com>
---
 drivers/media/pci/saa7164/saa7164-core.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/media/pci/saa7164/saa7164-core.c b/drivers/media/pci/saa7164/saa7164-core.c
index 8bbd092..ade4d2c 100644
--- a/drivers/media/pci/saa7164/saa7164-core.c
+++ b/drivers/media/pci/saa7164/saa7164-core.c
@@ -49,44 +49,44 @@ MODULE_LICENSE("GPL");
  */
 
 unsigned int saa_debug;
-module_param_named(debug, saa_debug, int, 0644);
+module_param_named(debug, saa_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(debug, "enable debug messages");
 
 static unsigned int fw_debug;
-module_param(fw_debug, int, 0644);
+module_param(fw_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(fw_debug, "Firmware debug level def:2");
 
 unsigned int encoder_buffers = SAA7164_MAX_ENCODER_BUFFERS;
-module_param(encoder_buffers, int, 0644);
+module_param(encoder_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(encoder_buffers, "Total buffers in read queue 16-512 def:64");
 
 unsigned int vbi_buffers = SAA7164_MAX_VBI_BUFFERS;
-module_param(vbi_buffers, int, 0644);
+module_param(vbi_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(vbi_buffers, "Total buffers in read queue 16-512 def:64");
 
 unsigned int waitsecs = 10;
-module_param(waitsecs, int, 0644);
+module_param(waitsecs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(waitsecs, "timeout on firmware messages");
 
 static unsigned int card[]  = {[0 ... (SAA7164_MAXBOARDS - 1)] = UNSET };
-module_param_array(card,  int, NULL, 0444);
+module_param_array(card,  int, NULL, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(card, "card type");
 
 static unsigned int print_histogram = 64;
-module_param(print_histogram, int, 0644);
+module_param(print_histogram, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(print_histogram, "print histogram values once");
 
 unsigned int crc_checking = 1;
-module_param(crc_checking, int, 0644);
+module_param(crc_checking, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(crc_checking, "enable crc sanity checking on buffers");
 
 static unsigned int guard_checking = 1;
-module_param(guard_checking, int, 0644);
+module_param(guard_checking, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(guard_checking,
 	"enable dma sanity checking for buffer overruns");
 
 static bool enable_msi = true;
-module_param(enable_msi, bool, 0444);
+module_param(enable_msi, bool, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(enable_msi,
 		"enable the use of an msi interrupt if available");
 
-- 
2.9.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ