[PATCH v3] coccinelle: add style check for assignment in if

2016-02-22 Thread Kris Borer
Add a semantic patch for fixing some cases of checkpatch.pl error: ERROR: do not use assignment in if condition Signed-off-by: Kris Borer --- changes since v2 - added comment warning that changes may not work well with ifdefs scripts/coccinelle/style/assignment_in_if.cocci | 132

Re: coccinelle: add style check for assignment in if

2016-02-10 Thread Kris Borer
On Wed, Feb 10, 2016 at 4:00 AM, SF Markus Elfring wrote: > Kris Borer suggested a SmPL script which can generate (only) patches > so far by the usual application of the Coccinelle software. > I assume that this approach was limited just because Julia Lawall > indicated that this f

[PATCH v2] coccinelle: add style check for assignment in if

2016-02-08 Thread Kris Borer
Add a semantic patch for fixing some cases of checkpatch.pl error: ERROR: do not use assignment in if condition Signed-off-by: Kris Borer --- scripts/coccinelle/style/assignment_in_if.cocci | 128 1 file changed, 128 insertions(+) create mode 100644 scripts/coccinelle

[PATCH v2] coccinelle: add style check for assignment in if

2015-11-17 Thread Kris Borer
Add a semantic patch for fixing some cases of checkpatch.pl error: ERROR: do not use assignment in if condition Signed-off-by: Kris Borer --- scripts/coccinelle/style/assignment_in_if.cocci | 128 1 file changed, 128 insertions(+) create mode 100644 scripts/coccinelle

[PATCH] rewrite isd200_init_info for readability

2015-08-28 Thread Kris Borer
Previously, Coccinelle would issue the following false positive: isd200.c:1478:14-18: ERROR: reference preceded by free on line 1472 This change rewrites the isd200_init_info function to have more explicit execution pathways to make it easier for scripts and humans to parse. Signed-off-by: Kris

[PATCH v2] usb: message: remove redundant declaration

2015-08-25 Thread Kris Borer
Fix the Sparse warning: message.c:1390:21: warning: symbol 'i' shadows an earlier one message.c:1294:13: originally declared here Signed-off-by: Kris Borer --- drivers/usb/core/message.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/core/message.c b/driver

[PATCH] usb: message: remove redundant declaration

2015-08-24 Thread Kris Borer
Fix the Sparse warning: message.c:1390:21: warning: symbol 'i' shadows an earlier one message.c:1294:13: originally declared here Signed-off-by: Kris Borer --- drivers/usb/core/message.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/core/message.c b/drivers/usb/core

[PATCH v2] coccinelle: add style check for assignment in if

2015-08-22 Thread Kris Borer
Add a semantic patch for fixing some cases of checkpatch.pl error: ERROR: do not use assignment in if condition Signed-off-by: Kris Borer Acked-by: Julia Lawall --- scripts/coccinelle/style/assignment_in_if.cocci | 128 1 file changed, 128 insertions(+) create mode

[PATCH] usb: hub: remove redundant declarations

2015-08-21 Thread Kris Borer
Fix two occurrences of the Sparse warning: warning: symbol XXX shadows an earlier one Signed-off-by: Kris Borer --- drivers/usb/core/hub.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 431839b..a0db6a4 100644 --- a

[RFC v3] coccinelle: add style check for assignment in if

2015-08-20 Thread Kris Borer
Add a semantic patch for fixing some cases of checkpatch.pl error: ERROR: do not use assignment in if condition Signed-off-by: Kris Borer --- Differences from Julia's version: - removed some disjuction variations that led to improper transformations - fixed header format - added and up

Re: [PATCH] coccinelle: add style check for assignment in if

2015-08-15 Thread Kris Borer
I apologize, I misunderstood your email. It is the same as RFC v2. On Sat, Aug 15, 2015 at 1:30 PM, Julia Lawall wrote: > > > On Sat, 15 Aug 2015, Kris Borer wrote: > >> Add a semantic patch for fixing some cases of checkpatch.pl error: >> >> ERROR: do not

[PATCH] coccinelle: add style check for assignment in if

2015-08-15 Thread Kris Borer
Add a semantic patch for fixing some cases of checkpatch.pl error: ERROR: do not use assignment in if condition Reviewed-by: Julia Lawall Signed-off-by: Kris Borer --- scripts/coccinelle/style/assignment_in_if.cocci | 92 + 1 file changed, 92 insertions(+) create mode

[RFC v2] coccinelle: add style check for assignment in if

2015-08-14 Thread Kris Borer
Add a semantic patch for fixing some cases of checkpatch.pl error: ERROR: do not use assignment in if condition Signed-off-by: Kris Borer --- scripts/coccinelle/style/assignment_in_if.cocci | 92 + 1 file changed, 92 insertions(+) create mode 100644 scripts/coccinelle

[RFC] coccinelle: add style check for assignment in if

2015-08-12 Thread Kris Borer
Add a semantic patch for fixing some cases of checkpatch.pl error: ERROR: do not use assignment in if condition Signed-off-by: Kris Borer --- scripts/coccinelle/style/assignment_in_if.cocci | 82 + 1 file changed, 82 insertions(+) create mode 100644 scripts/coccinelle

[PATCH] usb: hub: remove assignment from if condition

2015-08-11 Thread Kris Borer
E3 ) S1 else S2 // Signed-off-by: Kris Borer --- drivers/usb/core/hub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index a0b22be..78bd0d6 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -671,8 +671,8 @@ resu

[PATCH] usb: endpoint: convert spaces to tabs

2015-08-10 Thread Kris Borer
Fix one occurrence of the checkpatch error: ERROR: code indent should use tabs where possible Signed-off-by: Kris Borer --- drivers/usb/core/endpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c index 39a2402

[PATCH] usb: otg_whitelist: remove whitespace

2015-08-09 Thread Kris Borer
Fix one occurrence of the checkpatch error: ERROR: space prohibited before open square bracket '[' Signed-off-by: Kris Borer --- drivers/usb/core/otg_whitelist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/otg_whitelist.h b/driver

[PATCH] usb: devio: fix spacing

2015-08-07 Thread Kris Borer
Fix two occurrences of the checkpatch.pl error: ERROR: space prohibited before that ',' (ctx:WxW) Fix one occurrence of the checkpatch error: ERROR: space required before the open parenthesis '(' Signed-off-by: Kris Borer --- drivers/usb/core/devio.c | 4 ++-- 1 file c

[PATCH v2] usb: devio: remove assignment from if condition

2015-08-04 Thread Kris Borer
c; binary operator b; @@ + i = E; if ( - (i = E) + i b c ) S // Signed-off-by: Kris Borer --- drivers/usb/core/devio.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 986abde..ed6d1d5 100644

[PATCH] usb: devio: remove assignment from if condition

2015-08-03 Thread Kris Borer
c; binary operator b; @@ + i = E; if ( - (i = E) + i b c ) S // Signed-off-by: Kris Borer --- drivers/usb/core/devio.c | 78 +++- 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c

[PATCH v3] usb: move assignment out of if condition

2015-07-14 Thread Kris Borer
E1, E2; constant c; @@ + if( E1->i ) { + i2 = E2; + if (i2 < c) { - if( E1->i && (i2 = E2) < c ) { ... - } + } + } // Signed-off-by: Kris Borer --- drivers/usb/core/hcd.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --gi

[PATCH v2] usb: move assignment out of if condition

2015-07-02 Thread Kris Borer
Fix four occurrences of checkpatch.pl error: ERROR: do not use assignment in if condition Signed-off-by: Kris Borer --- drivers/usb/core/hcd.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index be5b207

[PATCH] usb: move assignment out of if condition

2015-06-30 Thread Kris Borer
Fix four occurrences of the checkpatch.pl error: ERROR: do not use assignment in if condition Signed-off-by: Kris Borer --- drivers/usb/core/hcd.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index be5b207

[PATCH] usb: fix coding style issue

2015-06-16 Thread Kris Borer
Fixed coding style issue: newline after declaration Signed-off-by: Kris Borer --- drivers/usb/core/driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 818369a..6b5063e 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb

[PATCH] usb: buffer: fix 2 coding style issues

2015-06-01 Thread Kris Borer
Fixed two coding style issues: sizeof parens and newline after declaration Signed-off-by: Kris Borer --- drivers/usb/core/buffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c index 506b969..89f2e77 100644 --- a