Skip to contentSkip to conversation

Replace numeric parameter like 0444 with macro

PATCH NAK Baole Ni 3 participants 3 messages Aug 2, 2016 Pcmcia

lore
Share & tools
lore
#1 lore raw
In reply to Baole Ni
Quoted 8 lines · Baole Ni

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.

This is the worst series of lkml spam I've ever received!

1. Make something like this a series in one thread, not 1285 single threads! Add a cover letter.
2. Don't write one patch per source file, one per subsystem is enough. Maybe even better: make a tree-wide patch using Coccinelle.
3. Use better subjects. I want to see the subsystem the patch is modifying.
4. Use _correct_ maintainers. WTF do I have to do with pcmcia?

Juergen

Acked-by on v1 829/1285
#2 lore raw
In reply to Baole Ni
Quoted 8 lines · Baole Ni

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.

I'm not sure how much these changes improve robustness and/or readability, but they cause no harm. For that reason, the changes in rtlwifi drivers is acked.

Larry

Quoted 18 lines
---
 drivers/pcmcia/cistpl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pcmcia/cistpl.c +1 -1
index 55ef7d1..ac6f619 100644
@@ -57,7 +57,7 @@ static const u_int exponent[] = {
 
 /* 16-bit CIS? */
 static int cis_width;
-module_param(cis_width, int, 0444);
+module_param(cis_width, int, S_IRUSR | S_IRGRP | S_IROTH);
 
 void release_cis_mem(struct pcmcia_socket *s)
 {

Baole Ni

author
#0 lore raw

PATCH 829/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.

---
 drivers/pcmcia/cistpl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pcmcia/cistpl.c +1 -1
index 55ef7d1..ac6f619 100644
@@ -57,7 +57,7 @@ static const u_int exponent[] = {
 
 /* 16-bit CIS? */
 static int cis_width;
-module_param(cis_width, int, 0444);
+module_param(cis_width, int, S_IRUSR | S_IRGRP | S_IROTH);
 
 void release_cis_mem(struct pcmcia_socket *s)
 {
Signature · 1 line
2.9.2