* [PATCH v2] staging: most: video: Document locks in struct most_video_dev
@ 2026-11-16 18:33 Shivani Patel
2026-11-17 13:07 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Shivani Patel @ 2026-11-16 18:33 UTC (permalink / raw)
To: Greg Kroah-Hartman, Parthiban Veerasooran, Christian Gromm
Cc: linux-staging, linux-kernel, Andy Shevchenko, Julia Lawall,
Shivani Patel
checkpatch.pl reports that list_lock and lock in struct most_video_dev
are defined without a comment.
list_lock protects the pending_mbos list and the mute flag, which are
accessed both from file operations and from the rx completion callback
called by the MOST core. lock is assigned to vdev->lock and is used by
the V4L2 core to serialize ioctls.
Add short comments describing what each lock protects.
Signed-off-by: Shivani Patel <patelshivani2283@gmail.com>
---
v2:
- Add a commit message and Signed-off-by (Andy Shevchenko)
- Use the "staging: most: video:" subject prefix
- Make the comments shorter and accurate
- Drop the outreachy list (Julia Lawall)
drivers/staging/most/video/video.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c
index 3a0445ff6..8833ab5c7 100644
--- a/drivers/staging/most/video/video.c
+++ b/drivers/staging/most/video/video.c
@@ -33,6 +33,7 @@ struct most_video_dev {
bool mute;
struct list_head pending_mbos;
+ /* Protects @pending_mbos and @mute against the rx completion path */
spinlock_t list_lock;
struct v4l2_device v4l2_dev;
@@ -40,6 +41,7 @@ struct most_video_dev {
struct video_device *vdev;
unsigned int ctrl_input;
+ /* Serializes V4L2 ioctls, used as the video_device lock */
struct mutex lock;
wait_queue_head_t wait_data;
--
2.50.1 (Apple Git-155)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] staging: most: video: Document locks in struct most_video_dev
2026-11-16 18:33 [PATCH v2] staging: most: video: Document locks in struct most_video_dev Shivani Patel
@ 2026-11-17 13:07 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2026-11-17 13:07 UTC (permalink / raw)
To: Shivani Patel
Cc: Greg Kroah-Hartman, Parthiban Veerasooran, Christian Gromm,
linux-staging, linux-kernel, Andy Shevchenko, Julia Lawall
On Tue, Nov 17, 2026 at 12:03:55AM +0530, Shivani Patel wrote:
> checkpatch.pl reports that list_lock and lock in struct most_video_dev
> are defined without a comment.
>
> list_lock protects the pending_mbos list and the mute flag, which are
> accessed both from file operations and from the rx completion callback
> called by the MOST core. lock is assigned to vdev->lock and is used by
> the V4L2 core to serialize ioctls.
>
> Add short comments describing what each lock protects.
>
> Signed-off-by: Shivani Patel <patelshivani2283@gmail.com>
> ---
> v2:
> - Add a commit message and Signed-off-by (Andy Shevchenko)
> - Use the "staging: most: video:" subject prefix
> - Make the comments shorter and accurate
> - Drop the outreachy list (Julia Lawall)
>
> drivers/staging/most/video/video.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c
> index 3a0445ff6..8833ab5c7 100644
> --- a/drivers/staging/most/video/video.c
> +++ b/drivers/staging/most/video/video.c
> @@ -33,6 +33,7 @@ struct most_video_dev {
> bool mute;
>
> struct list_head pending_mbos;
> + /* Protects @pending_mbos and @mute against the rx completion path */
Why is the rx path special? I feel like if you really look at
this code you will see things that can be done better. That's
what we really want from this kind of analysis.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-17 13:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 18:33 [PATCH v2] staging: most: video: Document locks in struct most_video_dev Shivani Patel
2026-11-17 13:07 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox