[PATCH v2] libata: fixup wait_for_completion_timeout return handling

From: Nicholas Mc Guire
Date: Tue Feb 10 2015 - 11:27:21 EST

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 <hofrat@xxxxxxxxx>

v2: rename of variable to make the timeout condition clear
as requested by Tejun Heo <tj@xxxxxxxxxx>

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,
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)

- 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)


- if (!rc) {
+ if (time_left == 0) {
spin_lock_irqsave(ap->lock, flags);

/* We're racing with irq here. If we lose, the

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/