linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Staging: iio: trigger: Fix style issues
@ 2015-08-11 10:15 Cristina Opriceana
  2015-08-11 10:18 ` [PATCH 1/2] Staging: iio: trigger: Alignment should match open parenthesis Cristina Opriceana
  2015-08-11 10:20 ` [PATCH 2/2] Staging: iio: trigger: Use braces on both branches of if statement Cristina Opriceana
  0 siblings, 2 replies; 5+ messages in thread
From: Cristina Opriceana @ 2015-08-11 10:15 UTC (permalink / raw)
  To: jic23
  Cc: knaack.h, lars, pmeerw, gregkh, linux-iio, devel, linux-kernel,
	daniel.baluta

Fix style issues reported by checkpatch.pl.

Cristina Opriceana (2):
  Staging: iio: trigger: Alignment should match open parenthesis
  Staging: iio: trigger: Use braces on both branches of if statement

 drivers/staging/iio/trigger/iio-trig-bfin-timer.c   | 7 ++++---
 drivers/staging/iio/trigger/iio-trig-periodic-rtc.c | 5 +++--
 2 files changed, 7 insertions(+), 5 deletions(-)

-- 
1.9.1


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

* [PATCH 1/2] Staging: iio: trigger: Alignment should match open parenthesis
  2015-08-11 10:15 [PATCH 0/2] Staging: iio: trigger: Fix style issues Cristina Opriceana
@ 2015-08-11 10:18 ` Cristina Opriceana
  2015-08-15 19:59   ` Jonathan Cameron
  2015-08-11 10:20 ` [PATCH 2/2] Staging: iio: trigger: Use braces on both branches of if statement Cristina Opriceana
  1 sibling, 1 reply; 5+ messages in thread
From: Cristina Opriceana @ 2015-08-11 10:18 UTC (permalink / raw)
  To: jic23
  Cc: knaack.h, lars, pmeerw, gregkh, linux-iio, devel, linux-kernel,
	daniel.baluta

Fix alignment for function parameters as suggested by checkpatch.pl.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
---
 drivers/staging/iio/trigger/iio-trig-bfin-timer.c   | 7 ++++---
 drivers/staging/iio/trigger/iio-trig-periodic-rtc.c | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
index 3c1c8c6..9fe48ef 100644
--- a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
+++ b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
@@ -79,7 +79,8 @@ static int iio_bfin_tmr_set_state(struct iio_trigger *trig, bool state)
 }
 
 static ssize_t iio_bfin_tmr_frequency_store(struct device *dev,
-		struct device_attribute *attr, const char *buf, size_t count)
+					    struct device_attribute *attr,
+					    const char *buf, size_t count)
 {
 	struct iio_trigger *trig = to_iio_trigger(dev);
 	struct bfin_tmr_state *st = iio_trigger_get_drvdata(trig);
@@ -116,8 +117,8 @@ static ssize_t iio_bfin_tmr_frequency_store(struct device *dev,
 }
 
 static ssize_t iio_bfin_tmr_frequency_show(struct device *dev,
-				 struct device_attribute *attr,
-				 char *buf)
+					   struct device_attribute *attr,
+					   char *buf)
 {
 	struct iio_trigger *trig = to_iio_trigger(dev);
 	struct bfin_tmr_state *st = iio_trigger_get_drvdata(trig);
diff --git a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c b/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
index 0c1976d..a2a42c2 100644
--- a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
+++ b/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
@@ -37,7 +37,7 @@ static int iio_trig_periodic_rtc_set_state(struct iio_trigger *trig, bool state)
 	if (trig_info->frequency == 0 && state)
 		return -EINVAL;
 	dev_dbg(&trig_info->rtc->dev, "trigger frequency is %u\n",
-			trig_info->frequency);
+		trig_info->frequency);
 	ret = rtc_irq_set_state(trig_info->rtc, &trig_info->task, state);
 	if (ret == 0)
 		trig_info->state = state;
-- 
1.9.1

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

* [PATCH 2/2] Staging: iio: trigger: Use braces on both branches of if statement
  2015-08-11 10:15 [PATCH 0/2] Staging: iio: trigger: Fix style issues Cristina Opriceana
  2015-08-11 10:18 ` [PATCH 1/2] Staging: iio: trigger: Alignment should match open parenthesis Cristina Opriceana
@ 2015-08-11 10:20 ` Cristina Opriceana
  2015-08-15 20:02   ` Jonathan Cameron
  1 sibling, 1 reply; 5+ messages in thread
From: Cristina Opriceana @ 2015-08-11 10:20 UTC (permalink / raw)
  To: jic23
  Cc: knaack.h, lars, pmeerw, gregkh, linux-iio, devel, linux-kernel,
	daniel.baluta

Fix style issue related to missing braces, detected by checkpatch.pl.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
---
 drivers/staging/iio/trigger/iio-trig-periodic-rtc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c b/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
index a2a42c2..2db8857 100644
--- a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
+++ b/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
@@ -74,8 +74,9 @@ static ssize_t iio_trig_periodic_write_freq(struct device *dev,
 		if (ret == 0 && trig_info->state && trig_info->frequency == 0)
 			ret = rtc_irq_set_state(trig_info->rtc,
 						&trig_info->task, 1);
-	} else
+	} else {
 		ret = rtc_irq_set_state(trig_info->rtc, &trig_info->task, 0);
+	}
 	if (ret)
 		goto error_ret;
 
-- 
1.9.1


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

* Re: [PATCH 1/2] Staging: iio: trigger: Alignment should match open parenthesis
  2015-08-11 10:18 ` [PATCH 1/2] Staging: iio: trigger: Alignment should match open parenthesis Cristina Opriceana
@ 2015-08-15 19:59   ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2015-08-15 19:59 UTC (permalink / raw)
  To: Cristina Opriceana
  Cc: knaack.h, lars, pmeerw, gregkh, linux-iio, devel, linux-kernel,
	daniel.baluta

On 11/08/15 11:18, Cristina Opriceana wrote:
> Fix alignment for function parameters as suggested by checkpatch.pl.
> 
> Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Whilst I find it a little hard to care about tidying up in these two drivers,
we haven't explicitly noted they are both on their way out in the medium
term and it does no harm.

Applied to the togreg branch of iio.git

Thanks,

Jonathan
> ---
>  drivers/staging/iio/trigger/iio-trig-bfin-timer.c   | 7 ++++---
>  drivers/staging/iio/trigger/iio-trig-periodic-rtc.c | 2 +-
>  2 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
> index 3c1c8c6..9fe48ef 100644
> --- a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
> +++ b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
> @@ -79,7 +79,8 @@ static int iio_bfin_tmr_set_state(struct iio_trigger *trig, bool state)
>  }
>  
>  static ssize_t iio_bfin_tmr_frequency_store(struct device *dev,
> -		struct device_attribute *attr, const char *buf, size_t count)
> +					    struct device_attribute *attr,
> +					    const char *buf, size_t count)
>  {
>  	struct iio_trigger *trig = to_iio_trigger(dev);
>  	struct bfin_tmr_state *st = iio_trigger_get_drvdata(trig);
> @@ -116,8 +117,8 @@ static ssize_t iio_bfin_tmr_frequency_store(struct device *dev,
>  }
>  
>  static ssize_t iio_bfin_tmr_frequency_show(struct device *dev,
> -				 struct device_attribute *attr,
> -				 char *buf)
> +					   struct device_attribute *attr,
> +					   char *buf)
>  {
>  	struct iio_trigger *trig = to_iio_trigger(dev);
>  	struct bfin_tmr_state *st = iio_trigger_get_drvdata(trig);
> diff --git a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c b/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
> index 0c1976d..a2a42c2 100644
> --- a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
> +++ b/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
> @@ -37,7 +37,7 @@ static int iio_trig_periodic_rtc_set_state(struct iio_trigger *trig, bool state)
>  	if (trig_info->frequency == 0 && state)
>  		return -EINVAL;
>  	dev_dbg(&trig_info->rtc->dev, "trigger frequency is %u\n",
> -			trig_info->frequency);
> +		trig_info->frequency);
>  	ret = rtc_irq_set_state(trig_info->rtc, &trig_info->task, state);
>  	if (ret == 0)
>  		trig_info->state = state;
> 


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

* Re: [PATCH 2/2] Staging: iio: trigger: Use braces on both branches of if statement
  2015-08-11 10:20 ` [PATCH 2/2] Staging: iio: trigger: Use braces on both branches of if statement Cristina Opriceana
@ 2015-08-15 20:02   ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2015-08-15 20:02 UTC (permalink / raw)
  To: Cristina Opriceana
  Cc: knaack.h, lars, pmeerw, gregkh, linux-iio, devel, linux-kernel,
	daniel.baluta

On 11/08/15 11:20, Cristina Opriceana wrote:
> Fix style issue related to missing braces, detected by checkpatch.pl.
> 
> Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Applied to the togreg branch of iio.git.

This one used to be left as optional, so there are a lot of these in older
code (and in IIO you don't get much older than this!)

For reference, it is going away the moment the high resolution timer
trigger is in as this support is emulated in all modern rtc drivers
anyway (was using actual hardware in the rtc when this driver was written).

Anyhow, even code with a short likely time to live can be well formatted!

Applied.

Jonathan
> ---
>  drivers/staging/iio/trigger/iio-trig-periodic-rtc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c b/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
> index a2a42c2..2db8857 100644
> --- a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
> +++ b/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
> @@ -74,8 +74,9 @@ static ssize_t iio_trig_periodic_write_freq(struct device *dev,
>  		if (ret == 0 && trig_info->state && trig_info->frequency == 0)
>  			ret = rtc_irq_set_state(trig_info->rtc,
>  						&trig_info->task, 1);
> -	} else
> +	} else {
>  		ret = rtc_irq_set_state(trig_info->rtc, &trig_info->task, 0);
> +	}
>  	if (ret)
>  		goto error_ret;
>  
> 


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

end of thread, other threads:[~2015-08-15 20:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-11 10:15 [PATCH 0/2] Staging: iio: trigger: Fix style issues Cristina Opriceana
2015-08-11 10:18 ` [PATCH 1/2] Staging: iio: trigger: Alignment should match open parenthesis Cristina Opriceana
2015-08-15 19:59   ` Jonathan Cameron
2015-08-11 10:20 ` [PATCH 2/2] Staging: iio: trigger: Use braces on both branches of if statement Cristina Opriceana
2015-08-15 20:02   ` Jonathan Cameron

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