smatch reports wait_status is uninitialized, because smatch cannot assume
the loop body is ever executed.
Clarify the code so that wait_status is retrieved at least once.
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
/* wait tuner command complete */
start_time = jiffies;
timeout = start_time + msecs_to_jiffies(TUN_TIMEOUT);
- while (!time_after(jiffies, timeout)) {
+ while (1) {
ret = i2c_master_recv(client, &wait_status,
sizeof(wait_status));
if (ret < 0) {
goto err_mutex_unlock;
}
+ if (time_after(jiffies, timeout))
+ break;
+
/* tuner done? */
if ((wait_status & 0x81) == 0x81)
break;