All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8712: fix Missing a blank line after declarations
@ 2015-01-21 14:41 Lin Kassem
  2015-01-21 17:04 ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Lin Kassem @ 2015-01-21 14:41 UTC (permalink / raw)
  To: devel
  Cc: Larry.Finger, florian.c.chilhabel, gregkh, gulsah.1004, shack,
	thomas, linux-kernel

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

Signed-off-by: Lin Kassem <linsara1@gmail.com>
---
 drivers/staging/rtl8712/drv_types.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/rtl8712/drv_types.h b/drivers/staging/rtl8712/drv_types.h
index 3d0a98b..9bc300c 100644
--- a/drivers/staging/rtl8712/drv_types.h
+++ b/drivers/staging/rtl8712/drv_types.h
@@ -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;
-- 
1.7.9.5


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

* Re: [PATCH] staging: rtl8712: fix Missing a blank line after declarations
  2015-01-21 14:41 [PATCH] staging: rtl8712: fix Missing a blank line after declarations Lin Kassem
@ 2015-01-21 17:04 ` Joe Perches
  2015-01-21 17:23   ` [PATCH] checkpatch: Add types for other OS typedefs Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2015-01-21 17:04 UTC (permalink / raw)
  To: Lin Kassem
  Cc: devel, Larry.Finger, florian.c.chilhabel, gregkh, gulsah.1004,
	shack, thomas, linux-kernel

On Wed, 2015-01-21 at 16:41 +0200, Lin Kassem wrote:
> This patch fixes the following checkpatch.pl warning:
> fix Missing a blank line after declarations

False positives.  Unnecessary changes.

> diff --git a/drivers/staging/rtl8712/drv_types.h b/drivers/staging/rtl8712/drv_types.h
[]
> @@ -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;




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

* [PATCH] checkpatch: Add types for other OS typedefs
  2015-01-21 17:04 ` Joe Perches
@ 2015-01-21 17:23   ` Joe Perches
  0 siblings, 0 replies; 3+ messages in thread
From: Joe Perches @ 2015-01-21 17:23 UTC (permalink / raw)
  To: Andrew Morton
  Cc: devel, Larry.Finger, gregkh, gulsah.1004, shack, thomas, linux-kernel

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".

Signed-off-by: Joe Perches <joe@perches.com>
---
 scripts/checkpatch.pl | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 41223c9..fadb47d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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);



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

end of thread, other threads:[~2015-01-21 17:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-21 14:41 [PATCH] staging: rtl8712: fix Missing a blank line after declarations Lin Kassem
2015-01-21 17:04 ` Joe Perches
2015-01-21 17:23   ` [PATCH] checkpatch: Add types for other OS typedefs Joe Perches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.