Skip to contentSkip to conversation

Staging: rts5208: Shortened lines > 80 chars and aligned function args

PATCH In review Kim Bradley 2 participants 2 messages Oct 26, 2018 – Oct 30, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: rts5208: Shortened lines > 80 chars and aligned function args

Reducing lines to < 80 characters and align function arguments wherever possible. Most of these issues appear due to the long function name 'wait_for_completion_interruptible_timeout' for which a TODO is noted.

---
 drivers/staging/rts5208/TODO             |  5 ++++-
 drivers/staging/rts5208/rtsx_transport.c | 28 +++++++++++++-----------
 2 files changed, 19 insertions(+), 14 deletions(-)
drivers/staging/rts5208/TODO +4 -1
index 57bcf5834c0c..67f0c8372d96 100644
@@ -1,7 +1,10 @@
 TODO:
 - use kernel coding style
 - checkpatch.pl fixes
+  --> Consider renaming 'wait_for_completion_interruptible_timeout'
+      function in rtsx_transport as it causes many lines to
+      overflow past 80 characters and/or alignment issues
 - We will use the stack in drivers/mmc to implement
   rts5208/5288 in the future
 
-Micky Ching <[email protected]>
\ No newline at end of file
+Micky Ching <[email protected]>
drivers/staging/rts5208/rtsx_transport.c +15 -13
index 8277d7895608..de9d9eec963f 100644
@@ -257,8 +257,8 @@ int rtsx_send_cmd(struct rtsx_chip *chip, u8 card, int timeout)
 	spin_unlock_irq(&rtsx->reg_lock);
 
 	/* Wait for TRANS_OK_INT */
-	timeleft = wait_for_completion_interruptible_timeout(
-		&trans_done, msecs_to_jiffies(timeout));
+	timeleft = wait_for_completion_interruptible_timeout(&trans_done,
+						msecs_to_jiffies(timeout));
 	if (timeleft <= 0) {
 		dev_dbg(rtsx_dev(chip), "chip->int_reg = 0x%x\n",
 			chip->int_reg);
@@ -284,8 +284,8 @@ int rtsx_send_cmd(struct rtsx_chip *chip, u8 card, int timeout)
 	return err;
 }
 
-static inline void rtsx_add_sg_tbl(
-	struct rtsx_chip *chip, u32 addr, u32 len, u8 option)
+static inline void rtsx_add_sg_tbl(struct rtsx_chip *chip, u32 addr,
+				   u32 len, u8 option)
 {
 	__le64 *sgb = (__le64 *)(chip->host_sg_tbl_ptr);
 	u64 val = 0;
@@ -394,7 +394,8 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card,
 			*index = *index + 1;
 		}
 		if ((i == (sg_cnt - 1)) || !resid)
-			option = RTSX_SG_VALID | RTSX_SG_END | RTSX_SG_TRANS_DATA;
+			option = RTSX_SG_VALID | RTSX_SG_END |
+				 RTSX_SG_TRANS_DATA;
 		else
 			option = RTSX_SG_VALID | RTSX_SG_TRANS_DATA;
 
@@ -420,8 +421,8 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card,
 
 	spin_unlock_irq(&rtsx->reg_lock);
 
-	timeleft = wait_for_completion_interruptible_timeout(
-		&trans_done, msecs_to_jiffies(timeout));
+	timeleft = wait_for_completion_interruptible_timeout(&trans_done,
+						     msecs_to_jiffies(timeout));
 	if (timeleft <= 0) {
 		dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
 			__func__, __LINE__);
@@ -445,7 +446,7 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card,
 		init_completion(&trans_done);
 		spin_unlock_irq(&rtsx->reg_lock);
 		timeleft = wait_for_completion_interruptible_timeout(
-			&trans_done, msecs_to_jiffies(timeout));
+					&trans_done, msecs_to_jiffies(timeout));
 		if (timeleft <= 0) {
 			dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
 				__func__, __LINE__);
@@ -542,7 +543,8 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip *chip, u8 card,
 				(unsigned int)addr, len);
 
 			if (j == (sg_cnt - 1))
-				option = RTSX_SG_VALID | RTSX_SG_END | RTSX_SG_TRANS_DATA;
+				option = RTSX_SG_VALID | RTSX_SG_END |
+					 RTSX_SG_TRANS_DATA;
 			else
 				option = RTSX_SG_VALID | RTSX_SG_TRANS_DATA;
 
@@ -566,7 +568,7 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip *chip, u8 card,
 		spin_unlock_irq(&rtsx->reg_lock);
 
 		timeleft = wait_for_completion_interruptible_timeout(
-			&trans_done, msecs_to_jiffies(timeout));
+					&trans_done, msecs_to_jiffies(timeout));
 		if (timeleft <= 0) {
 			dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
 				__func__, __LINE__);
@@ -593,7 +595,7 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip *chip, u8 card,
 		init_completion(&trans_done);
 		spin_unlock_irq(&rtsx->reg_lock);
 		timeleft = wait_for_completion_interruptible_timeout(
-			&trans_done, msecs_to_jiffies(timeout));
+					&trans_done, msecs_to_jiffies(timeout));
 		if (timeleft <= 0) {
 			dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
 				__func__, __LINE__);
@@ -679,8 +681,8 @@ static int rtsx_transfer_buf(struct rtsx_chip *chip, u8 card, void *buf,
 	spin_unlock_irq(&rtsx->reg_lock);
 
 	/* Wait for TRANS_OK_INT */
-	timeleft = wait_for_completion_interruptible_timeout(
-		&trans_done, msecs_to_jiffies(timeout));
+	timeleft = wait_for_completion_interruptible_timeout(&trans_done,
+						     msecs_to_jiffies(timeout));
 	if (timeleft <= 0) {
 		dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
 			__func__, __LINE__);
Signature · 1 line
2.19.1
#1 lore raw
Quoted 16 lines · Kim Bradley

Reducing lines to < 80 characters and align function arguments wherever possible. Most of these issues appear due to the long function name 'wait_for_completion_interruptible_timeout' for which a TODO is noted.

---
 drivers/staging/rts5208/TODO             |  5 ++++-
 drivers/staging/rts5208/rtsx_transport.c | 28 +++++++++++++-----------
 2 files changed, 19 insertions(+), 14 deletions(-)
drivers/staging/rts5208/TODO +0 -0
index 57bcf5834c0c..67f0c8372d96 100644

drivers/staging/rts5208/TODO line 6

Quoted 6 lines
drivers/staging/rts5208/TODO +3 -0
@@ -1,7 +1,10 @@
 TODO:
 - use kernel coding style
 - checkpatch.pl fixes
+  --> Consider renaming 'wait_for_completion_interruptible_timeout'
+      function in rtsx_transport as it causes many lines to
+      overflow past 80 characters and/or alignment issues

This is a core kernel function, you can't fix that up within a single staging driver, the whole kernel would have to be have the function renamed.

So I can't take this patch because this isn't a valid TODO item, sorry,

greg k-h