Commit b0efc3ed authored by Jean Delvare's avatar Jean Delvare Committed by Mauro Carvalho Chehab

[media] m920x: Fix uninitialized variable warning

drivers/media/usb/dvb-usb/m920x.c:91:6: warning: "ret" may be used uninitialized in this function [-Wuninitialized]
drivers/media/usb/dvb-usb/m920x.c:70:6: note: "ret" was declared here
This is real, if a remote control has an empty initialization sequence
we would get success or failure randomly.
OTOH the initialization of ret in m920x_init is needless, the function
returns with an error as soon as an error happens, so the last return
can only be a success and we can hard-code 0 there.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 46f85978
...@@ -76,12 +76,12 @@ static inline int m920x_write_seq(struct usb_device *udev, u8 request, ...@@ -76,12 +76,12 @@ static inline int m920x_write_seq(struct usb_device *udev, u8 request,
seq++; seq++;
} while (seq->address); } while (seq->address);
return ret; return 0;
} }
static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq) static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
{ {
int ret = 0, i, epi, flags = 0; int ret, i, epi, flags = 0;
int adap_enabled[M9206_MAX_ADAPTERS] = { 0 }; int adap_enabled[M9206_MAX_ADAPTERS] = { 0 };
/* Remote controller init. */ /* Remote controller init. */
...@@ -124,7 +124,7 @@ static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq) ...@@ -124,7 +124,7 @@ static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
} }
} }
return ret; return 0;
} }
static int m920x_init_ep(struct usb_interface *intf) static int m920x_init_ep(struct usb_interface *intf)
......
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