Skip to contentSkip to conversation

staging: iio: cdc: ad7150: add comment to mutex

PATCH Superseded Anchal Jain 2 participants 2 messages Sep 28, 2016

Subsystems (4)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: iio: cdc: ad7150: add comment to mutex

At the risk of being overly pedantic...the lock will make sure that the state data in this structure always accurately reflects the state of the hardware.
So, when parts of this driver start changing those settings, we need to use a lock so that simultaneous writes of that state data don't conflict

---
changes in v2-
-modify the patch comment
-add file in the commit message

 drivers/staging/iio/cdc/ad7150.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/cdc/ad7150.c +1 -1
index f6b9a10..13709bf 100644
@@ -78,7 +78,7 @@ struct ad7150_chip_info {
 	u8 mag_timeout[2][2];
 	int old_state;
 	char *conversion_mode;
-	struct mutex state_lock;
+	struct mutex state_lock; /* protect hardware state */
 };
 
 /*
Signature · 1 line
1.9.1
#1 lore raw
Quoted 6 lines · Anchal Jain

At the risk of being overly pedantic...the lock will make sure that the state data in this structure always accurately reflects the state of the hardware.
So, when parts of this driver start changing those settings, we need to use a lock so that simultaneous writes of that state data don't conflict

oops...I was just writing all that as an explanation. I don't think it's needed in the patch. Your previous changelog, with mutex spelling corrected, will be fine.

see if you can tab out that comment

Sorry for the confusion,
alisons

Quoted 31 lines

---
changes in v2-
-modify the patch comment
-add file in the commit message

 drivers/staging/iio/cdc/ad7150.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/cdc/ad7150.c +1 -1
index f6b9a10..13709bf 100644
@@ -78,7 +78,7 @@ struct ad7150_chip_info {
 	u8 mag_timeout[2][2];
 	int old_state;
 	char *conversion_mode;
-	struct mutex state_lock;
+	struct mutex state_lock; /* protect hardware state */
 };
 
 /*
Signature · 8 lines
1.9.1

-- 
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160928175206.GA13416%40life-desktop.
For more options, visit https://groups.google.com/d/optout.