Skip to contentSkip to conversation

staging: greybus: uart: add comments to locks and fix alignment

PATCH In review Rahul Joshi 3 participants 3 messages Mar 11 – Mar 16

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

PATCH 1/1 staging: greybus: uart: add comments to locks and fix alignment

The spinlock_t and struct mutex members in struct gb_tty lack comments describing what they protect, which is required by the kernel coding style.

Also fix the alignment of the wait_for_completion_timeout() call in gb_uart_wait_for_all_credits() to match the open parenthesis.

---
 drivers/staging/greybus/uart.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/greybus/uart.c +4 -4
index 7d060b4cd33d..52a84a68049c 100644
@@ -50,12 +50,12 @@ struct gb_tty {
 	unsigned int minor;
 	unsigned char clocal;
 	bool disconnected;
-	spinlock_t read_lock;
-	spinlock_t write_lock;
+	spinlock_t read_lock;	/* protects iocount and oldcount */
+	spinlock_t write_lock;	/* protects write_fifo and credits */
 	struct async_icount iocount;
 	struct async_icount oldcount;
 	wait_queue_head_t wioctl;
-	struct mutex mutex;
+	struct mutex mutex;	/* protects disconnected flag and device state */
 	u8 ctrlin;	/* input control lines */
 	u8 ctrlout;	/* output control lines */
 	struct gb_uart_set_line_coding_request line_coding;
@@ -318,7 +318,7 @@ static int gb_uart_wait_for_all_credits(struct gb_tty *gb_tty)
 		return 0;
 
 	ret = wait_for_completion_timeout(&gb_tty->credits_complete,
-			msecs_to_jiffies(GB_UART_CREDIT_WAIT_TIMEOUT_MSEC));
+					  msecs_to_jiffies(GB_UART_CREDIT_WAIT_TIMEOUT_MSEC));
 	if (!ret) {
 		dev_err(&gb_tty->gbphy_dev->dev,
 			"time out waiting for credits\n");
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 6 lines · Rahul Joshi

The spinlock_t and struct mutex members in struct gb_tty lack comments describing what they protect, which is required by the kernel coding style.

Also fix the alignment of the wait_for_completion_timeout() call in gb_uart_wait_for_all_credits() to match the open parenthesis.

Each patch can only do 1 thing, when you say "Also" that's a huge hint that something should be split up.

But, in this case, all of these changes have been rejected previously, see the mailing list archives for details.

thanks,

greg k-h

#2 lore raw
In reply to Rahul Joshi
Quoted 17 lines · Rahul Joshi

The spinlock_t and struct mutex members in struct gb_tty lack comments describing what they protect, which is required by the kernel coding style.

Also fix the alignment of the wait_for_completion_timeout() call in gb_uart_wait_for_all_credits() to match the open parenthesis.

---
 drivers/staging/greybus/uart.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/greybus/uart.c +0 -0
index 7d060b4cd33d..52a84a68049c 100644

drivers/staging/greybus/uart.c struct gb_tty { · line 54

Quoted 7 lines
drivers/staging/greybus/uart.c +2 -2
@@ -50,12 +50,12 @@ struct gb_tty {
 	unsigned int minor;
 	unsigned char clocal;
 	bool disconnected;
-	spinlock_t read_lock;
-	spinlock_t write_lock;
+	spinlock_t read_lock;	/* protects iocount and oldcount */
+	spinlock_t write_lock;	/* protects write_fifo and credits */

https://lore.kernel.org/all/[email protected]/

How on earth could you have come up with the exact same words here that someone else did? It feels like too large of a coincidence.

regards,
dan carpenter