Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH] staging: greybus: add comments to mutex declarations
@ 2026-06-25  8:57 suryasaimadhu
  2026-06-25 10:26 ` Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: suryasaimadhu @ 2026-06-25  8:57 UTC (permalink / raw)
  To: vaibhav.sr, mgreer
  Cc: johan, elder, gregkh, greybus-dev, linux-staging, linux-kernel,
	suryasaimadhu

Add comments to mutex members in gbaudio_codec_info struct
to describe what each mutex protects, as recommended by checkpatch.

Signed-off-by: suryasaimadhu <suryasaimadhu369@gmail.com>
---
 drivers/staging/greybus/audio_codec.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/greybus/audio_codec.h b/drivers/staging/greybus/audio_codec.h
index f3f7a7ec6..326770b99 100644
--- a/drivers/staging/greybus/audio_codec.h
+++ b/drivers/staging/greybus/audio_codec.h
@@ -70,8 +70,8 @@ struct gbaudio_codec_info {
 	struct list_head module_list;
 	/* to maintain runtime stream params for each DAI */
 	struct list_head dai_list;
-	struct mutex lock;
-	struct mutex register_mutex;
+	struct mutex lock; /* protects module_list and dai_list */
+	struct mutex register_mutex; /* protects module registration */
 };
 
 struct gbaudio_widget {
-- 
2.47.3


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

* Re: [PATCH] staging: greybus: add comments to mutex declarations
  2026-06-25  8:57 [PATCH] staging: greybus: add comments to mutex declarations suryasaimadhu
@ 2026-06-25 10:26 ` Dan Carpenter
  2026-06-25 10:45   ` [PATCH v2] " suryasaimadhu
  2026-06-25 11:16   ` [PATCH] staging: greybus: add meaningful " suryasaimadhu
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2026-06-25 10:26 UTC (permalink / raw)
  To: suryasaimadhu
  Cc: vaibhav.sr, mgreer, johan, elder, gregkh, greybus-dev,
	linux-staging, linux-kernel

On Thu, Jun 25, 2026 at 04:57:40PM +0800, suryasaimadhu wrote:
> Add comments to mutex members in gbaudio_codec_info struct
> to describe what each mutex protects, as recommended by checkpatch.
> 
> Signed-off-by: suryasaimadhu <suryasaimadhu369@gmail.com>

Capital letters?  Is this how you would write your name on a legal
document?

I kind of hate this checkpatch warning.  What I want is a document,
not part of sentence...  The document could go in the commit message
if you want, but I really want some thought to go into it, otherwise
it's sort of useless.

regards,
dan carpenter


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

* [PATCH v2] staging: greybus: add comments to mutex declarations
  2026-06-25 10:26 ` Dan Carpenter
@ 2026-06-25 10:45   ` suryasaimadhu
  2026-06-25 10:48     ` Sai Madhu
  2026-06-25 11:16   ` [PATCH] staging: greybus: add meaningful " suryasaimadhu
  1 sibling, 1 reply; 5+ messages in thread
From: suryasaimadhu @ 2026-06-25 10:45 UTC (permalink / raw)
  To: error27
  Cc: vaibhav.sr, mgreer, johan, elder, gregkh, greybus-dev,
	linux-staging, linux-kernel, suryasaimadhu

Add comments to mutex members in gbaudio_codec_info struct
to describe what each mutex protects, as recommended by checkpatch.

Signed-off-by: suryasaimadhu <suryasaimadhu369@gmail.com>
---
 drivers/staging/greybus/audio_codec.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/greybus/audio_codec.h b/drivers/staging/greybus/audio_codec.h
index f3f7a7ec6..326770b99 100644
--- a/drivers/staging/greybus/audio_codec.h
+++ b/drivers/staging/greybus/audio_codec.h
@@ -70,8 +70,8 @@ struct gbaudio_codec_info {
 	struct list_head module_list;
 	/* to maintain runtime stream params for each DAI */
 	struct list_head dai_list;
-	struct mutex lock;
-	struct mutex register_mutex;
+	struct mutex lock; /* protects module_list and dai_list */
+	struct mutex register_mutex; /* protects module registration */
 };
 
 struct gbaudio_widget {
-- 
2.47.3


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

* Re: [PATCH v2] staging: greybus: add comments to mutex declarations
  2026-06-25 10:45   ` [PATCH v2] " suryasaimadhu
@ 2026-06-25 10:48     ` Sai Madhu
  0 siblings, 0 replies; 5+ messages in thread
From: Sai Madhu @ 2026-06-25 10:48 UTC (permalink / raw)
  To: error27
  Cc: vaibhav.sr, mgreer, johan, elder, gregkh, greybus-dev,
	linux-staging, linux-kernel

syr for duplicate patch,
please ignore .

On Thu, 25 Jun 2026 at 16:16, suryasaimadhu <suryasaimadhu369@gmail.com> wrote:
>
> Add comments to mutex members in gbaudio_codec_info struct
> to describe what each mutex protects, as recommended by checkpatch.
>
> Signed-off-by: suryasaimadhu <suryasaimadhu369@gmail.com>
> ---
>  drivers/staging/greybus/audio_codec.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/greybus/audio_codec.h b/drivers/staging/greybus/audio_codec.h
> index f3f7a7ec6..326770b99 100644
> --- a/drivers/staging/greybus/audio_codec.h
> +++ b/drivers/staging/greybus/audio_codec.h
> @@ -70,8 +70,8 @@ struct gbaudio_codec_info {
>         struct list_head module_list;
>         /* to maintain runtime stream params for each DAI */
>         struct list_head dai_list;
> -       struct mutex lock;
> -       struct mutex register_mutex;
> +       struct mutex lock; /* protects module_list and dai_list */
> +       struct mutex register_mutex; /* protects module registration */
>  };
>
>  struct gbaudio_widget {
> --
> 2.47.3
>

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

* [PATCH] staging: greybus: add meaningful comments to mutex declarations
  2026-06-25 10:26 ` Dan Carpenter
  2026-06-25 10:45   ` [PATCH v2] " suryasaimadhu
@ 2026-06-25 11:16   ` suryasaimadhu
  1 sibling, 0 replies; 5+ messages in thread
From: suryasaimadhu @ 2026-06-25 11:16 UTC (permalink / raw)
  To: error27
  Cc: vaibhav.sr, mgreer, johan, elder, gregkh, greybus-dev,
	linux-staging, linux-kernel, suryasaimadhu

The gbaudio_codec_info struct has two mutexes whose purpose was
not documented:

- lock: serializes DAI stream enable/disable operations and
  module_list/dai_list access in gbaudio_module_update() and
  gbcodec DAI ops
- register_mutex: serializes module register/unregister operations
  including DAPM controls, widgets and routes in
  gbaudio_register_module() and gbaudio_unregister_module()

Signed-off-by: suryasaimadhu <suryasaimadhu369@gmail.com>
---
 drivers/staging/greybus/audio_codec.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/staging/greybus/audio_codec.h b/drivers/staging/greybus/audio_codec.h
index f3f7a7ec6..3d92ac8a0 100644
--- a/drivers/staging/greybus/audio_codec.h
+++ b/drivers/staging/greybus/audio_codec.h
@@ -70,7 +70,15 @@ struct gbaudio_codec_info {
 	struct list_head module_list;
 	/* to maintain runtime stream params for each DAI */
 	struct list_head dai_list;
+	/*
+	 * held during DAI stream ops and module_list/dai_list
+	 * access (gbaudio_module_update, gbcodec DAI ops)
+	 */
 	struct mutex lock;
+	/*
+	 * held during module register/unregister including
+	 * DAPM controls, widgets and routes
+	 */
 	struct mutex register_mutex;
 };
 
-- 
2.47.3


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

end of thread, other threads:[~2026-06-25 11:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-25  8:57 [PATCH] staging: greybus: add comments to mutex declarations suryasaimadhu
2026-06-25 10:26 ` Dan Carpenter
2026-06-25 10:45   ` [PATCH v2] " suryasaimadhu
2026-06-25 10:48     ` Sai Madhu
2026-06-25 11:16   ` [PATCH] staging: greybus: add meaningful " suryasaimadhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox