From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] usb/uvc_v4l2: cleanup test for end of loop
Date: Thu, 12 Aug 2010 08:02:14 +0000 [thread overview]
Message-ID: <201008121002.15665.laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20100812075958.GP645@bicker>
Hi Dan,
Thanks for the patch.
On Thursday 12 August 2010 09:59:58 Dan Carpenter wrote:
> 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>
> diff --git a/drivers/usb/gadget/uvc_v4l2.c b/drivers/usb/gadget/uvc_v4l2.c
> index 2dcffda..5e807f0 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) break;
> }
>
> - if (format = NULL || format->fcc != fmt->fmt.pix.pixelformat) {
> + if (i = ARRAY_SIZE(uvc_formats)) {
> printk(KERN_INFO "Unsupported format 0x%08x.\n",
> fmt->fmt.pix.pixelformat);
> return -EINVAL;
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2010-08-12 8:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-12 7:59 [patch] usb/uvc_v4l2: cleanup test for end of loop Dan Carpenter
2010-08-12 8:02 ` Laurent Pinchart [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201008121002.15665.laurent.pinchart@ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox