提交 4366dfef 编写于 作者: R Ricardo Ribalda 提交者: Mauro Carvalho Chehab

[media] media/v4l2-ctrls: Code cleanout validate_new()

We can simplify the code removing the if().

v4l2_ctr_new sets ctrls->elems to 1 when !ctrl->is_ptr.
Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 4a99362d
......@@ -1678,21 +1678,6 @@ static int validate_new(const struct v4l2_ctrl *ctrl, union v4l2_ctrl_ptr p_new)
unsigned idx;
int err = 0;
if (!ctrl->is_ptr) {
switch (ctrl->type) {
case V4L2_CTRL_TYPE_INTEGER:
case V4L2_CTRL_TYPE_INTEGER_MENU:
case V4L2_CTRL_TYPE_MENU:
case V4L2_CTRL_TYPE_BITMASK:
case V4L2_CTRL_TYPE_BOOLEAN:
case V4L2_CTRL_TYPE_BUTTON:
case V4L2_CTRL_TYPE_CTRL_CLASS:
case V4L2_CTRL_TYPE_INTEGER64:
return ctrl->type_ops->validate(ctrl, 0, p_new);
default:
break;
}
}
for (idx = 0; !err && idx < ctrl->elems; idx++)
err = ctrl->type_ops->validate(ctrl, idx, p_new);
return err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册