mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 08:50:52 +07:00
media: dvb-frontends/drxk_hard.c: fix uninitialized variable warning
drxk_hard.c: In function 'hi_command.constprop': drxk_hard.c:1016:5: warning: 'wait_cmd' may be used uninitialized in this function [-Wmaybe-uninitialized] 1015 | } while ((status < 0) && (retry_count < DRXK_MAX_RETRIES) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1016 | && (wait_cmd != 0)); | ^~~~~~~~~~~~~~~~~~ The underlying cause is that the while condition is wrong. It should be: (status < 0 || wait_cmd) && (retry_count < DRXK_MAX_RETRIES) 'wait_cmd' is only valid if '!(status < 0)'. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
2311072d99
commit
c386e0797d
@ -1011,8 +1011,7 @@ static int hi_command(struct drxk_state *state, u16 cmd, u16 *p_result)
|
|||||||
retry_count += 1;
|
retry_count += 1;
|
||||||
status = read16(state, SIO_HI_RA_RAM_CMD__A,
|
status = read16(state, SIO_HI_RA_RAM_CMD__A,
|
||||||
&wait_cmd);
|
&wait_cmd);
|
||||||
} while ((status < 0) && (retry_count < DRXK_MAX_RETRIES)
|
} while ((status < 0 || wait_cmd) && (retry_count < DRXK_MAX_RETRIES));
|
||||||
&& (wait_cmd != 0));
|
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
goto error;
|
goto error;
|
||||||
status = read16(state, SIO_HI_RA_RAM_RES__A, p_result);
|
status = read16(state, SIO_HI_RA_RAM_RES__A, p_result);
|
||||||
|
Loading…
Reference in New Issue
Block a user