Skip to contentSkip to conversation

staging: greybus: added comment to mutex declaration in fw-management.c

PATCH Superseded Rachit Dhar 2 participants 3 messages Feb 4 – Feb 16

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/4 staging: greybus: added comment to mutex declaration in fw-management.c

Added comment to mutex declaration, to resolve a checkpatch.pl check.

---
 drivers/staging/greybus/fw-management.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/fw-management.c +1 -1
index 152949c23d65..07a0e6b63cf3 100644
@@ -28,7 +28,7 @@ struct fw_mgmt {
 
 	/* Common id-map for interface and backend firmware requests */
 	struct ida		id_map;
-	struct mutex		mutex;
+	struct mutex		mutex; /* protects fw_mgmt->disabled, and serializes ioctl */
 	struct completion	completion;
 	struct cdev		cdev;
 	struct device		*class_device;
Signature · 1 line
2.43.0
#1 lore raw
Quoted 12 lines · Rachit Dhar

Added comment to mutex declaration, to resolve a checkpatch.pl check.

---
 drivers/staging/greybus/fw-management.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/fw-management.c +0 -0
index 152949c23d65..07a0e6b63cf3 100644

drivers/staging/greybus/fw-management.c struct fw_mgmt { · line 31

Quoted 5 lines
drivers/staging/greybus/fw-management.c +1 -1
@@ -28,7 +28,7 @@ struct fw_mgmt {
 
 	/* Common id-map for interface and backend firmware requests */
 	struct ida		id_map;
-	struct mutex		mutex;
+	struct mutex		mutex; /* protects fw_mgmt->disabled, and serializes ioctl */

How do you "know" that this is what it is for?

Fixing this type of checkpatch warning is hard, and requires lots of documentation and checking. If you didn't write the code originally, I wouldn't worry about this type of issue at all, it's best for new code, not existing code.

thanks,

greg k-h

#2 lore raw
Quoted 7 lines · Greg Kroah-Hartman

How do you "know" that this is what it is for?

Fixing this type of checkpatch warning is hard, and requires lots of documentation and checking. If you didn't write the code originally, I wouldn't worry about this type of issue at all, it's best for new code, not existing code.

I did go through the code manually, but understand that it might be deserving of more extensive checking and documentation to make such a conclusion.

This patch can be dropped. Let me know if another patch series is needed without this patch included in it.

Thanks,
Rachit