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; >> expression F; >> statement S; >> @@ >> >> -if((E =

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

2017-09-15 Thread Julia Lawall
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; > expression F; > statement S; > @@ > > -if((E = F)) > +E = F The line above would need to end in a ; This ends up w

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(E) > S > > Signed-off-by: Srishti Shar

[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/dri