Skip to contentSkip to conversation

staging: greybus: camera: add comment for mutex

PATCH In review Jose A. Perez de Azpillaga 2 participants 2 messages Feb 25

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: greybus: camera: add comment for mutex

Add a comment to the mutex definition in struct gb_camera to describe what it protects, satisfying a checkpatch.pl CHECK.

---
Hi,

I noticed a CHECK for alignment in this file on line 267. However, fixing it pushed the line over 100 characters. I felt that adding extreme indentation might add more noise than value, so I've only included the mutex comment fix here.

I'd appreciate your guidance on whether you prefer strict alignment even if it breaks the 100-column rule in these specific cases.

---
 drivers/staging/greybus/camera.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/camera.c +1 -1
index 62b55bb28408..a6f3637b8871 100644
@@ -53,7 +53,7 @@ struct gb_camera {
 	struct gb_connection *data_connection;
 	u16 data_cport_id;
 
-	struct mutex mutex;
+	struct mutex mutex; /* Protects camera state */
 	enum gb_camera_state state;
 
 	struct {

--
2.53.0

#1 lore raw

drivers/staging/greybus/camera.c struct gb_camera { · line 56

Quoted 10 lines · Jose A. Perez de Azpillaga
drivers/staging/greybus/camera.c +1 -1
index 62b55bb28408..a6f3637b8871 100644
@@ -53,7 +53,7 @@ struct gb_camera {
 	struct gb_connection *data_connection;
 	u16 data_cport_id;
 
-	struct mutex mutex;
+	struct mutex mutex; /* Protects camera state */

I'm not sure what it means, and looking at how the mutex is used I don't feel it's accurate either.

To be honest, I rarely love these lock documentation patches... :/ They're often really vague and sometimes seem like just guessing based on the name.

regards,
dan carpenter

Quoted 3 lines
drivers/staging/greybus/camera.c +0 -0
 	enum gb_camera_state state;
 
 	struct {