From patchwork Tue Feb 10 16:22:37 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: 438455 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 6D8E2140082 for ; Wed, 11 Feb 2015 03:27:17 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750934AbbBJQ1Q (ORCPT ); Tue, 10 Feb 2015 11:27:16 -0500 Received: from www.osadl.org ([62.245.132.105]:53016 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750729AbbBJQ1P (ORCPT ); Tue, 10 Feb 2015 11:27:15 -0500 Received: from debian.hofrr.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 t1AGQfwT017366; Tue, 10 Feb 2015 17:26:45 +0100 From: Nicholas Mc Guire To: Tejun Heo Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH v2] libata: fixup wait_for_completion_timeout return handling Date: Tue, 10 Feb 2015 11:22:37 -0500 Message-Id: <1423585357-2580-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 1.7.10.4 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, KHOP_SC_TOP_CIDR8, RDNS_DYNAMIC autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on www.osadl.org Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org return type of wait_for_completion_timeout is unsigned long not int. The return variable is renamed to reflect its use and the type adjusted to unsigned long. Signed-off-by: Nicholas Mc Guire --- v2: rename of variable to make the timeout condition clear as requested by Tejun Heo Patch was only compile tested with x86_64_defconfig (implies CONFIG_ATA=y) Patch is against 3.19.0 (localversion-next is -next-20150210) drivers/ata/libata-core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 4c35f08..0d9ef27 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -1563,7 +1563,7 @@ unsigned ata_exec_internal_sg(struct ata_device *dev, DECLARE_COMPLETION_ONSTACK(wait); unsigned long flags; unsigned int err_mask; - int rc; + unsigned long time_left; spin_lock_irqsave(ap->lock, flags); @@ -1644,14 +1644,15 @@ unsigned ata_exec_internal_sg(struct ata_device *dev, if (ap->ops->error_handler) ata_eh_release(ap); - rc = wait_for_completion_timeout(&wait, msecs_to_jiffies(timeout)); + time_left = wait_for_completion_timeout(&wait, + msecs_to_jiffies(timeout)); if (ap->ops->error_handler) ata_eh_acquire(ap); ata_sff_flush_pio_task(ap); - if (!rc) { + if (time_left == 0) { spin_lock_irqsave(ap->lock, flags); /* We're racing with irq here. If we lose, the