* [PATCH] staging: most: aim-cdev: Used "==" instead of assignment
@ 2015-11-14 4:27 Anjali Menon
2015-11-14 7:08 ` Sudip Mukherjee
0 siblings, 1 reply; 2+ messages in thread
From: Anjali Menon @ 2015-11-14 4:27 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-kernel, Anjali Menon
Used double equal sign instead of equal to sign in the if condition
to remove the error detected by checkpatch.pl.
ERROR: do not use assignment in if condition
Signed-off-by: Anjali Menon <cse.anjalimenon@gmail.com>
---
drivers/staging/staging/drivers/staging/most/aim-cdev/cdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/staging/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/staging/drivers/staging/most/aim-cdev/cdev.c
index dc3fb25..da1f894 100644
--- a/drivers/staging/staging/drivers/staging/most/aim-cdev/cdev.c
+++ b/drivers/staging/staging/drivers/staging/most/aim-cdev/cdev.c
@@ -175,7 +175,7 @@ static ssize_t aim_write(struct file *filp, const char __user *buf,
return -EAGAIN;
if (wait_event_interruptible(
channel->wq,
- (mbo = most_get_mbo(channel->iface,
+ (mbo == most_get_mbo(channel->iface,
channel->channel_id,
&cdev_aim)) ||
(!channel->dev)))
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: most: aim-cdev: Used "==" instead of assignment
2015-11-14 4:27 [PATCH] staging: most: aim-cdev: Used "==" instead of assignment Anjali Menon
@ 2015-11-14 7:08 ` Sudip Mukherjee
0 siblings, 0 replies; 2+ messages in thread
From: Sudip Mukherjee @ 2015-11-14 7:08 UTC (permalink / raw)
To: Anjali Menon; +Cc: gregkh, devel, linux-kernel
On Sat, Nov 14, 2015 at 09:57:10AM +0530, Anjali Menon wrote:
> Used double equal sign instead of equal to sign in the if condition
> to remove the error detected by checkpatch.pl.
>
> ERROR: do not use assignment in if condition
>
> Signed-off-by: Anjali Menon <cse.anjalimenon@gmail.com>
> ---
> drivers/staging/staging/drivers/staging/most/aim-cdev/cdev.c | 2 +-
something wrong with your tree. This path doesnot exist.
But in any case, i think the patch is wrong. wait_event_interruptible()
is executed when most_get_mbo() returns NULL. so if you do
mbo == most_get_mbo() it will immediately come out of sleep as the
condition is true. I think here the intention was to sleep as long as
most_get_mbo() returns NULL. And when it returns a valid pointer it is
saved in mbo variable so that it can be used later in copy_from_user().
regards
sudip
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-14 7:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-14 4:27 [PATCH] staging: most: aim-cdev: Used "==" instead of assignment Anjali Menon
2015-11-14 7:08 ` Sudip Mukherjee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox