Skip to contentSkip to conversation

staging: rtl8712: fix Missing a blank line after declarations

PATCH In review Lin Kassem 2 participants 3 messages Jan 21, 2015

Subsystems (2)
lore
Share & tools
lore

Lin Kassem

author
#0 lore raw

PATCH 1/1 staging: rtl8712: fix Missing a blank line after declarations

This patch fixes the following checkpatch.pl warning:
fix Missing a blank line after declarations

---
 drivers/staging/rtl8712/drv_types.h |    2 ++
 1 file changed, 2 insertions(+)
drivers/staging/rtl8712/drv_types.h +2 -0
index 3d0a98b..9bc300c 100644
@@ -129,6 +129,7 @@ struct dvobj_priv {
 	struct _adapter *padapter;
 	u32 nr_endpoint;
 	u8   ishighspeed;
+
 	uint(*inirp_init)(struct _adapter *adapter);
 	uint(*inirp_deinit)(struct _adapter *adapter);
 	struct usb_device *pusbdev;
@@ -166,6 +167,7 @@ struct _adapter {
 	 pid_t evtThread;
 	struct task_struct *xmitThread;
 	pid_t recvThread;
+
 	uint(*dvobj_init)(struct _adapter *adapter);
 	void (*dvobj_deinit)(struct _adapter *adapter);
 	struct net_device *pnetdev;
Signature · 1 line
1.7.9.5
maintainer
#1 lore raw
Quoted 2 lines · Lin Kassem

This patch fixes the following checkpatch.pl warning:
fix Missing a blank line after declarations

False positives. Unnecessary changes.

drivers/staging/rtl8712/drv_types.h

Quoted 1 line
drivers/staging/rtl8712/drv_types.h +0 -0

[]

Quoted 16 lines
drivers/staging/rtl8712/drv_types.h +2 -0
@@ -129,6 +129,7 @@ struct dvobj_priv {
 	struct _adapter *padapter;
 	u32 nr_endpoint;
 	u8   ishighspeed;
+
 	uint(*inirp_init)(struct _adapter *adapter);
 	uint(*inirp_deinit)(struct _adapter *adapter);
 	struct usb_device *pusbdev;
@@ -166,6 +167,7 @@ struct _adapter {
 	 pid_t evtThread;
 	struct task_struct *xmitThread;
 	pid_t recvThread;
+
 	uint(*dvobj_init)(struct _adapter *adapter);
 	void (*dvobj_deinit)(struct _adapter *adapter);
 	struct net_device *pnetdev;
maintainer
#2 lore raw

PATCH 1/1 checkpatch: Add types for other OS typedefs

bsd and sysv use different typedefs for unsigned types.

These are in types.h but not in checkpatch, so add them to checkpatch's ability to know types.

This can avoid false positives for code like:

void foo(void)

{
	int x;
	uint y;

	[...];
}

where checkpatch incorrectly emits a warning for
"missing a blank line after declarations".

---
 scripts/checkpatch.pl | 8 ++++++++
 1 file changed, 8 insertions(+)
scripts/checkpatch.pl +8 -0
index 41223c9..fadb47d 100755
@@ -339,6 +339,11 @@ our $UTF8	= qr{
 	| $NON_ASCII_UTF8
 }x;
 
+our $typeOtherOSTypedefs = qr{(?x:
+	u_(?:char|short|int|long) |          # bsd
+	u(?:nchar|short|int|long)            # sysv
+)};
+
 our $typeTypedefs = qr{(?x:
 	(?:__)?(?:u|s|be|le)(?:8|16|32|64)|
 	atomic_t
@@ -475,6 +480,7 @@ sub build_types {
 			(?:$Modifier\s+|const\s+)*
 			(?:
 				(?:typeof|__typeof__)\s*\([^\)]*\)|
+				(?:$typeOtherOSTypedefs\b)|
 				(?:$typeTypedefs\b)|
 				(?:${all}\b)
 			)
@@ -492,6 +498,7 @@ sub build_types {
 			(?:
 				(?:typeof|__typeof__)\s*\([^\)]*\)|
 				(?:$typeTypedefs\b)|
+				(?:$typeOtherOSTypedefs\b)|
 				(?:${allWithAttr}\b)
 			)
 			(?:\s+$Modifier|\s+const)*
@@ -3152,6 +3159,7 @@ sub process {
 		    $line !~ /\btypedef\s+$Type\s*\(\s*\*?$Ident\s*\)\s*\(/ &&
 		    $line !~ /\btypedef\s+$Type\s+$Ident\s*\(/ &&
 		    $line !~ /\b$typeTypedefs\b/ &&
+		    $line !~ /\b$typeOtherOSTypedefs\b/ &&
 		    $line !~ /\b__bitwise(?:__|)\b/) {
 			WARN("NEW_TYPEDEFS",
 			     "do not add new typedefs\n" . $herecurr);