Re: [PATCH 2/7] staging: most: cdev.c: move assignment out of if condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 06, 2015 at 10:20:12AM +0900, Chaehyun Lim wrote:
> Move assignment out of if condition found by checkpatch.pl.
> ERROR: do not use assignment in if condition
> 
> Signed-off-by: Chaehyun Lim <chaehyun.lim@xxxxxxxxx>
> ---
>  drivers/staging/most/aim-cdev/cdev.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c
> index 0cde97d..453fbc6 100644
> --- a/drivers/staging/most/aim-cdev/cdev.c
> +++ b/drivers/staging/most/aim-cdev/cdev.c
> @@ -170,11 +170,9 @@ static ssize_t aim_write(struct file *filp, const char __user *buf,
>  	if (!mbo && channel->dev) {
>  		if ((filp->f_flags & O_NONBLOCK))
>  			return -EAGAIN;
> +		mbo = most_get_mbo(channel->iface, channel->channel_id);
>  		if (wait_event_interruptible(
> -			    channel->wq,
> -			    (mbo = most_get_mbo(channel->iface,
> -						channel->channel_id)) ||
> -			    (channel->dev == NULL)))
> +			    channel->wq, mbo || (channel->dev == NULL)))

You just changed the logic here :(

Please be more careful, the original code is correct.  Please read it
again to understand why...

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux