aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2024-05-05 15:15:21 +0200
committerWolfram Sang <wsa+renesas@sang-engineering.com>2024-05-05 16:32:31 +0200
commit50b74e504c235b65dc70eb00394f5ecd4db60e68 (patch)
tree2f8c0f88b7b27e7f0ad3967e3575179ba190f887
parent50d45d4e4533c5785172cb17bdf99555956a8c53 (diff)
downloadlinux-i2c/time_left.tar.gz
xen: xenbus: xenbus_probe_frontend: use 'time_left' variable with wait_for_completion_timeout()i2c/time_left
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
-rw-r--r--drivers/xen/xenbus/xenbus_probe_frontend.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c
index 658942caa6ec7..8d0ad528702d8 100644
--- a/drivers/xen/xenbus/xenbus_probe_frontend.c
+++ b/drivers/xen/xenbus/xenbus_probe_frontend.c
@@ -128,7 +128,7 @@ static int xenbus_frontend_dev_probe(struct device *dev)
static void xenbus_frontend_dev_shutdown(struct device *_dev)
{
struct xenbus_device *dev = to_xenbus_device(_dev);
- unsigned long timeout = 5*HZ;
+ unsigned long time_left = 5*HZ;
DPRINTK("%s", dev->nodename);
@@ -139,8 +139,8 @@ static void xenbus_frontend_dev_shutdown(struct device *_dev)
goto out;
}
xenbus_switch_state(dev, XenbusStateClosing);
- timeout = wait_for_completion_timeout(&dev->down, timeout);
- if (!timeout)
+ time_left = wait_for_completion_timeout(&dev->down, time_left);
+ if (!time_left)
pr_info("%s: %s timeout closing device\n",
__func__, dev->nodename);
out: