Thread (4 messages) 4 messages, 3 authors, 2026-09-09

[PATCH 2/2] staging: greybus: light: add comments to mutex definitions

flat view
COLD34d

From: <hidden>
Date: 2026-09-04 05:56:31
Also in: lkml
Subsystem: greybus sdio/gpio/spi protocols drivers, greybus subsystem, staging subsystem, the rest · Maintainers: Rui Miguel Silva, Johan Hovold, Alex Elder, Greg Kroah-Hartman, Linus Torvalds

checkpatch complains about:

  CHECK: struct mutex definition without comment

Add short comments describing what each mutex protects. The
channel lock protects the channel state and lights_lock protects
the lights array.

No functional change, just quiets checkpatch.

Signed-off-by: Vaibhav <redacted>
---
 drivers/staging/greybus/light.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
index cab02b5da..a036fa2a0 100644
--- a/drivers/staging/greybus/light.c
+++ b/drivers/staging/greybus/light.c
@@ -37,7 +37,7 @@ struct gb_channel {
 	bool				releasing;
 	bool				strobe_state;
 	bool				active;
-	struct mutex			lock;
+	struct mutex			lock; /* protects channel */
 };
 
 struct gb_light {
@@ -59,7 +59,7 @@ struct gb_lights {
 	struct gb_connection	*connection;
 	u8			lights_count;
 	struct gb_light		*lights;
-	struct mutex		lights_lock;
+	struct mutex		lights_lock; /* protects lights */
 };
 
 static void gb_lights_channel_free(struct gb_channel *channel);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help