This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: v4l2: Test type instead of cfg->type in v4l2_ctrl_new_custom()
Author:  Boris Brezillon <[email protected]>
Date:    Wed Jun 19 05:21:33 2019 -0400

cfg->type can be overridden by v4l2_ctrl_fill() and the new value is
stored in the local type var. Fix the tests to use this local var.

Fixes: 0996517cf8ea ("V4L/DVB: v4l2: Add new control handling framework")
Cc: <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
[[email protected]: change to !qmenu and !qmenu_int (checkpatch)]
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/v4l2-core/v4l2-ctrls.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

---

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index 29b86d7448dc..371537dd8cd3 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -2464,16 +2464,15 @@ struct v4l2_ctrl *v4l2_ctrl_new_custom(struct 
v4l2_ctrl_handler *hdl,
                v4l2_ctrl_fill(cfg->id, &name, &type, &min, &max, &step,
                                                                &def, &flags);
 
-       is_menu = (cfg->type == V4L2_CTRL_TYPE_MENU ||
-                  cfg->type == V4L2_CTRL_TYPE_INTEGER_MENU);
+       is_menu = (type == V4L2_CTRL_TYPE_MENU ||
+                  type == V4L2_CTRL_TYPE_INTEGER_MENU);
        if (is_menu)
                WARN_ON(step);
        else
                WARN_ON(cfg->menu_skip_mask);
-       if (cfg->type == V4L2_CTRL_TYPE_MENU && qmenu == NULL)
+       if (type == V4L2_CTRL_TYPE_MENU && !qmenu) {
                qmenu = v4l2_ctrl_get_menu(cfg->id);
-       else if (cfg->type == V4L2_CTRL_TYPE_INTEGER_MENU &&
-                qmenu_int == NULL) {
+       } else if (type == V4L2_CTRL_TYPE_INTEGER_MENU && !qmenu_int) {
                handler_set_err(hdl, -EINVAL);
                return NULL;
        }

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to