[OPW,kernel,v3,5/6] Staging: lustre: Removal of assignment in if condition in conrpc.c
diff mbox

Message ID a4e505db521c3db4b41e2079732a7f0c3d068f0c.1382019886.git.rashika.kheria@gmail.com
State Accepted
Headers show

Commit Message

Rashika Oct. 17, 2013, 2:28 p.m. UTC
This patch fixes the following checkpatch.pl error in conrpc.c-
ERROR: do not use assignment in if condition

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
---
 drivers/staging/lustre/lnet/selftest/conrpc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

gregkh@linuxfoundation.org Oct. 17, 2013, 4:06 p.m. UTC | #1
On Thu, Oct 17, 2013 at 07:58:45PM +0530, Rashika Kheria wrote:
> This patch fixes the following checkpatch.pl error in conrpc.c-
> ERROR: do not use assignment in if condition
> 
> Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
> ---
>  drivers/staging/lustre/lnet/selftest/conrpc.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
> index 88a4956..9a52f25 100644
> --- a/drivers/staging/lustre/lnet/selftest/conrpc.c
> +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
> @@ -531,7 +531,9 @@ lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans,
>  		if (readent == NULL)
>  			continue;
>  
> -		if ((error = readent(trans->tas_opc, msg, ent)) != 0)
> +		error = readent(trans->tas_opc, msg, ent);
> +
> +		if (error != 0)
>  			return error;

I'm not going to reject this, but in the future, you don't need to add
the extra newline after the function call and before the if() statement.

Anyway, nice job on the series, I'll go apply them in a bit.

thanks,

greg k-h
gregkh@linuxfoundation.org Oct. 17, 2013, 4:08 p.m. UTC | #2
On Thu, Oct 17, 2013 at 07:58:45PM +0530, Rashika Kheria wrote:
> This patch fixes the following checkpatch.pl error in conrpc.c-
> ERROR: do not use assignment in if condition
> 
> Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>

Applied, thanks.

greg k-h
Rashika Oct. 17, 2013, 4:40 p.m. UTC | #3
On Thu, Oct 17, 2013 at 9:36 PM, Greg KH <gregkh@linuxfoundation.org> wrote:

> On Thu, Oct 17, 2013 at 07:58:45PM +0530, Rashika Kheria wrote:
> > This patch fixes the following checkpatch.pl error in conrpc.c-
> > ERROR: do not use assignment in if condition
> >
> > Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
> > ---
> >  drivers/staging/lustre/lnet/selftest/conrpc.c |    4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c
> b/drivers/staging/lustre/lnet/selftest/conrpc.c
> > index 88a4956..9a52f25 100644
> > --- a/drivers/staging/lustre/lnet/selftest/conrpc.c
> > +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
> > @@ -531,7 +531,9 @@ lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t
> *trans,
> >               if (readent == NULL)
> >                       continue;
> >
> > -             if ((error = readent(trans->tas_opc, msg, ent)) != 0)
> > +             error = readent(trans->tas_opc, msg, ent);
> > +
> > +             if (error != 0)
> >                       return error;
>
> I'm not going to reject this, but in the future, you don't need to add
> the extra newline after the function call and before the if() statement.
>
> Anyway, nice job on the series, I'll go apply them in a bit.
>
> thanks,
>
> greg k-h
>

Thanks, I will keep that in mind.

Patch
diff mbox

diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
index 88a4956..9a52f25 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
@@ -531,7 +531,9 @@  lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans,
 		if (readent == NULL)
 			continue;
 
-		if ((error = readent(trans->tas_opc, msg, ent)) != 0)
+		error = readent(trans->tas_opc, msg, ent);
+
+		if (error != 0)
 			return error;
 	}