Skip to contentSkip to conversation

staging: iio: accel: multiple coding style fixes

PATCH Superseded Murilo Opsfelder Araujo 2 participants 10 messages Jul 31, 2014

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover staging: iio: accel: multiple coding style fixes

The following patches fix (almost) all warnings reported by checkpatch.pl.

Murilo Opsfelder Araujo (8):
staging: iio: accel: adis16203_core.c: fix coding style
staging: iio: accel: adis16201_core.c: fix coding style
staging: iio: accel: adis16204_core.c: fix coding style
staging: iio: accel: adis16209_core.c: fix coding style
staging: iio: accel: adis16240_core.c: fix coding style
staging: iio: accel: lis3l02dq_core.c: fix coding style
staging: iio: accel: lis3l02dq_ring.c: fix coding style
staging: iio: accel: sca3000_core.c: fix coding style

 drivers/staging/iio/accel/adis16201_core.c |    5 +++--
 drivers/staging/iio/accel/adis16203_core.c |    2 ++
 drivers/staging/iio/accel/adis16204_core.c |    1 +
 drivers/staging/iio/accel/adis16209_core.c |    1 +
 drivers/staging/iio/accel/adis16240_core.c |    1 +
 drivers/staging/iio/accel/lis3l02dq_core.c |    4 ++++
 drivers/staging/iio/accel/lis3l02dq_ring.c |    1 +
 drivers/staging/iio/accel/sca3000_core.c   |    4 +++-
 8 files changed, 16 insertions(+), 3 deletions(-)

--
1.7.10.4

#1 lore raw

PATCH 1/8 staging: iio: accel: adis16203_core.c: fix coding style

This patch adds missing blank line after declarations.

---
 drivers/staging/iio/accel/adis16203_core.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/staging/iio/accel/adis16203_core.c +2 -0
index f472137..fbbe93f 100644
@@ -37,6 +37,7 @@ static int adis16203_write_raw(struct iio_dev *indio_dev,
 	struct adis *st = iio_priv(indio_dev);
 	/* currently only one writable parameter which keeps this simple */
 	u8 addr = adis16203_addresses[chan->scan_index];
+
 	return adis_write_reg_16(st, addr, val & 0x3FFF);
 }
 
@@ -50,6 +51,7 @@ static int adis16203_read_raw(struct iio_dev *indio_dev,
 	int bits;
 	u8 addr;
 	s16 val16;
+
 	switch (mask) {
 	case IIO_CHAN_INFO_RAW:
 		return adis_single_conversion(indio_dev, chan,
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/8 staging: iio: accel: adis16201_core.c: fix coding style

In reply to Murilo Opsfelder Araujo

This patch adds missing blank line after declaration and fixes lines starting by space.

---
 drivers/staging/iio/accel/adis16201_core.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/staging/iio/accel/adis16201_core.c +3 -2
index 50ba1fa..7eae5fd 100644
@@ -111,6 +111,7 @@ static int adis16201_write_raw(struct iio_dev *indio_dev,
 	int bits;
 	s16 val16;
 	u8 addr;
+
 	switch (mask) {
 	case IIO_CHAN_INFO_CALIBBIAS:
 		switch (chan->type) {
@@ -131,8 +132,8 @@ static int adis16201_write_raw(struct iio_dev *indio_dev,
 }
 
 static const struct iio_chan_spec adis16201_channels[] = {
-  ADIS_SUPPLY_CHAN(ADIS16201_SUPPLY_OUT, ADIS16201_SCAN_SUPPLY, 0, 12),
-  ADIS_TEMP_CHAN(ADIS16201_TEMP_OUT, ADIS16201_SCAN_TEMP, 0, 12),
+	ADIS_SUPPLY_CHAN(ADIS16201_SUPPLY_OUT, ADIS16201_SCAN_SUPPLY, 0, 12),
+	ADIS_TEMP_CHAN(ADIS16201_TEMP_OUT, ADIS16201_SCAN_TEMP, 0, 12),
 	ADIS_ACCEL_CHAN(X, ADIS16201_XACCL_OUT, ADIS16201_SCAN_ACC_X,
 		BIT(IIO_CHAN_INFO_CALIBBIAS), 0, 14),
 	ADIS_ACCEL_CHAN(Y, ADIS16201_YACCL_OUT, ADIS16201_SCAN_ACC_Y,
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 3/8 staging: iio: accel: adis16204_core.c: fix coding style

In reply to Murilo Opsfelder Araujo

This patch adds missing blank line after declaration.

---
 drivers/staging/iio/accel/adis16204_core.c |    1 +
 1 file changed, 1 insertion(+)
drivers/staging/iio/accel/adis16204_core.c +1 -0
index 19eaebc..4c8acbc 100644
@@ -119,6 +119,7 @@ static int adis16204_write_raw(struct iio_dev *indio_dev,
 	int bits;
 	s16 val16;
 	u8 addr;
+
 	switch (mask) {
 	case IIO_CHAN_INFO_CALIBBIAS:
 		switch (chan->type) {
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH 4/8 staging: iio: accel: adis16209_core.c: fix coding style

In reply to Murilo Opsfelder Araujo

This patch adds missing blank line after declaration.

---
 drivers/staging/iio/accel/adis16209_core.c |    1 +
 1 file changed, 1 insertion(+)
drivers/staging/iio/accel/adis16209_core.c +1 -0
index 374dc6e..b2c7aed 100644
@@ -44,6 +44,7 @@ static int adis16209_write_raw(struct iio_dev *indio_dev,
 	int bits;
 	s16 val16;
 	u8 addr;
+
 	switch (mask) {
 	case IIO_CHAN_INFO_CALIBBIAS:
 		switch (chan->type) {
Signature · 1 line
1.7.10.4
#5 lore raw

PATCH 5/8 staging: iio: accel: adis16240_core.c: fix coding style

In reply to Murilo Opsfelder Araujo

This patch adds missing blank line after declaration.

---
 drivers/staging/iio/accel/adis16240_core.c |    1 +
 1 file changed, 1 insertion(+)
drivers/staging/iio/accel/adis16240_core.c +1 -0
index 74ace2a..205d6d0 100644
@@ -163,6 +163,7 @@ static int adis16240_write_raw(struct iio_dev *indio_dev,
 	int bits = 10;
 	s16 val16;
 	u8 addr;
+
 	switch (mask) {
 	case IIO_CHAN_INFO_CALIBBIAS:
 		val16 = val & ((1 << bits) - 1);
Signature · 1 line
1.7.10.4
#6 lore raw

PATCH 6/8 staging: iio: accel: lis3l02dq_core.c: fix coding style

In reply to Murilo Opsfelder Araujo

This patch adds missing blank line after declarations.

---
 drivers/staging/iio/accel/lis3l02dq_core.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/staging/iio/accel/lis3l02dq_core.c +4 -0
index 898653c..f5e145c 100644
@@ -212,6 +212,7 @@ static int lis3l02dq_write_thresh(struct iio_dev *indio_dev,
 				  int val, int val2)
 {
 	u16 value = val;
+
 	return lis3l02dq_spi_write_reg_s16(indio_dev,
 					   LIS3L02DQ_REG_THS_L_ADDR,
 					   value);
@@ -226,6 +227,7 @@ static int lis3l02dq_write_raw(struct iio_dev *indio_dev,
 	int ret = -EINVAL, reg;
 	u8 uval;
 	s8 sval;
+
 	switch (mask) {
 	case IIO_CHAN_INFO_CALIBBIAS:
 		if (val > 255 || val < -256)
@@ -302,6 +304,7 @@ static ssize_t lis3l02dq_read_frequency(struct device *dev,
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	int ret, len = 0;
 	s8 t;
+
 	ret = lis3l02dq_spi_read_reg_8(indio_dev,
 				       LIS3L02DQ_REG_CTRL_1_ADDR,
 				       (u8 *)&t);
@@ -565,6 +568,7 @@ static int lis3l02dq_read_event_config(struct iio_dev *indio_dev,
 	u8 val;
 	int ret;
 	u8 mask = (1 << (chan->channel2*2 + (dir == IIO_EV_DIR_RISING)));
+
 	ret = lis3l02dq_spi_read_reg_8(indio_dev,
 				       LIS3L02DQ_REG_WAKE_UP_CFG_ADDR,
 				       &val);
Signature · 1 line
1.7.10.4
#7 lore raw

PATCH 7/8 staging: iio: accel: lis3l02dq_ring.c: fix coding style

In reply to Murilo Opsfelder Araujo

This patch adds missing blank lines after declarations.

---
 drivers/staging/iio/accel/lis3l02dq_ring.c |    1 +
 1 file changed, 1 insertion(+)
drivers/staging/iio/accel/lis3l02dq_ring.c +1 -0
index bf33fde..1d934ee 100644
@@ -19,6 +19,7 @@ static inline u16 combine_8_to_16(u8 lower, u8 upper)
 {
 	u16 _lower = lower;
 	u16 _upper = upper;
+
 	return _lower | (_upper << 8);
 }
 
Signature · 1 line
1.7.10.4
#8 lore raw

PATCH 8/8 staging: iio: accel: sca3000_core.c: fix coding style

In reply to Murilo Opsfelder Araujo

This patch adds missing blank line after declaration and keep line in 80-chars limit.

---
 drivers/staging/iio/accel/sca3000_core.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/iio/accel/sca3000_core.c +3 -1
index ed30e32..1ff299f 100644
@@ -506,7 +506,8 @@ static int sca3000_read_raw(struct iio_dev *indio_dev,
 				mutex_unlock(&st->lock);
 				return ret;
 			}
-			*val = ((st->rx[0] & 0x3F) << 3) | ((st->rx[1] & 0xE0) >> 5);
+			*val = ((st->rx[0] & 0x3F) << 3)
+				| ((st->rx[1] & 0xE0) >> 5);
 		}
 		mutex_unlock(&st->lock);
 		return IIO_VAL_INT;
@@ -713,6 +714,7 @@ static int sca3000_read_thresh(struct iio_dev *indio_dev,
 	int ret, i;
 	struct sca3000_state *st = iio_priv(indio_dev);
 	int num = chan->channel2;
+
 	mutex_lock(&st->lock);
 	ret = sca3000_read_ctrl_reg(st, sca3000_addresses[num][1]);
 	mutex_unlock(&st->lock);
Signature · 1 line
1.7.10.4
#9 lore raw
In reply to Murilo Opsfelder Araujo
Quoted 12 lines · Murilo Opsfelder Araujo

The following patches fix (almost) all warnings reported by checkpatch.pl.

Murilo Opsfelder Araujo (8):
staging: iio: accel: adis16203_core.c: fix coding style
staging: iio: accel: adis16201_core.c: fix coding style
staging: iio: accel: adis16204_core.c: fix coding style
staging: iio: accel: adis16209_core.c: fix coding style
staging: iio: accel: adis16240_core.c: fix coding style
staging: iio: accel: lis3l02dq_core.c: fix coding style
staging: iio: accel: lis3l02dq_ring.c: fix coding style
staging: iio: accel: sca3000_core.c: fix coding style

Hi.

Next time it might be better to use patch subjects like

staging: <subsystem> Add blank lines between declarations and code

because "fix coding style" really isn't very descriptive.