Message ID | 4B5F60B0.7090709@freemail.hu (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-path: <linux-media-owner@vger.kernel.org> Envelope-to: mchehab@infradead.org Delivery-date: Tue, 26 Jan 2010 21:38:07 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.6) for <mchehab@localhost> (single-drop); Tue, 26 Jan 2010 19:39:32 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NZt6s-0003qN-Pz; Tue, 26 Jan 2010 21:38:06 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752342Ab0AZViE (ORCPT <rfc822; kmpark@infradead.org> + 1 other); Tue, 26 Jan 2010 16:38:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752489Ab0AZViE (ORCPT <rfc822;linux-media-outgoing>); Tue, 26 Jan 2010 16:38:04 -0500 Received: from mail01d.mail.t-online.hu ([84.2.42.6]:61598 "EHLO mail01d.mail.t-online.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752217Ab0AZViD (ORCPT <rfc822;linux-media@vger.kernel.org>); Tue, 26 Jan 2010 16:38:03 -0500 Received: from [192.168.1.67] (dsl51B659B2.pool.t-online.hu [81.182.89.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail01d.mail.t-online.hu (Postfix) with ESMTPSA id E525475862D; Tue, 26 Jan 2010 22:35:17 +0100 (CET) Message-ID: <4B5F60B0.7090709@freemail.hu> Date: Tue, 26 Jan 2010 22:37:52 +0100 From: =?UTF-8?B?TsOpbWV0aCBNw6FydG9u?= <nm127@freemail.hu> User-Agent: Mozilla/5.0 (X11; U; Linux i686; hu-HU; rv:1.8.1.21) Gecko/20090402 SeaMonkey/1.1.16 MIME-Version: 1.0 To: Laurent Pinchart <laurent.pinchart@ideasonboard.com> CC: V4L Mailing List <linux-media@vger.kernel.org> Subject: [PATCH] uvcvideo: check minimum border of control Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-DCC-mail.t-online.hu-Metrics: mail01d.mail.t-online.hu 32721; Body=2 Fuz1=2 Fuz2=2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org |
Commit Message
Németh Márton
Jan. 26, 2010, 9:37 p.m. UTC
Check also the minimum border of a value before setting it
to a control value.
See also http://bugzilla.kernel.org/show_bug.cgi?id=12824 .
Signed-off-by: Márton Németh <nm127@freemail.hu>
---
drivers/media/video/uvc/uvc_ctrl.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Comments
Németh Márton wrote: > Check also the minimum border of a value before setting it > to a control value. > > See also http://bugzilla.kernel.org/show_bug.cgi?id=12824 . Patch didn't apply. Had you generated against our -git tree? http://git.linuxtv.org/v4l-dvb.git Cheers, Mauro. > > Signed-off-by: Márton Németh <nm127@freemail.hu> > --- > drivers/media/video/uvc/uvc_ctrl.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c > --- a/drivers/media/video/uvc/uvc_ctrl.c > +++ b/drivers/media/video/uvc/uvc_ctrl.c > @@ -1068,6 +1068,8 @@ int uvc_ctrl_set(struct uvc_video_chain *chain, > uvc_ctrl_data(ctrl, UVC_CTRL_DATA_RES)); > > xctrl->value = min + (xctrl->value - min + step/2) / step * step; > + if (xctrl->value < min) > + xctrl->value = min; > if (xctrl->value > max) > xctrl->value = max; > value = xctrl->value; > > -- > To unsubscribe from this list: send the line "unsubscribe linux-media" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Mauro Carvalho Chehab wrote: > Németh Márton wrote: >> Check also the minimum border of a value before setting it >> to a control value. >> >> See also http://bugzilla.kernel.org/show_bug.cgi?id=12824 . > > Patch didn't apply. Had you generated against our -git tree? > http://git.linuxtv.org/v4l-dvb.git No, this is against http://git.linuxtv.org/pinchartl/uvcvideo.git . The latest patch which tried to fix http://bugzilla.kernel.org/show_bug.cgi?id=12824 missed to check the minimum border. Regards, Márton Németh >> Signed-off-by: Márton Németh <nm127@freemail.hu> >> --- >> drivers/media/video/uvc/uvc_ctrl.c | 2 ++ >> 1 files changed, 2 insertions(+), 0 deletions(-) >> >> diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c >> --- a/drivers/media/video/uvc/uvc_ctrl.c >> +++ b/drivers/media/video/uvc/uvc_ctrl.c >> @@ -1068,6 +1068,8 @@ int uvc_ctrl_set(struct uvc_video_chain *chain, >> uvc_ctrl_data(ctrl, UVC_CTRL_DATA_RES)); >> >> xctrl->value = min + (xctrl->value - min + step/2) / step * step; >> + if (xctrl->value < min) >> + xctrl->value = min; >> if (xctrl->value > max) >> xctrl->value = max; >> value = xctrl->value; -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Németh Márton wrote: > Mauro Carvalho Chehab wrote: >> Németh Márton wrote: >>> Check also the minimum border of a value before setting it >>> to a control value. >>> >>> See also http://bugzilla.kernel.org/show_bug.cgi?id=12824 . >> Patch didn't apply. Had you generated against our -git tree? >> http://git.linuxtv.org/v4l-dvb.git > > No, this is against http://git.linuxtv.org/pinchartl/uvcvideo.git . > The latest patch which tried to fix http://bugzilla.kernel.org/show_bug.cgi?id=12824 > missed to check the minimum border. Ah, ok. Please specify on the subject when you're writing patches against a different tree. This helps me to tag accordingly at Patchwork, saving me some time. > > Regards, > > Márton Németh > >>> Signed-off-by: Márton Németh <nm127@freemail.hu> -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Mauro Carvalho Chehab wrote: > Németh Márton wrote: >> Mauro Carvalho Chehab wrote: >>> Németh Márton wrote: >>>> Check also the minimum border of a value before setting it >>>> to a control value. >>>> >>>> See also http://bugzilla.kernel.org/show_bug.cgi?id=12824 . >>> Patch didn't apply. Had you generated against our -git tree? >>> http://git.linuxtv.org/v4l-dvb.git >> No, this is against http://git.linuxtv.org/pinchartl/uvcvideo.git . >> The latest patch which tried to fix http://bugzilla.kernel.org/show_bug.cgi?id=12824 >> missed to check the minimum border. > > Ah, ok. Please specify on the subject when you're writing patches against > a different tree. This helps me to tag accordingly at Patchwork, Could you please give me an example what do you mean? For example in this case. Regards, Márton Németh -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Németh Márton wrote: > Mauro Carvalho Chehab wrote: >> Németh Márton wrote: >>> Mauro Carvalho Chehab wrote: >>>> Németh Márton wrote: >>>>> Check also the minimum border of a value before setting it >>>>> to a control value. >>>>> >>>>> See also http://bugzilla.kernel.org/show_bug.cgi?id=12824 . >>>> Patch didn't apply. Had you generated against our -git tree? >>>> http://git.linuxtv.org/v4l-dvb.git >>> No, this is against http://git.linuxtv.org/pinchartl/uvcvideo.git . >>> The latest patch which tried to fix http://bugzilla.kernel.org/show_bug.cgi?id=12824 >>> missed to check the minimum border. >> Ah, ok. Please specify on the subject when you're writing patches against >> a different tree. This helps me to tag accordingly at Patchwork, > > Could you please give me an example what do you mean? For example in > this case. You could for example, use at the subject: [PATCH uvc tree] <patch description> This helps me to not assume that it is against the upstream tree.
Hi Márton, On Tuesday 26 January 2010 22:37:52 Németh Márton wrote: > Check also the minimum border of a value before setting it > to a control value. > > See also http://bugzilla.kernel.org/show_bug.cgi?id=12824 . > > Signed-off-by: Márton Németh <nm127@freemail.hu> I've updated the previous patch in the uvcvideo git repository, could you please test it ?
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c --- a/drivers/media/video/uvc/uvc_ctrl.c +++ b/drivers/media/video/uvc/uvc_ctrl.c @@ -1068,6 +1068,8 @@ int uvc_ctrl_set(struct uvc_video_chain *chain, uvc_ctrl_data(ctrl, UVC_CTRL_DATA_RES)); xctrl->value = min + (xctrl->value - min + step/2) / step * step; + if (xctrl->value < min) + xctrl->value = min; if (xctrl->value > max) xctrl->value = max; value = xctrl->value;