Skip to contentSkip to conversation

v4l2-ctrls: Don't validate BITMASK twice

PATCH In review Andy Shevchenko 2 participants 2 messages Nov 3, 2017 – Nov 5, 2017 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 v4l2-ctrls: Don't validate BITMASK twice

There is no need to repeat what check_range() does for us, i.e. BITMASK validation in v4l2_ctrl_new().

---
 drivers/media/v4l2-core/v4l2-ctrls.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/media/v4l2-core/v4l2-ctrls.c +0 -4
index c230bd5c6558..cbb2ef43945f 100644
@@ -2013,10 +2013,6 @@ static struct v4l2_ctrl *v4l2_ctrl_new(struct v4l2_ctrl_handler *hdl,
 		handler_set_err(hdl, err);
 		return NULL;
 	}
-	if (type == V4L2_CTRL_TYPE_BITMASK && ((def & ~max) || min || step)) {
-		handler_set_err(hdl, -ERANGE);
-		return NULL;
-	}
 	if (is_array &&
 	    (type == V4L2_CTRL_TYPE_BUTTON ||
 	     type == V4L2_CTRL_TYPE_CTRL_CLASS)) {
Signature · 1 line
2.14.2