mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
media: si2157: ensure wait_status is initialized
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>
This commit is contained in:
parent
408d024442
commit
b7ba9f3480
1 changed files with 4 additions and 1 deletions
|
@ -327,7 +327,7 @@ static int si2157_tune_wait(struct i2c_client *client, u8 is_digital)
|
||||||
/* wait tuner command complete */
|
/* wait tuner command complete */
|
||||||
start_time = jiffies;
|
start_time = jiffies;
|
||||||
timeout = start_time + msecs_to_jiffies(TUN_TIMEOUT);
|
timeout = start_time + msecs_to_jiffies(TUN_TIMEOUT);
|
||||||
while (!time_after(jiffies, timeout)) {
|
while (1) {
|
||||||
ret = i2c_master_recv(client, &wait_status,
|
ret = i2c_master_recv(client, &wait_status,
|
||||||
sizeof(wait_status));
|
sizeof(wait_status));
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
@ -337,6 +337,9 @@ static int si2157_tune_wait(struct i2c_client *client, u8 is_digital)
|
||||||
goto err_mutex_unlock;
|
goto err_mutex_unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (time_after(jiffies, timeout))
|
||||||
|
break;
|
||||||
|
|
||||||
/* tuner done? */
|
/* tuner done? */
|
||||||
if ((wait_status & 0x81) == 0x81)
|
if ((wait_status & 0x81) == 0x81)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue