Staging: pi433: Fix the position of brace after if
authorSrishti Sharma <srishtishar@gmail.com>
Sat, 7 Oct 2017 19:57:05 +0000 (01:27 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Oct 2017 13:55:09 +0000 (15:55 +0200)
commit69af5d92da20f9e0487f33623627e5b9068dfd5c
treee27191ac4022eefdcf5c087be2d57bd75658378e
parent38b2b2e8226e5f340935bb84d50c071bc513d296
Staging: pi433: Fix the position of brace after if

Fix the position of the brace after if when it is on the next line.
Done using the following semantic patch by coccinelle.

@r1@
position p1, p2;
@@

if(...)@p1 {@p2
...
}

@script: python r2@
p1 << r1.p1;
p2 << r1.p2;
@@

l1 = int (p1[0].line)
l2 = int (p2[0].line)
c1 = int (p1[0].column_end)
c2 = int (p2[0].column)

if l1 == l2 and c1+1 == c2:
        cocci.include_match(False)

@r3@
position r1.p1, r1.p2;
@@

if(...
- )@p1
-{@p2
+) {
...
}

Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/pi433/pi433_if.c