Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

+14 -3
+14 -3
drivers/media/usb/usbvision/usbvision-video.c
··· 1061 1061 __func__, 1062 1062 (unsigned long)count, frame->bytes_read); 1063 1063 1064 - /* For now, forget the frame if it has not been read in one shot. */ 1065 - /* if (frame->bytes_read >= frame->scanlength) {*/ /* All data has been read */ 1064 + #if 1 1065 + /* 1066 + * FIXME: 1067 + * For now, forget the frame if it has not been read in one shot. 1068 + */ 1069 + frame->bytes_read = 0; 1070 + 1071 + /* Mark it as available to be used again. */ 1072 + frame->grabstate = frame_state_unused; 1073 + #else 1074 + if (frame->bytes_read >= frame->scanlength) { 1075 + /* All data has been read */ 1066 1076 frame->bytes_read = 0; 1067 1077 1068 1078 /* Mark it as available to be used again. */ 1069 1079 frame->grabstate = frame_state_unused; 1070 - /* } */ 1080 + } 1081 + #endif 1071 1082 1072 1083 return count; 1073 1084 }