Skip to contentSkip to conversation

staging: most: hdm-usb: add comment for struct mutex definition

PATCH In review Aastha Gupta 3 participants 8 messages Sep 16, 2017

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

PATCH 1/1 staging: most: hdm-usb: add comment for struct mutex definition

This patch fixes following checkpatch.pl checks:
CHECK: struct mutex definition without comment

---
 drivers/staging/most/hdm-usb/hdm_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/most/hdm-usb/hdm_usb.c +1 -1
index 85775da..9c58598 100644
@@ -122,7 +122,7 @@ struct most_dev {
 	bool is_channel_healthy[MAX_NUM_ENDPOINTS];
 	struct clear_hold_work clear_work[MAX_NUM_ENDPOINTS];
 	struct usb_anchor *busy_urbs;
-	struct mutex io_mutex;
+	struct mutex io_mutex; /* synchronize I/O with disconnect */
 	struct timer_list link_stat_timer;
 	struct work_struct poll_work_obj;
 	void (*on_netinfo)(struct most_interface *, unsigned char,
Signature · 1 line
2.7.4
#1 lore raw
Quoted 13 lines · Aastha Gupta

This patch fixes following checkpatch.pl checks:
CHECK: struct mutex definition without comment

---
 drivers/staging/most/hdm-usb/hdm_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/most/hdm-usb/hdm_usb.c +0 -0
index 85775da..9c58598 100644

drivers/staging/most/hdm-usb/hdm_usb.c struct most_dev { · line 125

Quoted 5 lines
drivers/staging/most/hdm-usb/hdm_usb.c +1 -1
@@ -122,7 +122,7 @@ struct most_dev {
 	bool is_channel_healthy[MAX_NUM_ENDPOINTS];
 	struct clear_hold_work clear_work[MAX_NUM_ENDPOINTS];
 	struct usb_anchor *busy_urbs;
-	struct mutex io_mutex;
+	struct mutex io_mutex; /* synchronize I/O with disconnect */

Why did you choose this comment?

julia

Quoted 13 lines
drivers/staging/most/hdm-usb/hdm_usb.c +0 -1
 	struct timer_list link_stat_timer;
 	struct work_struct poll_work_obj;
 	void (*on_netinfo)(struct most_interface *, unsigned char,
--

2.7.4

--
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/1505544199-13800-1-git-send-email-aastha.gupta4104%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
Quoted 25 lines · Julia Lawall
Quoted 13 lines · Aastha Gupta

This patch fixes following checkpatch.pl checks:
CHECK: struct mutex definition without comment

---
 drivers/staging/most/hdm-usb/hdm_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/most/hdm-usb/hdm_usb.c +0 -0
index 85775da..9c58598 100644

drivers/staging/most/hdm-usb/hdm_usb.c struct most_dev { · line 125

Quoted 5 lines
drivers/staging/most/hdm-usb/hdm_usb.c +1 -1
@@ -122,7 +122,7 @@ struct most_dev {
      bool is_channel_healthy[MAX_NUM_ENDPOINTS];
      struct clear_hold_work clear_work[MAX_NUM_ENDPOINTS];
      struct usb_anchor *busy_urbs;
-     struct mutex io_mutex;
+     struct mutex io_mutex; /* synchronize I/O with disconnect */

Why did you choose this comment?

Quoted 1 line

julia

The use of this struct mutex was mentioned before in the code.

Aastha

Quoted 14 lines
Quoted 14 lines
drivers/staging/most/hdm-usb/hdm_usb.c +0 -1
      struct timer_list link_stat_timer;
      struct work_struct poll_work_obj;
      void (*on_netinfo)(struct most_interface *, unsigned char,
--

2.7.4

--
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/1505544199-13800-1-git-send-email-aastha.gupta4104%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#3 lore raw
Quoted 26 lines · Aastha Gupta
Quoted 25 lines · Julia Lawall
Quoted 13 lines · Aastha Gupta

This patch fixes following checkpatch.pl checks:
CHECK: struct mutex definition without comment

---
 drivers/staging/most/hdm-usb/hdm_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/most/hdm-usb/hdm_usb.c +0 -0
index 85775da..9c58598 100644

drivers/staging/most/hdm-usb/hdm_usb.c struct most_dev { · line 125

Quoted 5 lines
drivers/staging/most/hdm-usb/hdm_usb.c +1 -1
@@ -122,7 +122,7 @@ struct most_dev {
      bool is_channel_healthy[MAX_NUM_ENDPOINTS];
      struct clear_hold_work clear_work[MAX_NUM_ENDPOINTS];
      struct usb_anchor *busy_urbs;
-     struct mutex io_mutex;
+     struct mutex io_mutex; /* synchronize I/O with disconnect */

Why did you choose this comment?

Quoted 3 lines
Quoted 1 line

julia

The use of this struct mutex was mentioned before in the code.

I see that it is just in the doc of the same structure. I'm not sure that a double comment is needed in this case. I wonder if checkpatch should/could be extended to address this.

julia

Quoted 24 lines

Aastha

Quoted 7 lines
Quoted 7 lines
drivers/staging/most/hdm-usb/hdm_usb.c +0 -1
      struct timer_list link_stat_timer;
      struct work_struct poll_work_obj;
      void (*on_netinfo)(struct most_interface *, unsigned char,
--

2.7.4

Quoted 7 lines
Quoted 7 lines

--
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/1505544199-13800-1-git-send-email-aastha.gupta4104%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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/CAHXiS5-uqsTyjXv3KjnGnL9T7hKfEnMPL%2BRW-CXQE%2BU-oDFq2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

#4 lore raw
Quoted 6 lines · Julia Lawall
Quoted 5 lines · Aastha Gupta
Quoted 4 lines · Julia Lawall
Quoted 2 lines · Aastha Gupta

This patch fixes following checkpatch.pl checks:
CHECK: struct mutex definition without comment

[]

Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/staging/most/hdm-usb/hdm_usb.c

Quoted 1 line
drivers/staging/most/hdm-usb/hdm_usb.c +0 -0

[]

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

drivers/staging/most/hdm-usb/hdm_usb.c struct most_dev { · line 125

Quoted 6 lines
drivers/staging/most/hdm-usb/hdm_usb.c +1 -1
@@ -122,7 +122,7 @@ struct most_dev {
      bool is_channel_healthy[MAX_NUM_ENDPOINTS];
      struct clear_hold_work clear_work[MAX_NUM_ENDPOINTS];
      struct usb_anchor *busy_urbs;
-     struct mutex io_mutex;
+     struct mutex io_mutex; /* synchronize I/O with disconnect */

Why did you choose this comment?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

julia

The use of this struct mutex was mentioned before in the code.

I see that it is just in the doc of the same structure. I'm not sure that a double comment is needed in this case. I wonder if checkpatch should/could be extended to address this.

I think that's not feasible.

checkpatch is a patch context based check and wouldn't necessarily know that the mutex is documented elsewhere.

#5 lore raw
Quoted 23 lines · Joe Perches
Quoted 6 lines · Julia Lawall
Quoted 5 lines · Aastha Gupta
Quoted 4 lines · Julia Lawall
Quoted 2 lines · Aastha Gupta

This patch fixes following checkpatch.pl checks:
CHECK: struct mutex definition without comment

[]

Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/staging/most/hdm-usb/hdm_usb.c

Quoted 1 line
drivers/staging/most/hdm-usb/hdm_usb.c +0 -0

[]

Quoted 13 lines
Quoted 12 lines
Quoted 10 lines

drivers/staging/most/hdm-usb/hdm_usb.c struct most_dev { · line 125

Quoted 6 lines
drivers/staging/most/hdm-usb/hdm_usb.c +1 -1
@@ -122,7 +122,7 @@ struct most_dev {
      bool is_channel_healthy[MAX_NUM_ENDPOINTS];
      struct clear_hold_work clear_work[MAX_NUM_ENDPOINTS];
      struct usb_anchor *busy_urbs;
-     struct mutex io_mutex;
+     struct mutex io_mutex; /* synchronize I/O with disconnect */

Why did you choose this comment?

julia

The use of this struct mutex was mentioned before in the code.

Quoted 8 lines
Quoted 3 lines

I see that it is just in the doc of the same structure. I'm not sure that a double comment is needed in this case. I wonder if checkpatch should/could be extended to address this.

I think that's not feasible.

checkpatch is a patch context based check and wouldn't necessarily know that the mutex is documented elsewhere.

OK. It doesn't keep any history? The kerneldoc is before the structure field declaration.

julia

#6 lore raw
Quoted 32 lines · Julia Lawall
Quoted 29 lines · Joe Perches
Quoted 6 lines · Julia Lawall
Quoted 5 lines · Aastha Gupta
Quoted 4 lines · Julia Lawall
Quoted 2 lines · Aastha Gupta

This patch fixes following checkpatch.pl checks:
CHECK: struct mutex definition without comment

[]

Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/staging/most/hdm-usb/hdm_usb.c

Quoted 1 line
drivers/staging/most/hdm-usb/hdm_usb.c +0 -0

[]

Quoted 16 lines
Quoted 9 lines
Quoted 9 lines

drivers/staging/most/hdm-usb/hdm_usb.c struct most_dev { · line 125

Quoted 6 lines
drivers/staging/most/hdm-usb/hdm_usb.c +1 -1
@@ -122,7 +122,7 @@ struct most_dev {
      bool is_channel_healthy[MAX_NUM_ENDPOINTS];
      struct clear_hold_work clear_work[MAX_NUM_ENDPOINTS];
      struct usb_anchor *busy_urbs;
-     struct mutex io_mutex;
+     struct mutex io_mutex; /* synchronize I/O with disconnect */

Why did you choose this comment?

Quoted 3 lines
Quoted 1 line

julia

The use of this struct mutex was mentioned before in the code.

I see that it is just in the doc of the same structure. I'm not sure that a double comment is needed in this case. I wonder if checkpatch should/could be extended to address this.

Quoted 7 lines
Quoted 4 lines

I think that's not feasible.

checkpatch is a patch context based check and wouldn't necessarily know that the mutex is documented elsewhere.

OK. It doesn't keep any history? The kerneldoc is before the structure field declaration.

checkpatch reads and stores its input.

checkpatch is, with very few exceptions, a line based regex scanner.

An input patch context is typically 3 lines above and below modified content.

Whatever context outside of that +/- 3 is unavailable.

Kernel-doc comments are not parsed by checkpatch as anything special.

checkpatch code that looks for specific comments looks only at whether or not a particular block has a comment at all, not the specific content of the comment.

The checkpatch function test is ctx_has_comment

You are welcome to try to expand the code but I think there are better possible tools for this.

#7 lore raw
Quoted 54 lines · Joe Perches
Quoted 32 lines · Julia Lawall
Quoted 29 lines · Joe Perches
Quoted 6 lines · Julia Lawall
Quoted 5 lines · Aastha Gupta
Quoted 4 lines · Julia Lawall
Quoted 2 lines · Aastha Gupta

This patch fixes following checkpatch.pl checks:
CHECK: struct mutex definition without comment

[]

Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/staging/most/hdm-usb/hdm_usb.c

Quoted 1 line
drivers/staging/most/hdm-usb/hdm_usb.c +0 -0

[]

Quoted 16 lines
Quoted 9 lines
Quoted 9 lines

drivers/staging/most/hdm-usb/hdm_usb.c struct most_dev { · line 125

Quoted 6 lines
drivers/staging/most/hdm-usb/hdm_usb.c +1 -1
@@ -122,7 +122,7 @@ struct most_dev {
      bool is_channel_healthy[MAX_NUM_ENDPOINTS];
      struct clear_hold_work clear_work[MAX_NUM_ENDPOINTS];
      struct usb_anchor *busy_urbs;
-     struct mutex io_mutex;
+     struct mutex io_mutex; /* synchronize I/O with disconnect */

Why did you choose this comment?

Quoted 3 lines
Quoted 1 line

julia

The use of this struct mutex was mentioned before in the code.

I see that it is just in the doc of the same structure. I'm not sure that a double comment is needed in this case. I wonder if checkpatch should/could be extended to address this.

Quoted 7 lines
Quoted 4 lines

I think that's not feasible.

checkpatch is a patch context based check and wouldn't necessarily know that the mutex is documented elsewhere.

OK. It doesn't keep any history? The kerneldoc is before the structure field declaration.

checkpatch reads and stores its input.

checkpatch is, with very few exceptions, a line based regex scanner.

An input patch context is typically 3 lines above and below modified content.

Whatever context outside of that +/- 3 is unavailable.

Kernel-doc comments are not parsed by checkpatch as anything special.

Quoted 8 lines

checkpatch code that looks for specific comments looks only at whether or not a particular block has a comment at all, not the specific content of the comment.

The checkpatch function test is ctx_has_comment

You are welcome to try to expand the code but I think there are better possible tools for this.

OK, thanks.

julia