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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
25 matches
Mail list logo