Skip to content

Commit

Permalink
media: zr364xx: remove redundant assigmnent to idx, clean up code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Colin Ian King authored and Mauro Carvalho Chehab committed Nov 10, 2019
1 parent 4edead7 commit 1dea684
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/media/usb/zr364xx/zr364xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1dea684

Please sign in to comment.