From: Paul Bolle <pebolle@tiscali.nl>
To: Tomas Winkler <tomas.winkler@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Shuah Khan <shuah.kh@samsung.com>, linux-kernel@vger.kernel.org
Subject: mei: me: unneeded tests in mei_me_hw_ready_wait()
Date: Fri, 27 Dec 2013 21:44:32 +0100 [thread overview]
Message-ID: <1388177072.9086.33.camel@x220> (raw)
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
reply other threads:[~2013-12-27 20:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1388177072.9086.33.camel@x220 \
--to=pebolle@tiscali.nl \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shuah.kh@samsung.com \
--cc=tomas.winkler@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®