[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1388177072.9086.33.camel@x220>
Date: Fri, 27 Dec 2013 21:44:32 +0100
From: Paul Bolle <pebolle@...cali.nl>
To: Tomas Winkler <tomas.winkler@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Shuah Khan <shuah.kh@...sung.com>, linux-kernel@...r.kernel.org
Subject: mei: me: unneeded tests in mei_me_hw_ready_wait()
0) mei_me_hw_ready_wait() currently reads:
int err;
[...]
err = wait_event_interruptible_timeout(dev->wait_hw_ready,
dev->recvd_hw_ready,
mei_secs_to_jiffies(MEI_INTEROP_TIMEOUT));
[...]
if (!err && !dev->recvd_hw_ready) {
if (!err)
err = -ETIMEDOUT;
dev_err(&dev->pdev->dev,
"wait hw ready failed. status = %d\n", err);
return err;
}
[...]
1) The second check for !err was introduced in commit dab9bf41b23f
("mei: me: fix waiting for hw ready"). It's not needed. And the check
for !dev->recvd_hw_ready seems unneeded too.
2) So perhaps something like this was intended:
[...]
if (err <= 0) {
if (!err)
err = -ETIMEDOUT;
dev_err(&dev->pdev->dev,
"wait hw ready failed. status = %d\n", err);
return err;
}
[...]
But that's just a guess. For example: it is unclear whether that would
handle wait_event_interruptible_timeout() returning -ERESTARTSYS
correctly. So I'm unable to draft and submit a patch here.
Paul Bolle
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists