linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] spi: omap-100k: Style Fixes
@ 2013-11-28  4:27 Thomas Behan
  2013-11-28  4:27 ` [PATCH 1/4] spi: omap-100k: Fixed spacing on while loops Thomas Behan
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Thomas Behan @ 2013-11-28  4:27 UTC (permalink / raw)
  To: linux-spi; +Cc: broonie, linux-kernel, Thomas Behan

First time contributer here submitting some style fixes. 

I watched Greg Kroah-Hartman's youtube video about getting started with
submitting patches and thought I would give it a try. I fixed up some errors
and warnings that checkpatch.pl was giving. All patches are based off of
linux-next.

Any feedback is much appreciated.

Thomas Behan (4):
  spi: omap-100k: Fixed spacing on while loops
  spi: omap-100k: Fixed spacing on -= operators
  spi: omap-100k: Fixed spacing on commas
  spi: omap-100k: Fixed style of sizeof operators

 drivers/spi/spi-omap-100k.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

-- 
1.8.1.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] spi: omap-100k: Fixed spacing on while loops
  2013-11-28  4:27 [PATCH 0/4] spi: omap-100k: Style Fixes Thomas Behan
@ 2013-11-28  4:27 ` Thomas Behan
  2013-11-28  4:27 ` [PATCH 2/4] spi: omap-100k: Fixed spacing on -= operators Thomas Behan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Behan @ 2013-11-28  4:27 UTC (permalink / raw)
  To: linux-spi; +Cc: broonie, linux-kernel, Thomas Behan

checkpatch.pl generated several errors from "while(" statements which should
have read "while (" to comply with the style guide. These errors have been
fixed.

Signed-off-by: Thomas Behan <thomas.behan@gmail.com>
---
 drivers/spi/spi-omap-100k.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c
index b6ed82b..bdf6696 100644
--- a/drivers/spi/spi-omap-100k.c
+++ b/drivers/spi/spi-omap-100k.c
@@ -147,7 +147,7 @@ static void spi100k_write_data(struct spi_master *master, int len, int data)
 	       spi100k->base + SPI_CTRL);
 
 	/* Wait for bit ack send change */
-	while((readw(spi100k->base + SPI_STATUS) & SPI_STATUS_WE) != SPI_STATUS_WE);
+	while ((readw(spi100k->base + SPI_STATUS) & SPI_STATUS_WE) != SPI_STATUS_WE);
 	udelay(1000);
 
 	spi100k_disable_clock(master);
@@ -168,7 +168,7 @@ static int spi100k_read_data(struct spi_master *master, int len)
 	       SPI_CTRL_RD,
 	       spi100k->base + SPI_CTRL);
 
-	while((readw(spi100k->base + SPI_STATUS) & SPI_STATUS_RD) != SPI_STATUS_RD);
+	while ((readw(spi100k->base + SPI_STATUS) & SPI_STATUS_RD) != SPI_STATUS_RD);
 	udelay(1000);
 
 	dataL = readw(spi100k->base + SPI_RX_LSB);
@@ -226,7 +226,7 @@ omap1_spi100k_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
 				spi100k_write_data(spi->master, word_len, *tx++);
 			if (xfer->rx_buf != NULL)
 				*rx++ = spi100k_read_data(spi->master, word_len);
-		} while(c);
+		} while (c);
 	} else if (word_len <= 16) {
 		u16             *rx;
 		const u16       *tx;
@@ -239,7 +239,7 @@ omap1_spi100k_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
 				spi100k_write_data(spi->master,word_len, *tx++);
 			if (xfer->rx_buf != NULL)
 				*rx++ = spi100k_read_data(spi->master,word_len);
-		} while(c);
+		} while (c);
 	} else if (word_len <= 32) {
 		u32             *rx;
 		const u32       *tx;
@@ -252,7 +252,7 @@ omap1_spi100k_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
 				spi100k_write_data(spi->master,word_len, *tx);
 			if (xfer->rx_buf != NULL)
 				*rx = spi100k_read_data(spi->master,word_len);
-		} while(c);
+		} while (c);
 	}
 	return count - c;
 }
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] spi: omap-100k: Fixed spacing on -= operators
  2013-11-28  4:27 [PATCH 0/4] spi: omap-100k: Style Fixes Thomas Behan
  2013-11-28  4:27 ` [PATCH 1/4] spi: omap-100k: Fixed spacing on while loops Thomas Behan
@ 2013-11-28  4:27 ` Thomas Behan
  2013-11-28  4:27 ` [PATCH 3/4] spi: omap-100k: Fixed spacing on commas Thomas Behan
  2013-11-28  4:27 ` [PATCH 4/4] spi: omap-100k: Fixed style of sizeof operators Thomas Behan
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Behan @ 2013-11-28  4:27 UTC (permalink / raw)
  To: linux-spi; +Cc: broonie, linux-kernel, Thomas Behan

checkpatch.pl generated 3 errors from "x-=" statements which should have read
"x -= x" to comply with the style guide. These errors have been fixed.

Signed-off-by: Thomas Behan <thomas.behan@gmail.com>
---
 drivers/spi/spi-omap-100k.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c
index bdf6696..5db8d2a 100644
--- a/drivers/spi/spi-omap-100k.c
+++ b/drivers/spi/spi-omap-100k.c
@@ -221,7 +221,7 @@ omap1_spi100k_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
 		rx = xfer->rx_buf;
 		tx = xfer->tx_buf;
 		do {
-			c-=1;
+			c -= 1;
 			if (xfer->tx_buf != NULL)
 				spi100k_write_data(spi->master, word_len, *tx++);
 			if (xfer->rx_buf != NULL)
@@ -234,7 +234,7 @@ omap1_spi100k_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
 		rx = xfer->rx_buf;
 		tx = xfer->tx_buf;
 		do {
-			c-=2;
+			c -= 2;
 			if (xfer->tx_buf != NULL)
 				spi100k_write_data(spi->master,word_len, *tx++);
 			if (xfer->rx_buf != NULL)
@@ -247,7 +247,7 @@ omap1_spi100k_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
 		rx = xfer->rx_buf;
 		tx = xfer->tx_buf;
 		do {
-			c-=4;
+			c -= 4;
 			if (xfer->tx_buf != NULL)
 				spi100k_write_data(spi->master,word_len, *tx);
 			if (xfer->rx_buf != NULL)
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] spi: omap-100k: Fixed spacing on commas
  2013-11-28  4:27 [PATCH 0/4] spi: omap-100k: Style Fixes Thomas Behan
  2013-11-28  4:27 ` [PATCH 1/4] spi: omap-100k: Fixed spacing on while loops Thomas Behan
  2013-11-28  4:27 ` [PATCH 2/4] spi: omap-100k: Fixed spacing on -= operators Thomas Behan
@ 2013-11-28  4:27 ` Thomas Behan
  2013-11-28  4:27 ` [PATCH 4/4] spi: omap-100k: Fixed style of sizeof operators Thomas Behan
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Behan @ 2013-11-28  4:27 UTC (permalink / raw)
  To: linux-spi; +Cc: broonie, linux-kernel, Thomas Behan

checkpatch.pl generated 5 errors due to missing spaces after commas. These
errors have been fixed.

Signed-off-by: Thomas Behan <thomas.behan@gmail.com>
---
 drivers/spi/spi-omap-100k.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c
index 5db8d2a..fcd783c 100644
--- a/drivers/spi/spi-omap-100k.c
+++ b/drivers/spi/spi-omap-100k.c
@@ -155,7 +155,7 @@ static void spi100k_write_data(struct spi_master *master, int len, int data)
 
 static int spi100k_read_data(struct spi_master *master, int len)
 {
-	int dataH,dataL;
+	int dataH, dataL;
 	struct omap1_spi100k *spi100k = spi_master_get_devdata(master);
 
 	/* Always do at least 16 bits */
@@ -236,9 +236,9 @@ omap1_spi100k_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
 		do {
 			c -= 2;
 			if (xfer->tx_buf != NULL)
-				spi100k_write_data(spi->master,word_len, *tx++);
+				spi100k_write_data(spi->master, word_len, *tx++);
 			if (xfer->rx_buf != NULL)
-				*rx++ = spi100k_read_data(spi->master,word_len);
+				*rx++ = spi100k_read_data(spi->master, word_len);
 		} while (c);
 	} else if (word_len <= 32) {
 		u32             *rx;
@@ -249,9 +249,9 @@ omap1_spi100k_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
 		do {
 			c -= 4;
 			if (xfer->tx_buf != NULL)
-				spi100k_write_data(spi->master,word_len, *tx);
+				spi100k_write_data(spi->master, word_len, *tx);
 			if (xfer->rx_buf != NULL)
-				*rx = spi100k_read_data(spi->master,word_len);
+				*rx = spi100k_read_data(spi->master, word_len);
 		} while (c);
 	}
 	return count - c;
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] spi: omap-100k: Fixed style of sizeof operators
  2013-11-28  4:27 [PATCH 0/4] spi: omap-100k: Style Fixes Thomas Behan
                   ` (2 preceding siblings ...)
  2013-11-28  4:27 ` [PATCH 3/4] spi: omap-100k: Fixed spacing on commas Thomas Behan
@ 2013-11-28  4:27 ` Thomas Behan
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Behan @ 2013-11-28  4:27 UTC (permalink / raw)
  To: linux-spi; +Cc: broonie, linux-kernel, Thomas Behan

checkpatch.pl generated 2 warning due to "sizeof x" being used instead of
"sizeof(x)". These warnings have been fixed.

Signed-off-by: Thomas Behan <thomas.behan@gmail.com>
---
 drivers/spi/spi-omap-100k.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c
index fcd783c..2516379 100644
--- a/drivers/spi/spi-omap-100k.c
+++ b/drivers/spi/spi-omap-100k.c
@@ -294,7 +294,7 @@ static int omap1_spi100k_setup(struct spi_device *spi)
 	spi100k = spi_master_get_devdata(spi->master);
 
 	if (!cs) {
-		cs = kzalloc(sizeof *cs, GFP_KERNEL);
+		cs = kzalloc(sizeof(*cs), GFP_KERNEL);
 		if (!cs)
 			return -ENOMEM;
 		cs->base = spi100k->base + spi->chip_select * 0x14;
@@ -411,7 +411,7 @@ static int omap1_spi100k_probe(struct platform_device *pdev)
 	if (!pdev->id)
 		return -EINVAL;
 
-	master = spi_alloc_master(&pdev->dev, sizeof *spi100k);
+	master = spi_alloc_master(&pdev->dev, sizeof(*spi100k));
 	if (master == NULL) {
 		dev_dbg(&pdev->dev, "master allocation failed\n");
 		return -ENOMEM;
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-11-28  4:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-28  4:27 [PATCH 0/4] spi: omap-100k: Style Fixes Thomas Behan
2013-11-28  4:27 ` [PATCH 1/4] spi: omap-100k: Fixed spacing on while loops Thomas Behan
2013-11-28  4:27 ` [PATCH 2/4] spi: omap-100k: Fixed spacing on -= operators Thomas Behan
2013-11-28  4:27 ` [PATCH 3/4] spi: omap-100k: Fixed spacing on commas Thomas Behan
2013-11-28  4:27 ` [PATCH 4/4] spi: omap-100k: Fixed style of sizeof operators Thomas Behan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).