Skip to contentSkip to conversation

staging: emxx_udc: Add comment for spinlock_t definition.

PATCH Superseded Varsha Rao 2 participants 3 messages Feb 28, 2017 – Mar 1, 2017 Staging

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Varsha Rao

author
#0 lore raw

PATCH v2 1/1 staging: emxx_udc: Add comment for spinlock_t definition.

A spinlock can have only two type of values, locked and unlocked. Here lock is a variable of type spinlock_t. Its values are manipulated using spinlock functions. Spinlock protect and guarantee exclusive access, to critical region.

In this patch, comment is added for spinlock_t definition, to fix the following checkpatch issue:

CHECK: spinlock_t definition without comment

---
Changes in v2:
- Modified commit message.

 drivers/staging/emxx_udc/emxx_udc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/emxx_udc/emxx_udc.h +1 -1
index 789bfb9..78c08e1 100644
@@ -567,7 +567,7 @@ struct nbu2ss_udc {
 	struct usb_gadget_driver *driver;
 	struct platform_device *pdev;
 	struct device *dev;
-	spinlock_t lock;
+	spinlock_t lock; /* Protects nbu2ss_udc structure fields */
 	struct completion		*pdone;
 
 	enum ep0_state			ep0state;
Signature · 1 line
2.9.3
#1 lore raw
Quoted 4 lines · Varsha Rao

A spinlock can have only two type of values, locked and unlocked. Here lock is a variable of type spinlock_t. Its values are manipulated using spinlock functions. Spinlock protect and guarantee exclusive access, to critical region.

I don't understand the purpose of the above. It is common knowledge.

Quoted 2 lines

In this patch, comment is added for spinlock_t definition, to fix the following checkpatch issue:

What you could explain more about is how you chose the comment.

julia

Quoted 33 lines

CHECK: spinlock_t definition without comment

---
Changes in v2:
- Modified commit message.

 drivers/staging/emxx_udc/emxx_udc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/emxx_udc/emxx_udc.h +1 -2
index 789bfb9..78c08e1 100644
@@ -567,7 +567,7 @@ struct nbu2ss_udc {
 	struct usb_gadget_driver *driver;
 	struct platform_device *pdev;
 	struct device *dev;
-	spinlock_t lock;
+	spinlock_t lock; /* Protects nbu2ss_udc structure fields */
 	struct completion		*pdone;
 
 	enum ep0_state			ep0state;
--

2.9.3

--
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/58b5b1d0.024a620a.27ba9.a047%40mx.google.com.
For more options, visit https://groups.google.com/d/optout.

author
#2 lore raw
Quoted 4 lines

I don't understand the purpose of the above. It is common knowledge.

I just wanted to tell, by explaining about spinlocks that members of
nbu2ss_udc structure are critical region resources.

Quoted 6 lines
Quoted 3 lines

In this patch, comment is added for spinlock_t definition, to fix the following checkpatch issue:

What you could explain more about is how you chose the comment.

Okay, I'll send v2 of this patch.

Thanks,
Varsha