linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Minor style issue fixes for staging/kpc2000
@ 2019-06-25  8:41 Simon Sandström
  2019-06-25  8:41 ` [PATCH 1/4] staging: kpc2000: add missing spaces in kpc2000_i2c.c Simon Sandström
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Simon Sandström @ 2019-06-25  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: gneukum1, devel, linux-kernel, Simon Sandström

Hi,

Here are some fixes for minor space, parenthese and brace issues in
kpc2000 reported by checkpatch.pl.

- Simon

Simon Sandström (4):
  staging: kpc2000: add missing spaces in kpc2000_i2c.c
  staging: kpc2000: add missing spaces in kpc2000_spi.c
  staging: kpc2000: remove unnecessary parentheses in kpc2000_spi.c
  staging: kpc2000: fix brace issues in kpc2000_spi.c

 drivers/staging/kpc2000/kpc2000_i2c.c |  6 +++---
 drivers/staging/kpc2000/kpc2000_spi.c | 18 ++++++++----------
 2 files changed, 11 insertions(+), 13 deletions(-)

-- 
2.20.1


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

* [PATCH 1/4] staging: kpc2000: add missing spaces in kpc2000_i2c.c
  2019-06-25  8:41 [PATCH 0/4] Minor style issue fixes for staging/kpc2000 Simon Sandström
@ 2019-06-25  8:41 ` Simon Sandström
  2019-06-25  8:41 ` [PATCH 2/4] staging: kpc2000: add missing spaces in kpc2000_spi.c Simon Sandström
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Simon Sandström @ 2019-06-25  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: gneukum1, devel, linux-kernel, Simon Sandström

Fixes checkpatch "CHECK: spaces preferred around that '+' (ctx:VxV)".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
---
 drivers/staging/kpc2000/kpc2000_i2c.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/kpc2000/kpc2000_i2c.c b/drivers/staging/kpc2000/kpc2000_i2c.c
index 69e8773c1ef8..3e08df9f205d 100644
--- a/drivers/staging/kpc2000/kpc2000_i2c.c
+++ b/drivers/staging/kpc2000/kpc2000_i2c.c
@@ -257,7 +257,7 @@ static int i801_block_transaction_by_block(struct i2c_device *priv, union i2c_sm
 		len = data->block[0];
 		outb_p(len, SMBHSTDAT0(priv));
 		for (i = 0; i < len; i++)
-			outb_p(data->block[i+1], SMBBLKDAT(priv));
+			outb_p(data->block[i + 1], SMBBLKDAT(priv));
 	}
 
 	status = i801_transaction(priv, I801_BLOCK_DATA | ENABLE_INT9 | I801_PEC_EN * hwpec);
@@ -337,8 +337,8 @@ static int i801_block_transaction_byte_by_byte(struct i2c_device *priv, union i2
 		/* Retrieve/store value in SMBBLKDAT */
 		if (read_write == I2C_SMBUS_READ)
 			data->block[i] = inb_p(SMBBLKDAT(priv));
-		if (read_write == I2C_SMBUS_WRITE && i+1 <= len)
-			outb_p(data->block[i+1], SMBBLKDAT(priv));
+		if (read_write == I2C_SMBUS_WRITE && i + 1 <= len)
+			outb_p(data->block[i + 1], SMBBLKDAT(priv));
 		/* signals SMBBLKDAT ready */
 		outb_p(SMBHSTSTS_BYTE_DONE | SMBHSTSTS_INTR, SMBHSTSTS(priv));
 	}
-- 
2.20.1


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

* [PATCH 2/4] staging: kpc2000: add missing spaces in kpc2000_spi.c
  2019-06-25  8:41 [PATCH 0/4] Minor style issue fixes for staging/kpc2000 Simon Sandström
  2019-06-25  8:41 ` [PATCH 1/4] staging: kpc2000: add missing spaces in kpc2000_i2c.c Simon Sandström
@ 2019-06-25  8:41 ` Simon Sandström
  2019-06-25  8:41 ` [PATCH 3/4] staging: kpc2000: remove unnecessary parentheses " Simon Sandström
  2019-06-25  8:41 ` [PATCH 4/4] staging: kpc2000: fix brace issues " Simon Sandström
  3 siblings, 0 replies; 6+ messages in thread
From: Simon Sandström @ 2019-06-25  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: gneukum1, devel, linux-kernel, Simon Sandström

Fixes checkpatch errors:
- spaces required around that '=' (ctx:VxV)
- space required before the open parenthesis '('
- spaces preferred around that '-' (ctx:VxV)
- space required before the open brace '{'

Signed-off-by: Simon Sandström <simon@nikanor.nu>
---
 drivers/staging/kpc2000/kpc2000_spi.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c
index c3e5c1848f53..98484fbb9d2e 100644
--- a/drivers/staging/kpc2000/kpc2000_spi.c
+++ b/drivers/staging/kpc2000/kpc2000_spi.c
@@ -164,7 +164,7 @@ kp_spi_read_reg(struct kp_spi_controller_state *cs, int idx)
 	u64 val;
 
 	addr += idx;
-	if ((idx == KP_SPI_REG_CONFIG) && (cs->conf_cache >= 0)){
+	if ((idx == KP_SPI_REG_CONFIG) && (cs->conf_cache >= 0)) {
 		return cs->conf_cache;
 	}
 	val = readq(addr);
@@ -223,9 +223,9 @@ kp_spi_txrx_pio(struct spi_device *spidev, struct spi_transfer *transfer)
 			processed++;
 		}
 	}
-	else if(rx) {
+	else if (rx) {
 		for (i = 0 ; i < c ; i++) {
-			char test=0;
+			char test = 0;
 
 			kp_spi_write_reg(cs, KP_SPI_REG_TXDATA, 0x00);
 
@@ -261,7 +261,7 @@ kp_spi_setup(struct spi_device *spidev)
 	cs = spidev->controller_state;
 	if (!cs) {
 		cs = kzalloc(sizeof(*cs), GFP_KERNEL);
-		if(!cs) {
+		if (!cs) {
 			return -ENOMEM;
 		}
 		cs->base = kpspi->base;
@@ -364,7 +364,7 @@ kp_spi_transfer_one_message(struct spi_master *master, struct spi_message *m)
 			if (transfer->bits_per_word) {
 				word_len = transfer->bits_per_word;
 			}
-			sc.bitfield.wl = word_len-1;
+			sc.bitfield.wl = word_len - 1;
 
 			/* ...chip select */
 			sc.bitfield.cs = spidev->chip_select;
@@ -425,7 +425,7 @@ kp_spi_probe(struct platform_device *pldev)
 	int i;
 
 	drvdata = pldev->dev.platform_data;
-	if (!drvdata){
+	if (!drvdata) {
 		dev_err(&pldev->dev, "kp_spi_probe: platform_data is NULL!\n");
 		return -ENODEV;
 	}
@@ -476,7 +476,7 @@ kp_spi_probe(struct platform_device *pldev)
 		spi_new_device(master, &(table[i])); \
 	}
 
-	switch ((drvdata->card_id & 0xFFFF0000) >> 16){
+	switch ((drvdata->card_id & 0xFFFF0000) >> 16) {
 	case PCI_DEVICE_ID_DAKTRONICS_KADOKA_P2KR0:
 		NEW_SPI_DEVICE_FROM_BOARD_INFO_TABLE(p2kr0_board_info);
 		break;
-- 
2.20.1


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

* [PATCH 3/4] staging: kpc2000: remove unnecessary parentheses in kpc2000_spi.c
  2019-06-25  8:41 [PATCH 0/4] Minor style issue fixes for staging/kpc2000 Simon Sandström
  2019-06-25  8:41 ` [PATCH 1/4] staging: kpc2000: add missing spaces in kpc2000_i2c.c Simon Sandström
  2019-06-25  8:41 ` [PATCH 2/4] staging: kpc2000: add missing spaces in kpc2000_spi.c Simon Sandström
@ 2019-06-25  8:41 ` Simon Sandström
  2019-06-26  1:56   ` Greg KH
  2019-06-25  8:41 ` [PATCH 4/4] staging: kpc2000: fix brace issues " Simon Sandström
  3 siblings, 1 reply; 6+ messages in thread
From: Simon Sandström @ 2019-06-25  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: gneukum1, devel, linux-kernel, Simon Sandström

Fixes checkpatch "CHECK: Unnecessary parentheses around '...'".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
---
 drivers/staging/kpc2000/kpc2000_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c
index 98484fbb9d2e..68b049f9ad69 100644
--- a/drivers/staging/kpc2000/kpc2000_spi.c
+++ b/drivers/staging/kpc2000/kpc2000_spi.c
@@ -164,7 +164,7 @@ kp_spi_read_reg(struct kp_spi_controller_state *cs, int idx)
 	u64 val;
 
 	addr += idx;
-	if ((idx == KP_SPI_REG_CONFIG) && (cs->conf_cache >= 0)) {
+	if (idx == KP_SPI_REG_CONFIG && cs->conf_cache >= 0) {
 		return cs->conf_cache;
 	}
 	val = readq(addr);
-- 
2.20.1


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

* [PATCH 4/4] staging: kpc2000: fix brace issues in kpc2000_spi.c
  2019-06-25  8:41 [PATCH 0/4] Minor style issue fixes for staging/kpc2000 Simon Sandström
                   ` (2 preceding siblings ...)
  2019-06-25  8:41 ` [PATCH 3/4] staging: kpc2000: remove unnecessary parentheses " Simon Sandström
@ 2019-06-25  8:41 ` Simon Sandström
  3 siblings, 0 replies; 6+ messages in thread
From: Simon Sandström @ 2019-06-25  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: gneukum1, devel, linux-kernel, Simon Sandström

Fixes checkpatch errors: "else should follow close brace '}'" and
"braces {} are not necessary for single statement blocks".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
---
 drivers/staging/kpc2000/kpc2000_spi.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c
index 68b049f9ad69..4b1468137703 100644
--- a/drivers/staging/kpc2000/kpc2000_spi.c
+++ b/drivers/staging/kpc2000/kpc2000_spi.c
@@ -164,9 +164,9 @@ kp_spi_read_reg(struct kp_spi_controller_state *cs, int idx)
 	u64 val;
 
 	addr += idx;
-	if (idx == KP_SPI_REG_CONFIG && cs->conf_cache >= 0) {
+	if (idx == KP_SPI_REG_CONFIG && cs->conf_cache >= 0)
 		return cs->conf_cache;
-	}
+
 	val = readq(addr);
 	return val;
 }
@@ -222,8 +222,7 @@ kp_spi_txrx_pio(struct spi_device *spidev, struct spi_transfer *transfer)
 			kp_spi_write_reg(cs, KP_SPI_REG_TXDATA, val);
 			processed++;
 		}
-	}
-	else if (rx) {
+	} else if (rx) {
 		for (i = 0 ; i < c ; i++) {
 			char test = 0;
 
@@ -261,9 +260,8 @@ kp_spi_setup(struct spi_device *spidev)
 	cs = spidev->controller_state;
 	if (!cs) {
 		cs = kzalloc(sizeof(*cs), GFP_KERNEL);
-		if (!cs) {
+		if (!cs)
 			return -ENOMEM;
-		}
 		cs->base = kpspi->base;
 		cs->conf_cache = -1;
 		spidev->controller_state = cs;
-- 
2.20.1


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

* Re: [PATCH 3/4] staging: kpc2000: remove unnecessary parentheses in kpc2000_spi.c
  2019-06-25  8:41 ` [PATCH 3/4] staging: kpc2000: remove unnecessary parentheses " Simon Sandström
@ 2019-06-26  1:56   ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2019-06-26  1:56 UTC (permalink / raw)
  To: Simon Sandström; +Cc: devel, gneukum1, linux-kernel

On Tue, Jun 25, 2019 at 10:41:29AM +0200, Simon Sandström wrote:
> Fixes checkpatch "CHECK: Unnecessary parentheses around '...'".
> 
> Signed-off-by: Simon Sandström <simon@nikanor.nu>
> ---
>  drivers/staging/kpc2000/kpc2000_spi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c
> index 98484fbb9d2e..68b049f9ad69 100644
> --- a/drivers/staging/kpc2000/kpc2000_spi.c
> +++ b/drivers/staging/kpc2000/kpc2000_spi.c
> @@ -164,7 +164,7 @@ kp_spi_read_reg(struct kp_spi_controller_state *cs, int idx)
>  	u64 val;
>  
>  	addr += idx;
> -	if ((idx == KP_SPI_REG_CONFIG) && (cs->conf_cache >= 0)) {
> +	if (idx == KP_SPI_REG_CONFIG && cs->conf_cache >= 0) {

Ick, no.  I don't want to have to remember the priority order of
operations.  Leave this as-is, I HATE this checkpatch message.

thanks,

greg k-h

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

end of thread, other threads:[~2019-06-26  2:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-25  8:41 [PATCH 0/4] Minor style issue fixes for staging/kpc2000 Simon Sandström
2019-06-25  8:41 ` [PATCH 1/4] staging: kpc2000: add missing spaces in kpc2000_i2c.c Simon Sandström
2019-06-25  8:41 ` [PATCH 2/4] staging: kpc2000: add missing spaces in kpc2000_spi.c Simon Sandström
2019-06-25  8:41 ` [PATCH 3/4] staging: kpc2000: remove unnecessary parentheses " Simon Sandström
2019-06-26  1:56   ` Greg KH
2019-06-25  8:41 ` [PATCH 4/4] staging: kpc2000: fix brace issues " Simon Sandström

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).