Skip to contentSkip to conversation

uvcvideo: check minimum border of control

PATCH In review Németh Márton 3 participants 7 messages Jan 26, 2010 – Feb 3, 2010 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uvcvideo: check minimum border of control

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 .

---
 drivers/media/video/uvc/uvc_ctrl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/media/video/uvc/uvc_ctrl.c +2 -0
@@ -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;
#1 lore raw
Quoted 4 lines · Németh Márton

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.

Quoted 23 lines
---
 drivers/media/video/uvc/uvc_ctrl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/media/video/uvc/uvc_ctrl.c +2 -1
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 8 lines · Mauro Carvalho Chehab
Quoted 4 lines · Németh Márton

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

Quoted 17 lines
Quoted 17 lines
---
 drivers/media/video/uvc/uvc_ctrl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/media/video/uvc/uvc_ctrl.c +2 -0
@@ -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;
#3 lore raw
Quoted 5 lines · Németh Márton
Quoted 4 lines · Mauro Carvalho Chehab
Quoted 3 lines · Németh Márton

Check also the minimum border of a value before setting it to a control value.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

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.

Quoted 6 lines

Regards,

Márton Németh

Quoted 1 line
Quoted 1 line
#4 lore raw
Quoted 7 lines · Mauro Carvalho Chehab
Quoted 6 lines · Németh Márton
Quoted 5 lines · Mauro Carvalho Chehab
Quoted 4 lines · Németh Márton

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 .

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

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

#5 lore raw
Quoted 10 lines · Németh Márton
Quoted 9 lines · Mauro Carvalho Chehab
Quoted 8 lines · Németh Márton
Quoted 7 lines · Mauro Carvalho Chehab
Quoted 4 lines · Németh Márton

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
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

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.

Signature · 2 lines
Cheers,
Mauro