All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Fix style problems in ad7150 driver
@ 2018-10-05  8:04 Slawomir Stepien
  2018-10-05  8:04 ` [PATCH v2 1/2] staging: iio: cdc: ad7150: use value copy to shorten the line length Slawomir Stepien
  2018-10-05  8:05 ` [PATCH v2 2/2] staging: iio: cdc: ad7150: fix misaligned lines Slawomir Stepien
  0 siblings, 2 replies; 5+ messages in thread
From: Slawomir Stepien @ 2018-10-05  8:04 UTC (permalink / raw)
  To: linux-iio; +Cc: lars, Michael.Hennerich, jic23, knaack.h, pmeerw, gregkh, devel

This series will fix simple style problems inside the ad7150 driver.

---
Changes since v1:
- Use channel value copy rather than pointer - for better readability
- Change "problem" -> "problems" in cover letter description
---
Slawomir Stepien (2):
  staging: iio: cdc: ad7150: use value copy to shorten the line length
  staging: iio: cdc: ad7150: fix misaligned lines

 drivers/staging/iio/cdc/ad7150.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

-- 
2.19.0

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

* [PATCH v2 1/2] staging: iio: cdc: ad7150: use value copy to shorten the line length
  2018-10-05  8:04 [PATCH v2 0/2] Fix style problems in ad7150 driver Slawomir Stepien
@ 2018-10-05  8:04 ` Slawomir Stepien
  2018-10-07 19:07   ` Jonathan Cameron
  2018-10-05  8:05 ` [PATCH v2 2/2] staging: iio: cdc: ad7150: fix misaligned lines Slawomir Stepien
  1 sibling, 1 reply; 5+ messages in thread
From: Slawomir Stepien @ 2018-10-05  8:04 UTC (permalink / raw)
  To: linux-iio; +Cc: lars, Michael.Hennerich, jic23, knaack.h, pmeerw, gregkh, devel

By using the copy of channel attribute, we can now make the lines short
enough to eliminate the checkpatch.pl problem:

    CHECK: Alignment should match open parenthesis

Signed-off-by: Slawomir Stepien <sst@poczta.fm>
---
 drivers/staging/iio/cdc/ad7150.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c
index d16084d7068c..e2c70063fa0f 100644
--- a/drivers/staging/iio/cdc/ad7150.c
+++ b/drivers/staging/iio/cdc/ad7150.c
@@ -102,18 +102,19 @@ static int ad7150_read_raw(struct iio_dev *indio_dev,
 {
 	int ret;
 	struct ad7150_chip_info *chip = iio_priv(indio_dev);
+	int channel = chan->channel;
 
 	switch (mask) {
 	case IIO_CHAN_INFO_RAW:
 		ret = i2c_smbus_read_word_data(chip->client,
-					ad7150_addresses[chan->channel][0]);
+					       ad7150_addresses[channel][0]);
 		if (ret < 0)
 			return ret;
 		*val = swab16(ret);
 		return IIO_VAL_INT;
 	case IIO_CHAN_INFO_AVERAGE_RAW:
 		ret = i2c_smbus_read_word_data(chip->client,
-					ad7150_addresses[chan->channel][1]);
+					       ad7150_addresses[channel][1]);
 		if (ret < 0)
 			return ret;
 		*val = swab16(ret);
-- 
2.19.0

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

* [PATCH v2 2/2] staging: iio: cdc: ad7150: fix misaligned lines
  2018-10-05  8:04 [PATCH v2 0/2] Fix style problems in ad7150 driver Slawomir Stepien
  2018-10-05  8:04 ` [PATCH v2 1/2] staging: iio: cdc: ad7150: use value copy to shorten the line length Slawomir Stepien
@ 2018-10-05  8:05 ` Slawomir Stepien
  2018-10-07 19:09   ` Jonathan Cameron
  1 sibling, 1 reply; 5+ messages in thread
From: Slawomir Stepien @ 2018-10-05  8:05 UTC (permalink / raw)
  To: linux-iio; +Cc: lars, Michael.Hennerich, jic23, knaack.h, pmeerw, gregkh, devel

These lines were misaligned, but the checkpatch.pl didn't indicate them
as such.

Signed-off-by: Slawomir Stepien <sst@poczta.fm>
---
 drivers/staging/iio/cdc/ad7150.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c
index e2c70063fa0f..24f74ce60f80 100644
--- a/drivers/staging/iio/cdc/ad7150.c
+++ b/drivers/staging/iio/cdc/ad7150.c
@@ -183,8 +183,8 @@ static int ad7150_write_event_params(struct iio_dev *indio_dev,
 	case IIO_EV_TYPE_THRESH:
 		value = chip->threshold[rising][chan];
 		return i2c_smbus_write_word_data(chip->client,
-						ad7150_addresses[chan][3],
-						swab16(value));
+						 ad7150_addresses[chan][3],
+						 swab16(value));
 	case IIO_EV_TYPE_MAG_ADAPTIVE:
 		sens = chip->mag_sensitivity[rising][chan];
 		timeout = chip->mag_timeout[rising][chan];
-- 
2.19.0

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

* Re: [PATCH v2 1/2] staging: iio: cdc: ad7150: use value copy to shorten the line length
  2018-10-05  8:04 ` [PATCH v2 1/2] staging: iio: cdc: ad7150: use value copy to shorten the line length Slawomir Stepien
@ 2018-10-07 19:07   ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2018-10-07 19:07 UTC (permalink / raw)
  To: Slawomir Stepien
  Cc: linux-iio, lars, Michael.Hennerich, knaack.h, pmeerw, gregkh, devel

On Fri, 5 Oct 2018 10:04:44 +0200
Slawomir Stepien <sst@poczta.fm> wrote:

> By using the copy of channel attribute, we can now make the lines short
> enough to eliminate the checkpatch.pl problem:
> 
>     CHECK: Alignment should match open parenthesis
> 
> Signed-off-by: Slawomir Stepien <sst@poczta.fm>
Applied to the togreg branch of iio.git and pushed out as testing for the
autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/staging/iio/cdc/ad7150.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c
> index d16084d7068c..e2c70063fa0f 100644
> --- a/drivers/staging/iio/cdc/ad7150.c
> +++ b/drivers/staging/iio/cdc/ad7150.c
> @@ -102,18 +102,19 @@ static int ad7150_read_raw(struct iio_dev *indio_dev,
>  {
>  	int ret;
>  	struct ad7150_chip_info *chip = iio_priv(indio_dev);
> +	int channel = chan->channel;
>  
>  	switch (mask) {
>  	case IIO_CHAN_INFO_RAW:
>  		ret = i2c_smbus_read_word_data(chip->client,
> -					ad7150_addresses[chan->channel][0]);
> +					       ad7150_addresses[channel][0]);
>  		if (ret < 0)
>  			return ret;
>  		*val = swab16(ret);
>  		return IIO_VAL_INT;
>  	case IIO_CHAN_INFO_AVERAGE_RAW:
>  		ret = i2c_smbus_read_word_data(chip->client,
> -					ad7150_addresses[chan->channel][1]);
> +					       ad7150_addresses[channel][1]);
>  		if (ret < 0)
>  			return ret;
>  		*val = swab16(ret);

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

* Re: [PATCH v2 2/2] staging: iio: cdc: ad7150: fix misaligned lines
  2018-10-05  8:05 ` [PATCH v2 2/2] staging: iio: cdc: ad7150: fix misaligned lines Slawomir Stepien
@ 2018-10-07 19:09   ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2018-10-07 19:09 UTC (permalink / raw)
  To: Slawomir Stepien
  Cc: linux-iio, lars, Michael.Hennerich, knaack.h, pmeerw, gregkh, devel

On Fri, 5 Oct 2018 10:05:15 +0200
Slawomir Stepien <sst@poczta.fm> wrote:

> These lines were misaligned, but the checkpatch.pl didn't indicate them
> as such.
> 
> Signed-off-by: Slawomir Stepien <sst@poczta.fm>
Applied to the togreg branch of iio.git and pushed out as
testing for the autobuilders to play with it.

Thanks,

Jonathan

> ---
>  drivers/staging/iio/cdc/ad7150.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c
> index e2c70063fa0f..24f74ce60f80 100644
> --- a/drivers/staging/iio/cdc/ad7150.c
> +++ b/drivers/staging/iio/cdc/ad7150.c
> @@ -183,8 +183,8 @@ static int ad7150_write_event_params(struct iio_dev *indio_dev,
>  	case IIO_EV_TYPE_THRESH:
>  		value = chip->threshold[rising][chan];
>  		return i2c_smbus_write_word_data(chip->client,
> -						ad7150_addresses[chan][3],
> -						swab16(value));
> +						 ad7150_addresses[chan][3],
> +						 swab16(value));
>  	case IIO_EV_TYPE_MAG_ADAPTIVE:
>  		sens = chip->mag_sensitivity[rising][chan];
>  		timeout = chip->mag_timeout[rising][chan];

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

end of thread, other threads:[~2018-10-08  2:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-05  8:04 [PATCH v2 0/2] Fix style problems in ad7150 driver Slawomir Stepien
2018-10-05  8:04 ` [PATCH v2 1/2] staging: iio: cdc: ad7150: use value copy to shorten the line length Slawomir Stepien
2018-10-07 19:07   ` Jonathan Cameron
2018-10-05  8:05 ` [PATCH v2 2/2] staging: iio: cdc: ad7150: fix misaligned lines Slawomir Stepien
2018-10-07 19:09   ` Jonathan Cameron

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.