lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230111-uvc_privacy_subdev-v1-1-f859ac9a01e3@chromium.org>
Date:   Wed, 11 Jan 2023 17:52:38 +0900
From:   Yunke Cao <yunkec@...omium.org>
To:     Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Ricardo Ribalda <ribalda@...omium.org>,
        Hans Verkuil <hverkuil-cisco@...all.nl>
Cc:     Yunke Cao <yunkec@...omium.org>, linux-kernel@...r.kernel.org,
        linux-media@...r.kernel.org,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Ricardo Ribalda <ribalda@...omium.org>
Subject: [PATCH RFC 1/3] media: v4l2-ctrls: Expose v4l2_ctrl_fill_event()

Rename fill_event() to v4l2_ctrl_fill_event() and expose it to drivers.

Signed-off-by: Yunke Cao <yunkec@...omium.org>
---
 drivers/media/v4l2-core/v4l2-ctrls-core.c |  9 +++++----
 include/media/v4l2-ctrls.h                | 12 ++++++++++++
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls-core.c b/drivers/media/v4l2-core/v4l2-ctrls-core.c
index 29169170880a..184e03d032d9 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls-core.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls-core.c
@@ -16,8 +16,8 @@
 
 static const union v4l2_ctrl_ptr ptr_null;
 
-static void fill_event(struct v4l2_event *ev, struct v4l2_ctrl *ctrl,
-		       u32 changes)
+void v4l2_ctrl_fill_event(struct v4l2_event *ev, struct v4l2_ctrl *ctrl,
+			  u32 changes)
 {
 	memset(ev, 0, sizeof(*ev));
 	ev->type = V4L2_EVENT_CTRL;
@@ -38,6 +38,7 @@ static void fill_event(struct v4l2_event *ev, struct v4l2_ctrl *ctrl,
 		ev->u.ctrl.step = ctrl->step;
 	ev->u.ctrl.default_value = ctrl->default_value;
 }
+EXPORT_SYMBOL(v4l2_ctrl_fill_event);
 
 void send_initial_event(struct v4l2_fh *fh, struct v4l2_ctrl *ctrl)
 {
@@ -46,7 +47,7 @@ void send_initial_event(struct v4l2_fh *fh, struct v4l2_ctrl *ctrl)
 
 	if (!(ctrl->flags & V4L2_CTRL_FLAG_WRITE_ONLY))
 		changes |= V4L2_EVENT_CTRL_CH_VALUE;
-	fill_event(&ev, ctrl, changes);
+	v4l2_ctrl_fill_event(&ev, ctrl, changes);
 	v4l2_event_queue_fh(fh, &ev);
 }
 
@@ -57,7 +58,7 @@ void send_event(struct v4l2_fh *fh, struct v4l2_ctrl *ctrl, u32 changes)
 
 	if (list_empty(&ctrl->ev_subs))
 		return;
-	fill_event(&ev, ctrl, changes);
+	v4l2_ctrl_fill_event(&ev, ctrl, changes);
 
 	list_for_each_entry(sev, &ctrl->ev_subs, node)
 		if (sev->fh != fh ||
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index e59d9a234631..52b2f366cdb6 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -847,6 +847,18 @@ void v4l2_ctrl_auto_cluster(unsigned int ncontrols,
  */
 struct v4l2_ctrl *v4l2_ctrl_find(struct v4l2_ctrl_handler *hdl, u32 id);
 
+/**
+ * v4l2_ctrl_fill_event() - Fill the v4l2 event for a control.
+ *
+ * @ev:		The event to fill.
+ * @ctrl:	The struct v4l2_ctrl for the control event.
+ * @changes:	A bitmask that tells what has changed.
+ *
+ * This function assumes that the control handler is locked.
+ */
+void v4l2_ctrl_fill_event(struct v4l2_event *ev, struct v4l2_ctrl *ctrl,
+			  u32 changes);
+
 /**
  * v4l2_ctrl_activate() - Make the control active or inactive.
  * @ctrl:	The control to (de)activate.

-- 
b4 0.11.0-dev-4d321

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ