LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Nicholas Mc Guire <der.herr@hofr.at>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: Eliad Peller <eliad@wizery.com>, Arik Nemtsov <arik@wizery.com>,
	Kobi L <kobi.lev100@gmail.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Nicholas Mc Guire <der.herr@hofr.at>
Subject: [PATCH RFC] wlcore: match wait_for_completion_timeout return type
Date: Mon, 26 Jan 2015 07:26:12 +0100	[thread overview]
Message-ID: <1422253572-19396-1-git-send-email-der.herr@hofr.at> (raw)

return type of wait_for_completion_timeout is unsigned long not int, this
patch adds an appropriate return type and assignment.

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
---

The return type of wait_for_completion_timeout is unsigned long not
int. This patch adds a separate variable of proper type for handling
of the wait_for_completion_timeout.

The alternative would be to fold it into the if condition and not use
a separate variable like so:

	if (!pending) {
		if (!wait_for_completion_timeout( &compl,
				msecs_to_jiffies(WL1271_WAKEUP_TIMEOUT)) {
			wl1271_error("ELP wakeup timeout!");		    
			wl12xx_queue_recovery_work(wl);
			ret = -ETIMEDOUT;
			goto err;
		}
	}

not sure if this or the below solution is preferable.

Patch was compile tested only for x86_64_defconfig + CONFIG_WL_TI=y, 
CONFIG_WLCORE=m

Patch is against 3.19.0-rc5 -next-20150123

 drivers/net/wireless/ti/wlcore/ps.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/ps.c b/drivers/net/wireless/ti/wlcore/ps.c
index 4cd316e..d5f918a4 100644
--- a/drivers/net/wireless/ti/wlcore/ps.c
+++ b/drivers/net/wireless/ti/wlcore/ps.c
@@ -109,6 +109,7 @@ int wl1271_ps_elp_wakeup(struct wl1271 *wl)
 	DECLARE_COMPLETION_ONSTACK(compl);
 	unsigned long flags;
 	int ret;
+	unsigned long timeout;
 	unsigned long start_time = jiffies;
 	bool pending = false;
 
@@ -145,9 +146,9 @@ int wl1271_ps_elp_wakeup(struct wl1271 *wl)
 	}
 
 	if (!pending) {
-		ret = wait_for_completion_timeout(
+		timeout = wait_for_completion_timeout(
 			&compl, msecs_to_jiffies(WL1271_WAKEUP_TIMEOUT));
-		if (ret == 0) {
+		if (timeout == 0) {
 			wl1271_error("ELP wakeup timeout!");
 			wl12xx_queue_recovery_work(wl);
 			ret = -ETIMEDOUT;
-- 
1.7.10.4


                 reply	other threads:[~2015-01-26  6:34 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=1422253572-19396-1-git-send-email-der.herr@hofr.at \
    --to=der.herr@hofr.at \
    --cc=arik@wizery.com \
    --cc=eliad@wizery.com \
    --cc=kobi.lev100@gmail.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [PATCH RFC] wlcore: match wait_for_completion_timeout return type' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).