All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] staging: pi433: - style fix, space before tabs
@ 2017-07-22  3:51 Derek Robson
  2017-07-22  8:48 ` Marcus Wolf
  0 siblings, 1 reply; 3+ messages in thread
From: Derek Robson @ 2017-07-22  3:51 UTC (permalink / raw)
  To: gregkh, robsonde, linux; +Cc: devel, linux-kernel

Fixed checkpatch errors of "no space before tabs"

Signed-off-by: Derek Robson <robsonde@gmail.com>
---
 drivers/staging/pi433/pi433_if.c | 12 ++++++------
 drivers/staging/pi433/pi433_if.h |  4 ++--
 drivers/staging/pi433/rf69.c     |  8 ++++----
 drivers/staging/pi433/rf69.h     |  6 +++---
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index 9cdebe93657c..b9e9292c01d9 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -190,12 +190,12 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg)
 	SET_CHECKED(rf69_set_frequency	(dev->spi, rx_cfg->frequency));
 	SET_CHECKED(rf69_set_bit_rate	(dev->spi, rx_cfg->bit_rate));
 	SET_CHECKED(rf69_set_modulation	(dev->spi, rx_cfg->modulation));
-	SET_CHECKED(rf69_set_antenna_impedance	 (dev->spi, rx_cfg->antenna_impedance));
-	SET_CHECKED(rf69_set_rssi_threshold	 (dev->spi, rx_cfg->rssi_threshold));
-	SET_CHECKED(rf69_set_ook_threshold_dec	 (dev->spi, rx_cfg->thresholdDecrement));
-	SET_CHECKED(rf69_set_bandwidth 		 (dev->spi, rx_cfg->bw_mantisse, rx_cfg->bw_exponent));
+	SET_CHECKED(rf69_set_antenna_impedance(dev->spi, rx_cfg->antenna_impedance));
+	SET_CHECKED(rf69_set_rssi_threshold(dev->spi, rx_cfg->rssi_threshold));
+	SET_CHECKED(rf69_set_ook_threshold_dec(dev->spi, rx_cfg->thresholdDecrement));
+	SET_CHECKED(rf69_set_bandwidth(dev->spi, rx_cfg->bw_mantisse, rx_cfg->bw_exponent));
 	SET_CHECKED(rf69_set_bandwidth_during_afc(dev->spi, rx_cfg->bw_mantisse, rx_cfg->bw_exponent));
-	SET_CHECKED(rf69_set_dagc 		 (dev->spi, rx_cfg->dagc));
+	SET_CHECKED(rf69_set_dagc(dev->spi, rx_cfg->dagc));
 
 	dev->rx_bytes_to_drop = rx_cfg->bytes_to_drop;
 
@@ -959,7 +959,7 @@ static int pi433_release(struct inode *inode, struct file *filp)
 
 static int setup_GPIOs(struct pi433_device *device)
 {
-	char 	name[5];
+	char	name[5];
 	int	retval;
 	int	i;
 
diff --git a/drivers/staging/pi433/pi433_if.h b/drivers/staging/pi433/pi433_if.h
index e6ed3cd9b2e2..aae71f029c60 100644
--- a/drivers/staging/pi433/pi433_if.h
+++ b/drivers/staging/pi433/pi433_if.h
@@ -57,7 +57,7 @@
  *
  * NOTE: struct layout is the same in 64bit and 32bit userspace.
  */
-#define PI433_TX_CFG_IOCTL_NR 	0
+#define PI433_TX_CFG_IOCTL_NR	0
 struct pi433_tx_cfg
 {
 	__u32			frequency;
@@ -107,7 +107,7 @@ struct pi433_tx_cfg
  *
  * NOTE: struct layout is the same in 64bit and 32bit userspace.
  */
-#define PI433_RX_CFG_IOCTL_NR 	1
+#define PI433_RX_CFG_IOCTL_NR	1
 struct pi433_rx_cfg {
 	__u32			frequency;
 	__u16			bit_rate;
diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index 7f4db9a1f39a..d931437f0b6a 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -28,8 +28,8 @@
 #include "rf69.h"
 #include "rf69_registers.h"
 
-#define F_OSC	  32000000 /* in Hz */
-#define FIFO_SIZE 66 	   /* in byte */
+#define F_OSC 32000000	/* in Hz */
+#define FIFO_SIZE 66	/* in byte */
 
 /*-------------------------------------------------------------------------*/
 
@@ -885,8 +885,8 @@ int rf69_read_fifo (struct spi_device *spi, u8 *buffer, unsigned int size)
 	/* prepare a bidirectional transfer */
 	local_buffer[0] = REG_FIFO;
 	memset(&transfer, 0, sizeof(transfer));
-  	transfer.tx_buf = local_buffer;
-  	transfer.rx_buf = local_buffer;
+	transfer.tx_buf = local_buffer;
+	transfer.rx_buf = local_buffer;
 	transfer.len	= size+1;
 
 	retval = spi_sync_transfer(spi, &transfer, 1);
diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h
index b81e0762032e..373df64b6891 100644
--- a/drivers/staging/pi433/rf69.h
+++ b/drivers/staging/pi433/rf69.h
@@ -20,10 +20,10 @@
 #include "rf69_enum.h"
 #include "rf69_registers.h"
 
-#define F_OSC 		32000000  /* in Hz */
+#define F_OSC		32000000  /* in Hz */
 #define FREQUENCY	433920000 /* in Hz, modifying this value impacts CE certification */
-#define FIFO_SIZE 	66        /* in byte */
-#define FIFO_THRESHOLD	15 	  /* in byte */
+#define FIFO_SIZE	66	/* in byte */
+#define FIFO_THRESHOLD	15	/* in byte */
 
 int rf69_set_mode(struct spi_device *spi, enum mode mode);
 int rf69_set_data_mode(struct spi_device *spi, enum dataMode dataMode);
-- 
2.13.2

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

* Re: [PATCH 2/3] staging: pi433: - style fix, space before tabs
  2017-07-22  3:51 [PATCH 2/3] staging: pi433: - style fix, space before tabs Derek Robson
@ 2017-07-22  8:48 ` Marcus Wolf
  2017-07-24  7:48   ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Marcus Wolf @ 2017-07-22  8:48 UTC (permalink / raw)
  To: gregkh, Derek Robson; +Cc: linux-kernel, devel

Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de>

>From my point of view, the rearrangement of the block of SET_CHECKED reduces the
readability a lot. I like same stuff to be aligned (all brakets below each other
as a column, all spi->dev below each other and so on) But if it  is necessary to
fullfill the rules, we have to do it the new way.

Thanks to Derek for his routine piece of work!

Marcus

> Derek Robson <robsonde@gmail.com> hat am 22. Juli 2017 um 05:51 geschrieben:
> 
> 
> Fixed checkpatch errors of "no space before tabs"
> 
> Signed-off-by: Derek Robson <robsonde@gmail.com>
> ---
>  drivers/staging/pi433/pi433_if.c | 12 ++++++------
>  drivers/staging/pi433/pi433_if.h |  4 ++--
>  drivers/staging/pi433/rf69.c     |  8 ++++----
>  drivers/staging/pi433/rf69.h     |  6 +++---
>  4 files changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/staging/pi433/pi433_if.c
> b/drivers/staging/pi433/pi433_if.c
> index 9cdebe93657c..b9e9292c01d9 100644
> --- a/drivers/staging/pi433/pi433_if.c
> +++ b/drivers/staging/pi433/pi433_if.c
> @@ -190,12 +190,12 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct
> pi433_rx_cfg *rx_cfg)
>  	SET_CHECKED(rf69_set_frequency	(dev->spi, rx_cfg->frequency));
>  	SET_CHECKED(rf69_set_bit_rate	(dev->spi, rx_cfg->bit_rate));
>  	SET_CHECKED(rf69_set_modulation	(dev->spi, rx_cfg->modulation));
> -	SET_CHECKED(rf69_set_antenna_impedance	 (dev->spi,
> rx_cfg->antenna_impedance));
> -	SET_CHECKED(rf69_set_rssi_threshold	 (dev->spi, rx_cfg->rssi_threshold));
> -	SET_CHECKED(rf69_set_ook_threshold_dec	 (dev->spi,
> rx_cfg->thresholdDecrement));
> -	SET_CHECKED(rf69_set_bandwidth 		 (dev->spi, rx_cfg->bw_mantisse,
> rx_cfg->bw_exponent));
> +	SET_CHECKED(rf69_set_antenna_impedance(dev->spi,
> rx_cfg->antenna_impedance));
> +	SET_CHECKED(rf69_set_rssi_threshold(dev->spi, rx_cfg->rssi_threshold));
> +	SET_CHECKED(rf69_set_ook_threshold_dec(dev->spi,
> rx_cfg->thresholdDecrement));
> +	SET_CHECKED(rf69_set_bandwidth(dev->spi, rx_cfg->bw_mantisse,
> rx_cfg->bw_exponent));
>  	SET_CHECKED(rf69_set_bandwidth_during_afc(dev->spi, rx_cfg->bw_mantisse,
> rx_cfg->bw_exponent));
> -	SET_CHECKED(rf69_set_dagc 		 (dev->spi, rx_cfg->dagc));
> +	SET_CHECKED(rf69_set_dagc(dev->spi, rx_cfg->dagc));
>  
>  	dev->rx_bytes_to_drop = rx_cfg->bytes_to_drop;
>  
> @@ -959,7 +959,7 @@ static int pi433_release(struct inode *inode, struct file
> *filp)
>  
>  static int setup_GPIOs(struct pi433_device *device)
>  {
> -	char 	name[5];
> +	char	name[5];
>  	int	retval;
>  	int	i;
>  
> diff --git a/drivers/staging/pi433/pi433_if.h
> b/drivers/staging/pi433/pi433_if.h
> index e6ed3cd9b2e2..aae71f029c60 100644
> --- a/drivers/staging/pi433/pi433_if.h
> +++ b/drivers/staging/pi433/pi433_if.h
> @@ -57,7 +57,7 @@
>   *
>   * NOTE: struct layout is the same in 64bit and 32bit userspace.
>   */
> -#define PI433_TX_CFG_IOCTL_NR 	0
> +#define PI433_TX_CFG_IOCTL_NR	0
>  struct pi433_tx_cfg
>  {
>  	__u32			frequency;
> @@ -107,7 +107,7 @@ struct pi433_tx_cfg
>   *
>   * NOTE: struct layout is the same in 64bit and 32bit userspace.
>   */
> -#define PI433_RX_CFG_IOCTL_NR 	1
> +#define PI433_RX_CFG_IOCTL_NR	1
>  struct pi433_rx_cfg {
>  	__u32			frequency;
>  	__u16			bit_rate;
> diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
> index 7f4db9a1f39a..d931437f0b6a 100644
> --- a/drivers/staging/pi433/rf69.c
> +++ b/drivers/staging/pi433/rf69.c
> @@ -28,8 +28,8 @@
>  #include "rf69.h"
>  #include "rf69_registers.h"
>  
> -#define F_OSC	  32000000 /* in Hz */
> -#define FIFO_SIZE 66 	   /* in byte */
> +#define F_OSC 32000000	/* in Hz */
> +#define FIFO_SIZE 66	/* in byte */
>  
>  /*-------------------------------------------------------------------------*/
>  
> @@ -885,8 +885,8 @@ int rf69_read_fifo (struct spi_device *spi, u8 *buffer,
> unsigned int size)
>  	/* prepare a bidirectional transfer */
>  	local_buffer[0] = REG_FIFO;
>  	memset(&transfer, 0, sizeof(transfer));
> -  	transfer.tx_buf = local_buffer;
> -  	transfer.rx_buf = local_buffer;
> +	transfer.tx_buf = local_buffer;
> +	transfer.rx_buf = local_buffer;
>  	transfer.len	= size+1;
>  
>  	retval = spi_sync_transfer(spi, &transfer, 1);
> diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h
> index b81e0762032e..373df64b6891 100644
> --- a/drivers/staging/pi433/rf69.h
> +++ b/drivers/staging/pi433/rf69.h
> @@ -20,10 +20,10 @@
>  #include "rf69_enum.h"
>  #include "rf69_registers.h"
>  
> -#define F_OSC 		32000000  /* in Hz */
> +#define F_OSC		32000000  /* in Hz */
>  #define FREQUENCY	433920000 /* in Hz, modifying this value impacts CE
> certification */
> -#define FIFO_SIZE 	66        /* in byte */
> -#define FIFO_THRESHOLD	15 	  /* in byte */
> +#define FIFO_SIZE	66	/* in byte */
> +#define FIFO_THRESHOLD	15	/* in byte */
>  
>  int rf69_set_mode(struct spi_device *spi, enum mode mode);
>  int rf69_set_data_mode(struct spi_device *spi, enum dataMode dataMode);
> -- 
> 2.13.2
> 
> 

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

* Re: [PATCH 2/3] staging: pi433: - style fix, space before tabs
  2017-07-22  8:48 ` Marcus Wolf
@ 2017-07-24  7:48   ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2017-07-24  7:48 UTC (permalink / raw)
  To: Marcus Wolf; +Cc: gregkh, Derek Robson, devel, linux-kernel

On Sat, Jul 22, 2017 at 10:48:24AM +0200, Marcus Wolf wrote:
> Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de>
> 
> >From my point of view, the rearrangement of the block of SET_CHECKED reduces the
> readability a lot. I like same stuff to be aligned (all brakets below each other
> as a column, all spi->dev below each other and so on) But if it  is necessary to
> fullfill the rules, we have to do it the new way.

It's not necessary.  The rule is just complaining about this:

        SET_CHECKED(rf69_set_bandwidth 		 (dev->spi, rx_cfg->bw_mantisse, rx_cfg->bw_exponent));
                                      ^
There is a space after the 'h' character.  The old code has
"[space][tab][tab][space](dev->spi,..."  it should be:
"[tab][tab][space](dev->spi, ..."

Also the rules are there to improve readability.  Sometimes they're
debatable but if they make readability worse, then we can ignore the
rules.

regards,
dan carpenter

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

end of thread, other threads:[~2017-07-24  7:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-22  3:51 [PATCH 2/3] staging: pi433: - style fix, space before tabs Derek Robson
2017-07-22  8:48 ` Marcus Wolf
2017-07-24  7:48   ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.