Commit a2ead344 authored by Wolfram Sang's avatar Wolfram Sang Committed by Kalle Valo

wifi: zd1211rw: use 'time_left' variable with wait_for_completion_timeout()

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240603091541.8367-7-wsa+renesas@sang-engineering.com
parent a37f6947
......@@ -1698,7 +1698,7 @@ int zd_usb_ioread16v(struct zd_usb *usb, u16 *values,
int r, i, req_len, actual_req_len, try_count = 0;
struct usb_device *udev;
struct usb_req_read_regs *req = NULL;
unsigned long timeout;
unsigned long time_left;
bool retry = false;
if (count < 1) {
......@@ -1748,9 +1748,9 @@ int zd_usb_ioread16v(struct zd_usb *usb, u16 *values,
goto error;
}
timeout = wait_for_completion_timeout(&usb->intr.read_regs.completion,
msecs_to_jiffies(50));
if (!timeout) {
time_left = wait_for_completion_timeout(&usb->intr.read_regs.completion,
msecs_to_jiffies(50));
if (!time_left) {
disable_read_regs_int(usb);
dev_dbg_f(zd_usb_dev(usb), "read timed out\n");
r = -ETIMEDOUT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment