summaryrefslogtreecommitdiff
path: root/drivers/media/usb/zr364xx
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2019-10-25 16:46:12 +0300
committerMauro Carvalho Chehab <mchehab@kernel.org>2019-11-10 19:49:58 +0300
commit1dea68495da582da459fcfca60428457acae8063 (patch)
tree3fe36e595338e720e0e9ffed95bf681f28c4fa1c /drivers/media/usb/zr364xx
parent4edead77fa16ac4ec880ebceed83da2415401d18 (diff)
downloadlinux-1dea68495da582da459fcfca60428457acae8063.tar.xz
media: zr364xx: remove redundant assigmnent to idx, clean up code
The variable cable_type is being initialized with a value that is never read and is being re-assigned a little later on. Replace the redundant initializtion with the assignment that occurs a little later. Also initialize frm too rather than have a later assignment. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/usb/zr364xx')
-rw-r--r--drivers/media/usb/zr364xx/zr364xx.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/usb/zr364xx/zr364xx.c b/drivers/media/usb/zr364xx/zr364xx.c
index aff78d63b869..57dbcc8083bf 100644
--- a/drivers/media/usb/zr364xx/zr364xx.c
+++ b/drivers/media/usb/zr364xx/zr364xx.c
@@ -555,14 +555,12 @@ static int zr364xx_read_video_callback(struct zr364xx_camera *cam,
{
unsigned char *pdest;
unsigned char *psrc;
- s32 idx = -1;
- struct zr364xx_framei *frm;
+ s32 idx = cam->cur_frame;
+ struct zr364xx_framei *frm = &cam->buffer.frame[idx];
int i = 0;
unsigned char *ptr = NULL;
_DBG("buffer to user\n");
- idx = cam->cur_frame;
- frm = &cam->buffer.frame[idx];
/* swap bytes if camera needs it */
if (cam->method == METHOD0) {