diff mbox series

[2/3] dvb-frontends/drxk_hard.c: fix uninitialized variable warning

Message ID 20201006073006.2315225-3-hverkuil-cisco@xs4all.nl
State New
Headers show
Series Three fixes to clean up daily build warnings | expand

Commit Message

Hans Verkuil Oct. 6, 2020, 7:30 a.m. UTC
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));
      |     ^~~~~~~~~~~~~~~~~~

Just initialize wait_cmd to 0.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
 drivers/media/dvb-frontends/drxk_hard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c
index 32f9346deb3e..37882bc587f9 100644
--- a/drivers/media/dvb-frontends/drxk_hard.c
+++ b/drivers/media/dvb-frontends/drxk_hard.c
@@ -1004,7 +1004,7 @@  static int hi_command(struct drxk_state *state, u16 cmd, u16 *p_result)
 	if (!powerdown_cmd) {
 		/* Wait until command rdy */
 		u32 retry_count = 0;
-		u16 wait_cmd;
+		u16 wait_cmd = 0;
 
 		do {
 			usleep_range(1000, 2000);