netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1088/1285] Replace numeric parameter like 0444 with macro
@ 2016-08-02 12:15 Baole Ni
  2016-08-02 13:56 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Baole Ni @ 2016-08-02 12:15 UTC (permalink / raw)
  To: marcel, gustavo, johan.hedberg, davem, jiangshanlai, m.chehab,
	gregkh, m.szyprowski, kyungmin.park, k.kozlowski
  Cc: linux-bluetooth, netdev, linux-kernel, chuansheng.liu, baolex.ni,
	mhocko, koct9i, aarcange, aryabinin

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>
---
 net/bluetooth/l2cap_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index eb4f5f2..1dfb4bc 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -7636,5 +7636,5 @@ void l2cap_exit(void)
 	l2cap_cleanup_sockets();
 }
 
-module_param(disable_ertm, bool, 0644);
+module_param(disable_ertm, bool, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(disable_ertm, "Disable enhanced retransmission mode");
-- 
2.9.2

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

* Re: [PATCH 1088/1285] Replace numeric parameter like 0444 with macro
  2016-08-02 12:15 [PATCH 1088/1285] Replace numeric parameter like 0444 with macro Baole Ni
@ 2016-08-02 13:56 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2016-08-02 13:56 UTC (permalink / raw)
  To: Baole Ni
  Cc: Gustavo F. Padovan, Johan Hedberg, David S. Miller, jiangshanlai,
	m.chehab, Greg Kroah-Hartman, Marek Szyprowski, kyungmin.park,
	k.kozlowski, open list:BLUETOOTH DRIVERS, Network Development,
	open list, chuansheng.liu, mhocko, koct9i, Andrea Arcangeli,
	aryabinin

Hi Baole,

> 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>
> ---
> net/bluetooth/l2cap_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index eb4f5f2..1dfb4bc 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -7636,5 +7636,5 @@ void l2cap_exit(void)
> 	l2cap_cleanup_sockets();
> }
> 
> -module_param(disable_ertm, bool, 0644);
> +module_param(disable_ertm, bool, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
> MODULE_PARM_DESC(disable_ertm, "Disable enhanced retransmission mode");

I am not taking any of these patches for the Bluetooth subsystem or its drivers. They are pretty much pointless to me and do not improve readability. I think they actually decrease readability. Every Unix/Linux developers knowns what 0644 (and all its magic cousins) mean.

The only way I would accept any patches to change this is if they would introduce module_param_rw / module_param_ro or something alike. Since I am pretty sure the majority is 644 and 444 here anyway.

Regards

Marcel

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-02 12:15 [PATCH 1088/1285] Replace numeric parameter like 0444 with macro Baole Ni
2016-08-02 13:56 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).