Skip to contentSkip to conversation

staging: gdm72xx: wm_ioctl.h: fixed a macro coding style

PATCH In review Kumar Amit Mehta 3 participants 5 messages Nov 2, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: gdm72xx: wm_ioctl.h: fixed a macro coding style

fix for macro coding style.

---
 drivers/staging/gdm72xx/wm_ioctl.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/gdm72xx/wm_ioctl.h +1 -1
index 9f46e06..4ceecc4 100644
@@ -91,7 +91,7 @@ struct wm_req_s {
 };
 
 #ifndef ifr_name
-#define ifr_name	ifr_ifrn.ifrn_name
+#define ifr_name	(ifr_ifrn.ifrn_name)
 #endif
 
 #endif
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 2 lines · Kumar Amit Mehta

fix for macro coding style.

No. The parenthesis are not needed. I assume this is a checkpatch.pl warning?

regards,
dan carpenter

#2 lore raw
Quoted 10 lines · Dan Carpenter
Quoted 2 lines · Kumar Amit Mehta

fix for macro coding style.

No. The parenthesis are not needed. I assume this is a checkpatch.pl warning?

regards,
dan carpenter

Running checkpatch.pl on this file (wm_ioctl.h) returns error.

Thanks,
Amit

#3 lore raw
Quoted 5 lines · Kumar amit mehta
Quoted 4 lines · Dan Carpenter
Quoted 2 lines · Kumar Amit Mehta

fix for macro coding style.

Quoted 8 lines
Quoted 6 lines

No. The parenthesis are not needed. I assume this is a checkpatch.pl warning?

regards,
dan carpenter

Running checkpatch.pl on this file (wm_ioctl.h) returns error.

I think there are patches which fix checkpatch.pl for this but they haven't been merged yet?

$ ./scripts/checkpatch.pl -f drivers/staging/gdm72xx/wm_ioctl.h
ERROR: Macros with complex values should be enclosed in parenthesis
#94: FILE: staging/gdm72xx/wm_ioctl.h:94:
+#define ifr_name       ifr_ifrn.ifrn_name

total: 1 errors, 0 warnings, 97 lines checked

regards,
dan carpenter

maintainer
#4 lore raw
Quoted 18 lines · Dan Carpenter
Quoted 5 lines · Kumar amit mehta
Quoted 4 lines · Dan Carpenter
Quoted 2 lines · Kumar Amit Mehta

fix for macro coding style.

Quoted 8 lines
Quoted 6 lines

No. The parenthesis are not needed. I assume this is a checkpatch.pl warning?

regards,
dan carpenter

Running checkpatch.pl on this file (wm_ioctl.h) returns error.

I think there are patches which fix checkpatch.pl for this but they haven't been merged yet?

Quoted 6 lines
$ ./scripts/checkpatch.pl -f drivers/staging/gdm72xx/wm_ioctl.h
ERROR: Macros with complex values should be enclosed in parenthesis
#94: FILE: staging/gdm72xx/wm_ioctl.h:94:
+#define ifr_name       ifr_ifrn.ifrn_name

total: 1 errors, 0 warnings, 97 lines checked

Maybe:

 scripts/checkpatch.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/checkpatch.pl +1 -1
index ec58d31..b3c6a00 100755
@@ -2916,7 +2916,7 @@ sub process {
 			if ($dstat ne '' &&
 			    $dstat !~ /^(?:$Ident|-?$Constant),$/ &&			# 10, // foo(),
 			    $dstat !~ /^(?:$Ident|-?$Constant);$/ &&			# foo();
-			    $dstat !~ /^[!~-]?(?:$Ident|$Constant)$/ &&		# 10 // foo() // !foo // ~foo // -foo
+			    $dstat !~ /^[!~-]?(?:$Ident|$Constant|$Lval)$/ &&		# 10 // foo() // !foo // ~foo // -foo // foo.bar[baz]->bop
 			    $dstat !~ /^'X'$/ &&					# character constants
 			    $dstat !~ /$exceptions/ &&
 			    $dstat !~ /^\.$Ident\s*=/ &&				# .foo =