Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b295e5c7 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] usbvision: cleanup the code



There's a dead code on usbvision that makes it harder to read
and produces a smatch warning about bad identation.

Improve the code readability and add a FIXME to warn about
the current hack there.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 6b20cf3c
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -1061,13 +1061,24 @@ static ssize_t usbvision_read(struct file *file, char __user *buf,
	       __func__,
	       (unsigned long)count, frame->bytes_read);

	/* For now, forget the frame if it has not been read in one shot. */
/*	if (frame->bytes_read >= frame->scanlength) {*/ /* All data has been read */
#if 1
	/*
	 * FIXME:
	 * For now, forget the frame if it has not been read in one shot.
	 */
	frame->bytes_read = 0;

	/* Mark it as available to be used again. */
	frame->grabstate = frame_state_unused;
/*	} */
#else
	if (frame->bytes_read >= frame->scanlength) {
		/* All data has been read */
		frame->bytes_read = 0;

		/* Mark it as available to be used again. */
		frame->grabstate = frame_state_unused;
	}
#endif

	return count;
}