linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] [media] v4l2-ctrls: Don't validate BITMASK twice
@ 2017-11-03 13:35 Andy Shevchenko
  2017-11-05 23:16 ` Sakari Ailus
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2017-11-03 13:35 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media, Hans Verkuil, Sakari Ailus
  Cc: Andy Shevchenko

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

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index c230bd5c6558..cbb2ef43945f 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -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)) {
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] [media] v4l2-ctrls: Don't validate BITMASK twice
  2017-11-03 13:35 [PATCH v1] [media] v4l2-ctrls: Don't validate BITMASK twice Andy Shevchenko
@ 2017-11-05 23:16 ` Sakari Ailus
  0 siblings, 0 replies; 2+ messages in thread
From: Sakari Ailus @ 2017-11-05 23:16 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Mauro Carvalho Chehab, linux-media, Hans Verkuil, Sakari Ailus

On Fri, Nov 03, 2017 at 03:35:39PM +0200, Andy Shevchenko wrote:
> There is no need to repeat what check_range() does for us, i.e. BITMASK
> validation in v4l2_ctrl_new().
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-05 23:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-03 13:35 [PATCH v1] [media] v4l2-ctrls: Don't validate BITMASK twice Andy Shevchenko
2017-11-05 23:16 ` Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).