Skip to contentSkip to conversation

Enhance code formatting

PATCH In review Tamara Diaconita 2 participants 6 messages Mar 11, 2017 Staging

lore
Share & tools
lore
#0 lore raw

cover Enhance code formatting

Trims lines size at 80 characters to fix the checkpatch.pl warning:
WARNING: line over 80 characters.

Tamara Diaconita (3):
staging: wilc1000: Use kernel preferred commenting style
staging: wilc1000: Removing extra tabs
staging: wilc1000: Rearrange code

 drivers/staging/wilc1000/wilc_spi.c | 53 +++++++++++++++++++++++--------------
 1 file changed, 33 insertions(+), 20 deletions(-)
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/3 staging: wilc1000: Use kernel preferred commenting style

Trims line size at 80 characters by moving parts of some comments in new lines.

Problem found with checkpatch.pl

---
 drivers/staging/wilc1000/wilc_spi.c | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)
drivers/staging/wilc1000/wilc_spi.c +19 -9
index 5687f9a..a1b0296 100644
@@ -464,7 +464,9 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,
 		 **/
 		retry = 100;
 		do {
-			/* ensure there is room in buffer later to read data and crc */
+			/* ensure there is room in buffer later to
+			 * read data and crc
+			 */
 			if (rix < len2) {
 				rsp = rb[rix++];
 			} else {
@@ -549,7 +551,9 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,
 				sz -= nbytes;
 			}
 
-			/*  if any data in left unread, then read the rest using normal DMA code.*/
+			/*  if any data in left unread, then read the rest
+			 *  using normal DMA code.
+			 */
 			while (sz > 0) {
 				int nbytes;
 
@@ -559,9 +563,10 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,
 					nbytes = DATA_PKT_SZ;
 
 				/**
-				 * read data response only on the next DMA cycles not
-				 * the first DMA since data response header is already
-				 * handled above for the first DMA.
+				 * read data response only on the next DMA
+				 * cycles not the first DMA since data response
+				 * header is already handled above for the
+				 * first DMA.
 				 **/
 				/**
 				 * Data Respnose header
@@ -855,8 +860,9 @@ static int wilc_spi_init(struct wilc *wilc, bool resume)
 	 **/
 	g_spi.crc_off = 0;
 
-	/* TODO: We can remove the CRC trials if there is a definite way to reset */
-	/* the SPI to it's initial value. */
+	/* TODO: We can remove the CRC trials if there is a definite
+	 * way to reset the SPI to it's initial value.
+	 */
 	if (!spi_internal_read(wilc, WILC_SPI_PROTOCOL_OFFSET, &reg)) {
 		/* Read failed. Try with CRC off. This might happen when module
 		 * is removed but chip isn't reset
@@ -864,7 +870,9 @@ static int wilc_spi_init(struct wilc *wilc, bool resume)
 		g_spi.crc_off = 1;
 		dev_err(&spi->dev, "Failed internal read protocol with CRC on, retrying with CRC off...\n");
 		if (!spi_internal_read(wilc, WILC_SPI_PROTOCOL_OFFSET, &reg)) {
-			/* Reaad failed with both CRC on and off, something went bad */
+			/* Reaad failed with both CRC on and off,
+			 * something went bad
+			 */
 			dev_err(&spi->dev,
 				"Failed internal read protocol...\n");
 			return 0;
@@ -995,7 +1003,9 @@ static int wilc_spi_clear_int_ext(struct wilc *wilc, u32 val)
 
 			ret = 1;
 			for (i = 0; i < g_spi.nint; i++) {
-				/* No matter what you write 1 or 0, it will clear interrupt. */
+				/* No matter what you write 1 or 0,
+				 * it will clear interrupt.
+				 */
 				if (flags & 1)
 					ret = wilc_spi_write_reg(wilc, 0x10c8 + i * 4, 1);
 				if (!ret)
Signature · 1 line
2.9.3
#2 lore raw

PATCH 2/3 staging: wilc1000: Removing extra tabs

In reply to Tamara Diaconita

Trims line size at 80 characters by removing extra tabs and extra '/'.

---
 drivers/staging/wilc1000/wilc_spi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/wilc1000/wilc_spi.c +5 -5
index 667164c..5687f9a 100644
@@ -5,7 +5,7 @@
 /* Module Name:  wilc_spi.c */
 /*  */
 /*  */
-/* //////////////////////////////////////////////////////////////////////////// */
+/* ////////////////////////////////////////////////////////////////////////// */
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -291,7 +291,7 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,
 
 	wb[0] = cmd;
 	switch (cmd) {
-	case CMD_SINGLE_READ:                           /* single word (4 bytes) read */
+	case CMD_SINGLE_READ: /* single word (4 bytes) read */
 		wb[1] = (u8)(adr >> 16);
 		wb[2] = (u8)(adr >> 8);
 		wb[3] = (u8)adr;
@@ -307,21 +307,21 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,
 		len = 5;
 		break;
 
-	case CMD_TERMINATE:                                     /* termination */
+	case CMD_TERMINATE: /* termination */
 		wb[1] = 0x00;
 		wb[2] = 0x00;
 		wb[3] = 0x00;
 		len = 5;
 		break;
 
-	case CMD_REPEAT:                                                /* repeat */
+	case CMD_REPEAT: /* repeat */
 		wb[1] = 0x00;
 		wb[2] = 0x00;
 		wb[3] = 0x00;
 		len = 5;
 		break;
 
-	case CMD_RESET:                                                 /* reset */
+	case CMD_RESET: /* reset */
 		wb[1] = 0xff;
 		wb[2] = 0xff;
 		wb[3] = 0xff;
Signature · 1 line
2.9.3
#3 lore raw

PATCH 3/3 staging: wilc1000: Rearrange code

In reply to Tamara Diaconita

Trims line size at 80 characters by splitting the lines to improve code readability.

Problem found with checkpatch.pl.

---
 drivers/staging/wilc1000/wilc_spi.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/staging/wilc1000/wilc_spi.c +9 -6
index a1b0296..298a30d 100644
@@ -397,11 +397,12 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,
 		len2 = len + (NUM_SKIP_BYTES + NUM_RSP_BYTES + NUM_DUMMY_BYTES);
 	} else if ((cmd == CMD_INTERNAL_READ) || (cmd == CMD_SINGLE_READ)) {
 		if (!g_spi.crc_off) {
-			len2 = len + (NUM_RSP_BYTES + NUM_DATA_HDR_BYTES + NUM_DATA_BYTES
-				      + NUM_CRC_BYTES + NUM_DUMMY_BYTES);
+			len2 = len + (NUM_RSP_BYTES + NUM_DATA_HDR_BYTES +
+				      NUM_DATA_BYTES + NUM_CRC_BYTES +
+				      NUM_DUMMY_BYTES);
 		} else {
-			len2 = len + (NUM_RSP_BYTES + NUM_DATA_HDR_BYTES + NUM_DATA_BYTES
-				      + NUM_DUMMY_BYTES);
+			len2 = len + (NUM_RSP_BYTES + NUM_DATA_HDR_BYTES +
+				      NUM_DATA_BYTES + NUM_DUMMY_BYTES);
 		}
 	} else {
 		len2 = len + (NUM_RSP_BYTES + NUM_DUMMY_BYTES);
@@ -967,7 +968,8 @@ static int wilc_spi_read_int(struct wilc *wilc, u32 *int_status)
 			if (g_spi.nint > 5) {
 				wilc_spi_read_reg(wilc, 0x1a94,
 						  &irq_flags);
-				tmp |= (((irq_flags >> 0) & 0x7) << (IRG_FLAGS_OFFSET + 5));
+				tmp |= (((irq_flags >> 0) & 0x7) <<
+					  (IRG_FLAGS_OFFSET + 5));
 			}
 
 			unknown_mask = ~((1ul << g_spi.nint) - 1);
@@ -1007,7 +1009,8 @@ static int wilc_spi_clear_int_ext(struct wilc *wilc, u32 val)
 				 * it will clear interrupt.
 				 */
 				if (flags & 1)
-					ret = wilc_spi_write_reg(wilc, 0x10c8 + i * 4, 1);
+					ret = wilc_spi_write_reg(wilc, 0x10c8 +
+								 i * 4, 1);
 				if (!ret)
 					break;
 				flags >>= 1;
Signature · 1 line
2.9.3
#4 lore raw
In reply to Tamara Diaconita

The subject line of the cover letter needs to include the name of the subsystem affected, like all of the ther patches in the series.

julia

Quoted 21 lines · Tamara Diaconita

Trims lines size at 80 characters to fix the checkpatch.pl warning:
WARNING: line over 80 characters.

Tamara Diaconita (3):
staging: wilc1000: Use kernel preferred commenting style
staging: wilc1000: Removing extra tabs
staging: wilc1000: Rearrange code

 drivers/staging/wilc1000/wilc_spi.c | 53 +++++++++++++++++++++++--------------
 1 file changed, 33 insertions(+), 20 deletions(-)

--
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/20170311140725.18461-1-diaconita.tamara%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#5 lore raw
In reply to Tamara Diaconita
Quoted 7 lines · Tamara Diaconita

Trims lines size at 80 characters to fix the checkpatch.pl warning:
WARNING: line over 80 characters.

Tamara Diaconita (3):
staging: wilc1000: Use kernel preferred commenting style
staging: wilc1000: Removing extra tabs
staging: wilc1000: Rearrange code

The patches in this series appear to build on top of the patches you sent in a previous series. If you want to do that, you have to put them all in a single series, so that one knows the order in which to apply them.

julia

Quoted 14 lines
 drivers/staging/wilc1000/wilc_spi.c | 53 +++++++++++++++++++++++--------------
 1 file changed, 33 insertions(+), 20 deletions(-)

--
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/20170311140725.18461-1-diaconita.tamara%40gmail.com.
For more options, visit https://groups.google.com/d/optout.