From patchwork Mon Jan 26 06:26:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 5706841 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 948619F333 for ; Mon, 26 Jan 2015 06:35:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B8F6120148 for ; Mon, 26 Jan 2015 06:35:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA3B320125 for ; Mon, 26 Jan 2015 06:35:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753111AbbAZGeq (ORCPT ); Mon, 26 Jan 2015 01:34:46 -0500 Received: from www.osadl.org ([62.245.132.105]:45547 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751591AbbAZGeo (ORCPT ); Mon, 26 Jan 2015 01:34:44 -0500 Received: from debian.hofr.at (92-243-35-153.adsl.nanet.at [92.243.35.153] (may be forged)) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id t0Q6YKkC023496; Mon, 26 Jan 2015 07:34:21 +0100 From: Nicholas Mc Guire To: Kalle Valo Cc: Eliad Peller , Arik Nemtsov , Kobi L , "John W. Linville" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH RFC] wlcore: match wait_for_completion_timeout return type Date: Mon, 26 Jan 2015 07:26:12 +0100 Message-Id: <1422253572-19396-1-git-send-email-der.herr@hofr.at> X-Mailer: git-send-email 1.7.10.4 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;