aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-08-12 03:59:58 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-23 23:50:14 -0400
commit9a887162be81bd21ea8495e0a57b46ab1d77d205 (patch)
tree98c7ed8091883f84a2653f152d763656859624ca /drivers/usb/gadget
parent9ee47476d6734c9deb9ae9ab05d963302f6b6150 (diff)
USB: uvc_v4l2: cleanup test for end of loop
We're trying to test for the the end of the loop here. "format" is never NULL. We don't know what "format->fcc" is because we're past the end of the loop and I think "fmt->fmt.pix.pixelformat" comes from the user so we don't know what that is either. It works, but it's cleaner to just test to see if (i == ARRAY_SIZE(uvc_formats). Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/uvc_v4l2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/uvc_v4l2.c b/drivers/usb/gadget/uvc_v4l2.c
index 2dcffdac86d2..5e807f083bc8 100644
--- a/drivers/usb/gadget/uvc_v4l2.c
+++ b/drivers/usb/gadget/uvc_v4l2.c
@@ -94,7 +94,7 @@ uvc_v4l2_set_format(struct uvc_video *video, struct v4l2_format *fmt)
94 break; 94 break;
95 } 95 }
96 96
97 if (format == NULL || format->fcc != fmt->fmt.pix.pixelformat) { 97 if (i == ARRAY_SIZE(uvc_formats)) {
98 printk(KERN_INFO "Unsupported format 0x%08x.\n", 98 printk(KERN_INFO "Unsupported format 0x%08x.\n",
99 fmt->fmt.pix.pixelformat); 99 fmt->fmt.pix.pixelformat);
100 return -EINVAL; 100 return -EINVAL;