[PATCH] Staging: irda: Use !x instead of NULL comparison

2017-09-15 Thread Srishti Sharma
) S | -if(E==NULL) +if(!E) S ) Signed-off-by: Srishti Sharma --- drivers/staging/irda/net/discovery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/irda/net/discovery.c b/drivers/staging/irda/net/discovery.c index 364d70a..1e54954 100644 --- a/drivers

Re: [Outreachy kernel] [PATCH v2] Staging: irda: Don't use assignment inside if statement

2017-09-15 Thread Srishti Sharma
On Sat, Sep 16, 2017 at 2:39 AM, Julia Lawall wrote: > > > On Sat, 16 Sep 2017, Srishti Sharma wrote: > >> On Sat, Sep 16, 2017 at 1:30 AM, Julia Lawall wrote: >> > >> > >> > On Sat, 16 Sep 2017, Srishti Sharma wrote: >> > >> >&g

Re: [Outreachy kernel] [PATCH v2] Staging: irda: Don't use assignment inside if statement

2017-09-15 Thread Srishti Sharma
On Sat, Sep 16, 2017 at 1:30 AM, Julia Lawall wrote: > > > On Sat, 16 Sep 2017, Srishti Sharma wrote: > >> Write assignment statement outside the if statement. Done using >> the following semantic patch by coccinelle. >> >> @@ >> identifier E; >>

[PATCH 2/2] Staging: irda: Remove parentheses on the right of assignment

2017-09-15 Thread Srishti Sharma
Parentheses are not needed on the right hand side of assignment statement in most cases. Done using the following semantic patch by coccinelle. @@ identifier E,F,G,f; expression e,r; @@ ( E = (G == F); | E = (e == r); | E = -( ... -) ; ) Signed-off-by: Srishti Sharma --- drivers/staging/irda

[PATCH 1/2] Staging: irda: Don't use assignment inside if statement

2017-09-15 Thread Srishti Sharma
Write assignment statement outside of the if statement. Done using the following semantic patch by coccinelle. @@ identifier E; expression F; statement S; @@ -if((E = F)) +E = F; +if(E) S Signed-off-by: Srishti Sharma --- drivers/staging/irda/drivers/irda-usb.c | 4 ++-- drivers/staging

[PATCH 0/2] Assign outside if

2017-09-15 Thread Srishti Sharma
This patch series intends to remove the assignment statements inside the if statement, and eliminates the cases of parentheses around the right hand side of assignment generated as a result of the same. Srishti Sharma (2): Staging: irda: Don't use assignment inside if statement St

[PATCH v2] Staging: irda: Don't use assignment inside if statement

2017-09-15 Thread Srishti Sharma
Write assignment statement outside the if statement. Done using the following semantic patch by coccinelle. @@ identifier E; expression F; statement S; @@ -if((E = F)) +E = F; +if(E) S Signed-off-by: Srishti Sharma --- Changes in v2: -Semicolon was missing in one of the statements of the

Re: [Outreachy kernel] [PATCH] Staging: irda: Don't use assignment inside if statement

2017-09-15 Thread Srishti Sharma
On Sat, Sep 16, 2017 at 1:08 AM, Julia Lawall wrote: > > > On Sat, 16 Sep 2017, Srishti Sharma wrote: > >> Write assignment statement outside the if statement. Done using >> the following semantic patch by coccinelle. >> >> @@ >> identifier E; >>

Re: [PATCH] Staging: irda: Don't use assignment inside if statement

2017-09-15 Thread Srishti Sharma
On Sat, Sep 16, 2017 at 1:03 AM, Srishti Sharma wrote: > Write assignment statement outside the if statement. Done using > the following semantic patch by coccinelle. > > @@ > identifier E; > expression F; > statement S; > @@ > > -if((E = F)) > +E = F > +if

[PATCH] Staging: irda: Don't use assignment inside if statement

2017-09-15 Thread Srishti Sharma
Write assignment statement outside the if statement. Done using the following semantic patch by coccinelle. @@ identifier E; expression F; statement S; @@ -if((E = F)) +E = F +if(E) S Signed-off-by: Srishti Sharma --- drivers/staging/irda/drivers/irda-usb.c | 4 ++-- drivers/staging/irda