mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0505/1285] Replace numeric parameter like 0444 with macro
@ 2016-08-02 11:18 Baole Ni
  2016-08-02 16:53 ` Ismael Luceno
  0 siblings, 1 reply; 2+ messages in thread
From: Baole Ni @ 2016-08-02 11:18 UTC (permalink / raw)
  To: mchehab, maurochehab, mchehab, mchehab, m.chehab, maintainers,
	andrey.utkin, ismael, bp
  Cc: linux-media, linux-kernel, chuansheng.liu, baolex.ni,
	jh1009.sung, nenggun.kim, hdegoede

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@intel.com>
Signed-off-by: Baole Ni <baolex.ni@intel.com>
---
 drivers/media/pci/solo6x10/solo6x10-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/pci/solo6x10/solo6x10-core.c b/drivers/media/pci/solo6x10/solo6x10-core.c
index f50d072..d9acfc7 100644
--- a/drivers/media/pci/solo6x10/solo6x10-core.c
+++ b/drivers/media/pci/solo6x10/solo6x10-core.c
@@ -37,11 +37,11 @@ MODULE_VERSION(SOLO6X10_VERSION);
 MODULE_LICENSE("GPL");
 
 static unsigned video_nr = -1;
-module_param(video_nr, uint, 0644);
+module_param(video_nr, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(video_nr, "videoX start number, -1 is autodetect (default)");
 
 static int full_eeprom; /* default is only top 64B */
-module_param(full_eeprom, uint, 0644);
+module_param(full_eeprom, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(full_eeprom, "Allow access to full 128B EEPROM (dangerous)");
 
 
-- 
2.9.2

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 0505/1285] Replace numeric parameter like 0444 with macro
  2016-08-02 11:18 [PATCH 0505/1285] Replace numeric parameter like 0444 with macro Baole Ni
@ 2016-08-02 16:53 ` Ismael Luceno
  0 siblings, 0 replies; 2+ messages in thread
From: Ismael Luceno @ 2016-08-02 16:53 UTC (permalink / raw)
  To: Baole Ni
  Cc: mchehab, andrey.utkin, bp, linux-media, linux-kernel,
	chuansheng.liu, jh1009.sung, nenggun.kim, hdegoede

On 02/Ago/2016 19:18, Baole Ni wrote:
> 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.

That's very subjective; I don't agree.

IMO numbers are better in this context.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-02 17:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 11:18 [PATCH 0505/1285] Replace numeric parameter like 0444 with macro Baole Ni
2016-08-02 16:53 ` Ismael Luceno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®