All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] *** SUBJECT HERE ***
@ 2019-03-23 12:53 Cristian Sicilia
  2019-03-23 12:53 ` [PATCH 3/5] staging: iio: adc: Avoid precedence issues in macro Cristian Sicilia
                   ` (6 more replies)
  0 siblings, 7 replies; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-23 12:53 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Some source refactoring, parameters aligment and camel case clearing.

Replacement of bool to bitfield in a struct, but not found
the population to check if it is done correctly.

Cristian Sicilia (5):
  staging: iio: adc: Tab alignment
  staging: iio: adc: Converted bool to bitfield format
  staging: iio: adc: Avoid precedence issues in macro
  staging: iio: adc: Adding temp var to improve readability
  staging: iio: adc: Remove CamelCase notation

 drivers/staging/iio/adc/ad7192.h  |  16 +++---
 drivers/staging/iio/adc/ad7280a.c | 109 ++++++++++++++++++--------------------
 2 files changed, 60 insertions(+), 65 deletions(-)

-- 
2.7.4


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

* [PATCH 3/5] staging: iio: adc: Avoid precedence issues in macro
  2019-03-23 12:53 [PATCH 0/5] *** SUBJECT HERE *** Cristian Sicilia
@ 2019-03-23 12:53 ` Cristian Sicilia
  2019-03-23 12:53 ` [PATCH 4/5] staging: iio: adc: Adding temp var to improve readability Cristian Sicilia
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-23 12:53 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Enclosing parameter with parenthesis due to avoid
possible precedence issue.

Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
---
 drivers/staging/iio/adc/ad7280a.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index 55b5879..d81a5bd 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -97,9 +97,10 @@
 #define AD7280A_NUM_CH			(AD7280A_AUX_ADC_6 - \
 					AD7280A_CELL_VOLTAGE_1 + 1)
 
-#define AD7280A_CALC_VOLTAGE_CHAN_NUM(d, c) ((d * AD7280A_CELLS_PER_DEV) + c)
-#define AD7280A_CALC_TEMP_CHAN_NUM(d, c)    ((d * AD7280A_CELLS_PER_DEV) + \
-					     c - AD7280A_CELLS_PER_DEV)
+#define AD7280A_CALC_VOLTAGE_CHAN_NUM(d, c) (((d) * AD7280A_CELLS_PER_DEV) + \
+					     (c))
+#define AD7280A_CALC_TEMP_CHAN_NUM(d, c)    (((d) * AD7280A_CELLS_PER_DEV) + \
+					     (c) - AD7280A_CELLS_PER_DEV)
 
 #define AD7280A_DEVADDR_MASTER		0
 #define AD7280A_DEVADDR_ALL		0x1F
-- 
2.7.4


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

* [PATCH 4/5] staging: iio: adc: Adding temp var to improve readability
  2019-03-23 12:53 [PATCH 0/5] *** SUBJECT HERE *** Cristian Sicilia
  2019-03-23 12:53 ` [PATCH 3/5] staging: iio: adc: Avoid precedence issues in macro Cristian Sicilia
@ 2019-03-23 12:53 ` Cristian Sicilia
  2019-03-23 12:54 ` [PATCH 2/5] staging: iio: adc: Converted bool to bitfield format Cristian Sicilia
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-23 12:53 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Creating a temporary variable to improve readability

Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
---
 drivers/staging/iio/adc/ad7280a.c | 55 ++++++++++++++++++---------------------
 1 file changed, 25 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index d81a5bd..5d848aa 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -784,43 +784,38 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
 	for (i = 0; i < st->scan_cnt; i++) {
 		if (((channels[i] >> 23) & 0xF) <= AD7280A_CELL_VOLTAGE_6) {
 			if (((channels[i] >> 11) & 0xFFF) >=
-				st->cell_threshhigh)
-				iio_push_event(indio_dev,
-					       IIO_EVENT_CODE(IIO_VOLTAGE,
-							1,
-							0,
-							IIO_EV_DIR_RISING,
-							IIO_EV_TYPE_THRESH,
-							0, 0, 0),
+			    st->cell_threshhigh) {
+				u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0,
+							 IIO_EV_DIR_RISING,
+							 IIO_EV_TYPE_THRESH,
+							 0, 0, 0);
+				iio_push_event(indio_dev, tmp,
 					       iio_get_time_ns(indio_dev));
-			else if (((channels[i] >> 11) & 0xFFF) <=
-				st->cell_threshlow)
-				iio_push_event(indio_dev,
-					       IIO_EVENT_CODE(IIO_VOLTAGE,
-							1,
-							0,
-							IIO_EV_DIR_FALLING,
-							IIO_EV_TYPE_THRESH,
-							0, 0, 0),
+			} else if (((channels[i] >> 11) & 0xFFF) <=
+				   st->cell_threshlow) {
+				u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0,
+							 IIO_EV_DIR_FALLING,
+							 IIO_EV_TYPE_THRESH,
+							 0, 0, 0);
+				iio_push_event(indio_dev, tmp,
 					       iio_get_time_ns(indio_dev));
+			}
 		} else {
-			if (((channels[i] >> 11) & 0xFFF) >= st->aux_threshhigh)
-				iio_push_event(indio_dev,
-					       IIO_UNMOD_EVENT_CODE(
-							IIO_TEMP,
-							0,
+			if (((channels[i] >> 11) & 0xFFF) >=
+			    st->aux_threshhigh) {
+				u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
 							IIO_EV_TYPE_THRESH,
-							IIO_EV_DIR_RISING),
+							IIO_EV_DIR_RISING);
+				iio_push_event(indio_dev, tmp,
 					       iio_get_time_ns(indio_dev));
-			else if (((channels[i] >> 11) & 0xFFF) <=
-				st->aux_threshlow)
-				iio_push_event(indio_dev,
-					       IIO_UNMOD_EVENT_CODE(
-							IIO_TEMP,
-							0,
+			} else if (((channels[i] >> 11) & 0xFFF) <=
+				st->aux_threshlow) {
+				u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
 							IIO_EV_TYPE_THRESH,
-							IIO_EV_DIR_FALLING),
+							IIO_EV_DIR_FALLING);
+				iio_push_event(indio_dev, tmp,
 					       iio_get_time_ns(indio_dev));
+			}
 		}
 	}
 
-- 
2.7.4


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

* [PATCH 2/5] staging: iio: adc: Converted bool to bitfield format
  2019-03-23 12:53 [PATCH 0/5] *** SUBJECT HERE *** Cristian Sicilia
  2019-03-23 12:53 ` [PATCH 3/5] staging: iio: adc: Avoid precedence issues in macro Cristian Sicilia
  2019-03-23 12:53 ` [PATCH 4/5] staging: iio: adc: Adding temp var to improve readability Cristian Sicilia
@ 2019-03-23 12:54 ` Cristian Sicilia
  2019-03-23 12:54 ` [PATCH 5/5] staging: iio: adc: Remove CamelCase notation Cristian Sicilia
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-23 12:54 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Changed bool format to bitfield format to save space.

Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>

---
The strange thing is that this struct seems not populated
using a DTS binding function.
---
 drivers/staging/iio/adc/ad7192.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7192.h b/drivers/staging/iio/adc/ad7192.h
index 7433a43..87891ba 100644
--- a/drivers/staging/iio/adc/ad7192.h
+++ b/drivers/staging/iio/adc/ad7192.h
@@ -35,13 +35,13 @@ struct ad7192_platform_data {
 	u16		vref_mv;
 	u8		clock_source_sel;
 	u32		ext_clk_hz;
-	bool		refin2_en;
-	bool		rej60_en;
-	bool		sinc3_en;
-	bool		chop_en;
-	bool		buf_en;
-	bool		unipolar_en;
-	bool		burnout_curr_en;
-};
+	u8		refin2_en:1;
+	u8		rej60_en:1;
+	u8		sinc3_en:1;
+	u8		chop_en:1;
+	u8		buf_en:1;
+	u8		unipolar_en:1;
+	u8		burnout_curr_en:1;
+} __attribute__((__packed__));
 
 #endif /* IIO_ADC_AD7192_H_ */
-- 
2.7.4


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

* [PATCH 5/5] staging: iio: adc: Remove CamelCase notation
  2019-03-23 12:53 [PATCH 0/5] *** SUBJECT HERE *** Cristian Sicilia
                   ` (2 preceding siblings ...)
  2019-03-23 12:54 ` [PATCH 2/5] staging: iio: adc: Converted bool to bitfield format Cristian Sicilia
@ 2019-03-23 12:54 ` Cristian Sicilia
  2019-03-23 12:58 ` [PATCH 1/5] staging: iio: adc: Tab alignment Cristian Sicilia
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-23 12:54 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
---
 drivers/staging/iio/adc/ad7280a.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index 5d848aa..c02454c 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -917,8 +917,8 @@ static int ad7280_probe(struct spi_device *spi)
 	const struct ad7280_platform_data *pdata = dev_get_platdata(&spi->dev);
 	struct ad7280_state *st;
 	int ret;
-	const unsigned short tACQ_ns[4] = {465, 1010, 1460, 1890};
-	const unsigned short nAVG[4] = {1, 2, 4, 8};
+	const unsigned short t_acq_ns[4] = {465, 1010, 1460, 1890};
+	const unsigned short n_avg[4] = {1, 2, 4, 8};
 	struct iio_dev *indio_dev;
 
 	indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
@@ -966,10 +966,9 @@ static int ad7280_probe(struct spi_device *spi)
 	 */
 
 	st->readback_delay_us =
-		((tACQ_ns[pdata->acquisition_time & 0x3] + 695) *
-		(AD7280A_NUM_CH * nAVG[pdata->conversion_averaging & 0x3]))
-		- tACQ_ns[pdata->acquisition_time & 0x3] +
-		st->slave_num * 250;
+		((t_acq_ns[pdata->acquisition_time & 0x3] + 695) *
+		 (AD7280A_NUM_CH * n_avg[pdata->conversion_averaging & 0x3])) -
+		t_acq_ns[pdata->acquisition_time & 0x3] + st->slave_num * 250;
 
 	/* Convert to usecs */
 	st->readback_delay_us = DIV_ROUND_UP(st->readback_delay_us, 1000);
-- 
2.7.4


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

* [PATCH 1/5] staging: iio: adc: Tab alignment
  2019-03-23 12:53 [PATCH 0/5] *** SUBJECT HERE *** Cristian Sicilia
                   ` (3 preceding siblings ...)
  2019-03-23 12:54 ` [PATCH 5/5] staging: iio: adc: Remove CamelCase notation Cristian Sicilia
@ 2019-03-23 12:58 ` Cristian Sicilia
  2019-03-23 19:21 ` [PATCH v2 0/5] staging: iio: adc: Code refactoring and bool to bitfield change Cristian Sicilia
  2019-03-23 19:24 ` [PATCH 0/5] *** SUBJECT HERE *** Matt Ranostay
  6 siblings, 0 replies; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-23 12:58 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Aligned some parameters.

Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
---
 drivers/staging/iio/adc/ad7280a.c | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index d9df126..55b5879 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -830,30 +830,30 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
 }
 
 static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
-		in_voltage-voltage_thresh_low_value,
-		0644,
-		ad7280_read_channel_config,
-		ad7280_write_channel_config,
-		AD7280A_CELL_UNDERVOLTAGE);
+			     in_voltage - voltage_thresh_low_value,
+			     0644,
+			     ad7280_read_channel_config,
+			     ad7280_write_channel_config,
+			     AD7280A_CELL_UNDERVOLTAGE);
 
 static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value,
-		in_voltage-voltage_thresh_high_value,
-		0644,
-		ad7280_read_channel_config,
-		ad7280_write_channel_config,
-		AD7280A_CELL_OVERVOLTAGE);
+			     in_voltage - voltage_thresh_high_value,
+			     0644,
+			     ad7280_read_channel_config,
+			     ad7280_write_channel_config,
+			     AD7280A_CELL_OVERVOLTAGE);
 
 static IIO_DEVICE_ATTR(in_temp_thresh_low_value,
-		0644,
-		ad7280_read_channel_config,
-		ad7280_write_channel_config,
-		AD7280A_AUX_ADC_UNDERVOLTAGE);
+		       0644,
+		       ad7280_read_channel_config,
+		       ad7280_write_channel_config,
+		       AD7280A_AUX_ADC_UNDERVOLTAGE);
 
 static IIO_DEVICE_ATTR(in_temp_thresh_high_value,
-		0644,
-		ad7280_read_channel_config,
-		ad7280_write_channel_config,
-		AD7280A_AUX_ADC_OVERVOLTAGE);
+		       0644,
+		       ad7280_read_channel_config,
+		       ad7280_write_channel_config,
+		       AD7280A_AUX_ADC_OVERVOLTAGE);
 
 static struct attribute *ad7280_event_attributes[] = {
 	&iio_dev_attr_in_thresh_low_value.dev_attr.attr,
-- 
2.7.4


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

* [PATCH v2 0/5] staging: iio: adc: Code refactoring and bool to bitfield change
  2019-03-23 12:53 [PATCH 0/5] *** SUBJECT HERE *** Cristian Sicilia
                   ` (4 preceding siblings ...)
  2019-03-23 12:58 ` [PATCH 1/5] staging: iio: adc: Tab alignment Cristian Sicilia
@ 2019-03-23 19:21 ` Cristian Sicilia
  2019-03-23 19:21   ` [PATCH v2 1/5] staging: iio: adc: Tab alignment Cristian Sicilia
                     ` (5 more replies)
  2019-03-23 19:24 ` [PATCH 0/5] *** SUBJECT HERE *** Matt Ranostay
  6 siblings, 6 replies; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-23 19:21 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Some source refactoring, parameters alignment and camel case clearing.

Replacement of bool to bitfield in a struct, but not found
the population to check if it is done correctly.

Cristian Sicilia (5):
  staging: iio: adc: Tab alignment
  staging: iio: adc: Converted bool to bitfield format
  staging: iio: adc: Avoid precedence issues in macro
  staging: iio: adc: Adding temp var to improve readability
  staging: iio: adc: Remove CamelCase notation

 drivers/staging/iio/adc/ad7192.h  |  16 +++---
 drivers/staging/iio/adc/ad7280a.c | 109 ++++++++++++++++++--------------------
 2 files changed, 60 insertions(+), 65 deletions(-)

-- 
2.7.4


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

* [PATCH v2 1/5] staging: iio: adc: Tab alignment
  2019-03-23 19:21 ` [PATCH v2 0/5] staging: iio: adc: Code refactoring and bool to bitfield change Cristian Sicilia
@ 2019-03-23 19:21   ` Cristian Sicilia
  2019-03-24 12:35     ` Jonathan Cameron
  2019-03-23 19:21   ` [PATCH v2 2/5] staging: iio: adc: Converted bool to bitfield format Cristian Sicilia
                     ` (4 subsequent siblings)
  5 siblings, 1 reply; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-23 19:21 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Aligned some parameters.

Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
---
 drivers/staging/iio/adc/ad7280a.c | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index d9df126..55b5879 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -830,30 +830,30 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
 }
 
 static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
-		in_voltage-voltage_thresh_low_value,
-		0644,
-		ad7280_read_channel_config,
-		ad7280_write_channel_config,
-		AD7280A_CELL_UNDERVOLTAGE);
+			     in_voltage - voltage_thresh_low_value,
+			     0644,
+			     ad7280_read_channel_config,
+			     ad7280_write_channel_config,
+			     AD7280A_CELL_UNDERVOLTAGE);
 
 static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value,
-		in_voltage-voltage_thresh_high_value,
-		0644,
-		ad7280_read_channel_config,
-		ad7280_write_channel_config,
-		AD7280A_CELL_OVERVOLTAGE);
+			     in_voltage - voltage_thresh_high_value,
+			     0644,
+			     ad7280_read_channel_config,
+			     ad7280_write_channel_config,
+			     AD7280A_CELL_OVERVOLTAGE);
 
 static IIO_DEVICE_ATTR(in_temp_thresh_low_value,
-		0644,
-		ad7280_read_channel_config,
-		ad7280_write_channel_config,
-		AD7280A_AUX_ADC_UNDERVOLTAGE);
+		       0644,
+		       ad7280_read_channel_config,
+		       ad7280_write_channel_config,
+		       AD7280A_AUX_ADC_UNDERVOLTAGE);
 
 static IIO_DEVICE_ATTR(in_temp_thresh_high_value,
-		0644,
-		ad7280_read_channel_config,
-		ad7280_write_channel_config,
-		AD7280A_AUX_ADC_OVERVOLTAGE);
+		       0644,
+		       ad7280_read_channel_config,
+		       ad7280_write_channel_config,
+		       AD7280A_AUX_ADC_OVERVOLTAGE);
 
 static struct attribute *ad7280_event_attributes[] = {
 	&iio_dev_attr_in_thresh_low_value.dev_attr.attr,
-- 
2.7.4


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

* [PATCH v2 2/5] staging: iio: adc: Converted bool to bitfield format
  2019-03-23 19:21 ` [PATCH v2 0/5] staging: iio: adc: Code refactoring and bool to bitfield change Cristian Sicilia
  2019-03-23 19:21   ` [PATCH v2 1/5] staging: iio: adc: Tab alignment Cristian Sicilia
@ 2019-03-23 19:21   ` Cristian Sicilia
  2019-03-24 12:34     ` Jonathan Cameron
  2019-03-23 19:21   ` [PATCH v2 3/5] staging: iio: adc: Avoid precedence issues in macro Cristian Sicilia
                     ` (3 subsequent siblings)
  5 siblings, 1 reply; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-23 19:21 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Changed bool format to bitfield format to save space.

Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>

---
The strange thing is that this struct seems not populated
using a DTS binding function.
---
 drivers/staging/iio/adc/ad7192.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7192.h b/drivers/staging/iio/adc/ad7192.h
index 7433a43..87891ba 100644
--- a/drivers/staging/iio/adc/ad7192.h
+++ b/drivers/staging/iio/adc/ad7192.h
@@ -35,13 +35,13 @@ struct ad7192_platform_data {
 	u16		vref_mv;
 	u8		clock_source_sel;
 	u32		ext_clk_hz;
-	bool		refin2_en;
-	bool		rej60_en;
-	bool		sinc3_en;
-	bool		chop_en;
-	bool		buf_en;
-	bool		unipolar_en;
-	bool		burnout_curr_en;
-};
+	u8		refin2_en:1;
+	u8		rej60_en:1;
+	u8		sinc3_en:1;
+	u8		chop_en:1;
+	u8		buf_en:1;
+	u8		unipolar_en:1;
+	u8		burnout_curr_en:1;
+} __attribute__((__packed__));
 
 #endif /* IIO_ADC_AD7192_H_ */
-- 
2.7.4


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

* [PATCH v2 3/5] staging: iio: adc: Avoid precedence issues in macro
  2019-03-23 19:21 ` [PATCH v2 0/5] staging: iio: adc: Code refactoring and bool to bitfield change Cristian Sicilia
  2019-03-23 19:21   ` [PATCH v2 1/5] staging: iio: adc: Tab alignment Cristian Sicilia
  2019-03-23 19:21   ` [PATCH v2 2/5] staging: iio: adc: Converted bool to bitfield format Cristian Sicilia
@ 2019-03-23 19:21   ` Cristian Sicilia
  2019-03-24 12:37     ` Jonathan Cameron
  2019-03-23 19:21   ` [PATCH v2 4/5] staging: iio: adc: Adding temp var to improve readability Cristian Sicilia
                     ` (2 subsequent siblings)
  5 siblings, 1 reply; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-23 19:21 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Enclosing parameter with parenthesis due to avoid
possible precedence issue.

Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
---
 drivers/staging/iio/adc/ad7280a.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index 55b5879..d81a5bd 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -97,9 +97,10 @@
 #define AD7280A_NUM_CH			(AD7280A_AUX_ADC_6 - \
 					AD7280A_CELL_VOLTAGE_1 + 1)
 
-#define AD7280A_CALC_VOLTAGE_CHAN_NUM(d, c) ((d * AD7280A_CELLS_PER_DEV) + c)
-#define AD7280A_CALC_TEMP_CHAN_NUM(d, c)    ((d * AD7280A_CELLS_PER_DEV) + \
-					     c - AD7280A_CELLS_PER_DEV)
+#define AD7280A_CALC_VOLTAGE_CHAN_NUM(d, c) (((d) * AD7280A_CELLS_PER_DEV) + \
+					     (c))
+#define AD7280A_CALC_TEMP_CHAN_NUM(d, c)    (((d) * AD7280A_CELLS_PER_DEV) + \
+					     (c) - AD7280A_CELLS_PER_DEV)
 
 #define AD7280A_DEVADDR_MASTER		0
 #define AD7280A_DEVADDR_ALL		0x1F
-- 
2.7.4


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

* [PATCH v2 4/5] staging: iio: adc: Adding temp var to improve readability
  2019-03-23 19:21 ` [PATCH v2 0/5] staging: iio: adc: Code refactoring and bool to bitfield change Cristian Sicilia
                     ` (2 preceding siblings ...)
  2019-03-23 19:21   ` [PATCH v2 3/5] staging: iio: adc: Avoid precedence issues in macro Cristian Sicilia
@ 2019-03-23 19:21   ` Cristian Sicilia
  2019-03-24 12:41     ` Jonathan Cameron
  2019-03-23 19:21   ` [PATCH v2 5/5] staging: iio: adc: Remove CamelCase notation Cristian Sicilia
  2019-03-24 17:27     ` [PATCH v3 " Cristian Sicilia
  5 siblings, 1 reply; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-23 19:21 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Creating a temporary variable to improve readability

Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
---
 drivers/staging/iio/adc/ad7280a.c | 55 ++++++++++++++++++---------------------
 1 file changed, 25 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index d81a5bd..5d848aa 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -784,43 +784,38 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
 	for (i = 0; i < st->scan_cnt; i++) {
 		if (((channels[i] >> 23) & 0xF) <= AD7280A_CELL_VOLTAGE_6) {
 			if (((channels[i] >> 11) & 0xFFF) >=
-				st->cell_threshhigh)
-				iio_push_event(indio_dev,
-					       IIO_EVENT_CODE(IIO_VOLTAGE,
-							1,
-							0,
-							IIO_EV_DIR_RISING,
-							IIO_EV_TYPE_THRESH,
-							0, 0, 0),
+			    st->cell_threshhigh) {
+				u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0,
+							 IIO_EV_DIR_RISING,
+							 IIO_EV_TYPE_THRESH,
+							 0, 0, 0);
+				iio_push_event(indio_dev, tmp,
 					       iio_get_time_ns(indio_dev));
-			else if (((channels[i] >> 11) & 0xFFF) <=
-				st->cell_threshlow)
-				iio_push_event(indio_dev,
-					       IIO_EVENT_CODE(IIO_VOLTAGE,
-							1,
-							0,
-							IIO_EV_DIR_FALLING,
-							IIO_EV_TYPE_THRESH,
-							0, 0, 0),
+			} else if (((channels[i] >> 11) & 0xFFF) <=
+				   st->cell_threshlow) {
+				u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0,
+							 IIO_EV_DIR_FALLING,
+							 IIO_EV_TYPE_THRESH,
+							 0, 0, 0);
+				iio_push_event(indio_dev, tmp,
 					       iio_get_time_ns(indio_dev));
+			}
 		} else {
-			if (((channels[i] >> 11) & 0xFFF) >= st->aux_threshhigh)
-				iio_push_event(indio_dev,
-					       IIO_UNMOD_EVENT_CODE(
-							IIO_TEMP,
-							0,
+			if (((channels[i] >> 11) & 0xFFF) >=
+			    st->aux_threshhigh) {
+				u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
 							IIO_EV_TYPE_THRESH,
-							IIO_EV_DIR_RISING),
+							IIO_EV_DIR_RISING);
+				iio_push_event(indio_dev, tmp,
 					       iio_get_time_ns(indio_dev));
-			else if (((channels[i] >> 11) & 0xFFF) <=
-				st->aux_threshlow)
-				iio_push_event(indio_dev,
-					       IIO_UNMOD_EVENT_CODE(
-							IIO_TEMP,
-							0,
+			} else if (((channels[i] >> 11) & 0xFFF) <=
+				st->aux_threshlow) {
+				u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
 							IIO_EV_TYPE_THRESH,
-							IIO_EV_DIR_FALLING),
+							IIO_EV_DIR_FALLING);
+				iio_push_event(indio_dev, tmp,
 					       iio_get_time_ns(indio_dev));
+			}
 		}
 	}
 
-- 
2.7.4


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

* [PATCH v2 5/5] staging: iio: adc: Remove CamelCase notation
  2019-03-23 19:21 ` [PATCH v2 0/5] staging: iio: adc: Code refactoring and bool to bitfield change Cristian Sicilia
                     ` (3 preceding siblings ...)
  2019-03-23 19:21   ` [PATCH v2 4/5] staging: iio: adc: Adding temp var to improve readability Cristian Sicilia
@ 2019-03-23 19:21   ` Cristian Sicilia
  2019-03-24 14:56     ` Jonathan Cameron
  2019-03-24 17:27     ` [PATCH v3 " Cristian Sicilia
  5 siblings, 1 reply; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-23 19:21 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Fix CamelCase naming.

Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
---
 drivers/staging/iio/adc/ad7280a.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index 5d848aa..c02454c 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -917,8 +917,8 @@ static int ad7280_probe(struct spi_device *spi)
 	const struct ad7280_platform_data *pdata = dev_get_platdata(&spi->dev);
 	struct ad7280_state *st;
 	int ret;
-	const unsigned short tACQ_ns[4] = {465, 1010, 1460, 1890};
-	const unsigned short nAVG[4] = {1, 2, 4, 8};
+	const unsigned short t_acq_ns[4] = {465, 1010, 1460, 1890};
+	const unsigned short n_avg[4] = {1, 2, 4, 8};
 	struct iio_dev *indio_dev;
 
 	indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
@@ -966,10 +966,9 @@ static int ad7280_probe(struct spi_device *spi)
 	 */
 
 	st->readback_delay_us =
-		((tACQ_ns[pdata->acquisition_time & 0x3] + 695) *
-		(AD7280A_NUM_CH * nAVG[pdata->conversion_averaging & 0x3]))
-		- tACQ_ns[pdata->acquisition_time & 0x3] +
-		st->slave_num * 250;
+		((t_acq_ns[pdata->acquisition_time & 0x3] + 695) *
+		 (AD7280A_NUM_CH * n_avg[pdata->conversion_averaging & 0x3])) -
+		t_acq_ns[pdata->acquisition_time & 0x3] + st->slave_num * 250;
 
 	/* Convert to usecs */
 	st->readback_delay_us = DIV_ROUND_UP(st->readback_delay_us, 1000);
-- 
2.7.4


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

* Re: [PATCH 0/5] *** SUBJECT HERE ***
  2019-03-23 12:53 [PATCH 0/5] *** SUBJECT HERE *** Cristian Sicilia
                   ` (5 preceding siblings ...)
  2019-03-23 19:21 ` [PATCH v2 0/5] staging: iio: adc: Code refactoring and bool to bitfield change Cristian Sicilia
@ 2019-03-23 19:24 ` Matt Ranostay
  6 siblings, 0 replies; 42+ messages in thread
From: Matt Ranostay @ 2019-03-23 19:24 UTC (permalink / raw)
  To: Cristian Sicilia
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

You may want to change "*** SUBJECT HERE ***"  in the future :)

- Matt

On Sat, Mar 23, 2019 at 5:53 AM Cristian Sicilia
<sicilia.cristian@gmail.com> wrote:
>
> Some source refactoring, parameters aligment and camel case clearing.
>
> Replacement of bool to bitfield in a struct, but not found
> the population to check if it is done correctly.
>
> Cristian Sicilia (5):
>   staging: iio: adc: Tab alignment
>   staging: iio: adc: Converted bool to bitfield format
>   staging: iio: adc: Avoid precedence issues in macro
>   staging: iio: adc: Adding temp var to improve readability
>   staging: iio: adc: Remove CamelCase notation
>
>  drivers/staging/iio/adc/ad7192.h  |  16 +++---
>  drivers/staging/iio/adc/ad7280a.c | 109 ++++++++++++++++++--------------------
>  2 files changed, 60 insertions(+), 65 deletions(-)
>
> --
> 2.7.4
>

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

* Re: [PATCH v2 2/5] staging: iio: adc: Converted bool to bitfield format
  2019-03-23 19:21   ` [PATCH v2 2/5] staging: iio: adc: Converted bool to bitfield format Cristian Sicilia
@ 2019-03-24 12:34     ` Jonathan Cameron
  2019-03-24 16:33       ` Sicilia Cristian
  0 siblings, 1 reply; 42+ messages in thread
From: Jonathan Cameron @ 2019-03-24 12:34 UTC (permalink / raw)
  To: Cristian Sicilia
  Cc: Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel

On Sat, 23 Mar 2019 20:21:39 +0100
Cristian Sicilia <sicilia.cristian@gmail.com> wrote:

> Changed bool format to bitfield format to save space.
> 
> Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
> 
> ---
> The strange thing is that this struct seems not populated
> using a DTS binding function.
Indeed and that should have definitely been a warning sign ;)
We are looking at traditional platform data here (pre device
tree) and generally we will want to drop it entirely for old
drivers that we are looking to move out of staging.

I don't mind improving it prior to dropping (as it avoids
setting bad precedence in the code base in the meantime) but
one comment inline...

> ---
>  drivers/staging/iio/adc/ad7192.h | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7192.h b/drivers/staging/iio/adc/ad7192.h
> index 7433a43..87891ba 100644
> --- a/drivers/staging/iio/adc/ad7192.h
> +++ b/drivers/staging/iio/adc/ad7192.h
> @@ -35,13 +35,13 @@ struct ad7192_platform_data {
>  	u16		vref_mv;
>  	u8		clock_source_sel;
>  	u32		ext_clk_hz;
> -	bool		refin2_en;
> -	bool		rej60_en;
> -	bool		sinc3_en;
> -	bool		chop_en;
> -	bool		buf_en;
> -	bool		unipolar_en;
> -	bool		burnout_curr_en;
> -};
> +	u8		refin2_en:1;
> +	u8		rej60_en:1;
> +	u8		sinc3_en:1;
> +	u8		chop_en:1;
> +	u8		buf_en:1;
> +	u8		unipolar_en:1;
> +	u8		burnout_curr_en:1;
> +} __attribute__((__packed__));
Please don't use packed for anything without a very very good reason.
it may result in data layouts that are much harder to read from.
That obviously doesn't matter here as I doubt it's read in a fast path.

>  
>  #endif /* IIO_ADC_AD7192_H_ */


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

* Re: [PATCH v2 1/5] staging: iio: adc: Tab alignment
  2019-03-23 19:21   ` [PATCH v2 1/5] staging: iio: adc: Tab alignment Cristian Sicilia
@ 2019-03-24 12:35     ` Jonathan Cameron
  2019-03-24 16:34       ` Cristian Sicilia
  0 siblings, 1 reply; 42+ messages in thread
From: Jonathan Cameron @ 2019-03-24 12:35 UTC (permalink / raw)
  To: Cristian Sicilia
  Cc: Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel

On Sat, 23 Mar 2019 20:21:36 +0100
Cristian Sicilia <sicilia.cristian@gmail.com> wrote:

> Aligned some parameters.
> 
> Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
> ---
>  drivers/staging/iio/adc/ad7280a.c | 36 ++++++++++++++++++------------------
>  1 file changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> index d9df126..55b5879 100644
> --- a/drivers/staging/iio/adc/ad7280a.c
> +++ b/drivers/staging/iio/adc/ad7280a.c
> @@ -830,30 +830,30 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
>  }
>  
>  static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
> -		in_voltage-voltage_thresh_low_value,
> -		0644,
> -		ad7280_read_channel_config,
> -		ad7280_write_channel_config,
> -		AD7280A_CELL_UNDERVOLTAGE);
> +			     in_voltage - voltage_thresh_low_value,
Firstly, that isn't in your description and secondly you just
broke the userspace ABI.  Take a very good look at what is happening here.

> +			     0644,
> +			     ad7280_read_channel_config,
> +			     ad7280_write_channel_config,
> +			     AD7280A_CELL_UNDERVOLTAGE);
>  
>  static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value,
> -		in_voltage-voltage_thresh_high_value,
> -		0644,
> -		ad7280_read_channel_config,
> -		ad7280_write_channel_config,
> -		AD7280A_CELL_OVERVOLTAGE);
> +			     in_voltage - voltage_thresh_high_value,
> +			     0644,
> +			     ad7280_read_channel_config,
> +			     ad7280_write_channel_config,
> +			     AD7280A_CELL_OVERVOLTAGE);
>  
>  static IIO_DEVICE_ATTR(in_temp_thresh_low_value,
> -		0644,
> -		ad7280_read_channel_config,
> -		ad7280_write_channel_config,
> -		AD7280A_AUX_ADC_UNDERVOLTAGE);
> +		       0644,
> +		       ad7280_read_channel_config,
> +		       ad7280_write_channel_config,
> +		       AD7280A_AUX_ADC_UNDERVOLTAGE);
>  
>  static IIO_DEVICE_ATTR(in_temp_thresh_high_value,
> -		0644,
> -		ad7280_read_channel_config,
> -		ad7280_write_channel_config,
> -		AD7280A_AUX_ADC_OVERVOLTAGE);
> +		       0644,
> +		       ad7280_read_channel_config,
> +		       ad7280_write_channel_config,
> +		       AD7280A_AUX_ADC_OVERVOLTAGE);
>  
>  static struct attribute *ad7280_event_attributes[] = {
>  	&iio_dev_attr_in_thresh_low_value.dev_attr.attr,


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

* Re: [PATCH v2 3/5] staging: iio: adc: Avoid precedence issues in macro
  2019-03-23 19:21   ` [PATCH v2 3/5] staging: iio: adc: Avoid precedence issues in macro Cristian Sicilia
@ 2019-03-24 12:37     ` Jonathan Cameron
  0 siblings, 0 replies; 42+ messages in thread
From: Jonathan Cameron @ 2019-03-24 12:37 UTC (permalink / raw)
  To: Cristian Sicilia
  Cc: Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel

On Sat, 23 Mar 2019 20:21:42 +0100
Cristian Sicilia <sicilia.cristian@gmail.com> wrote:

> Enclosing parameter with parenthesis due to avoid
> possible precedence issue.
> 
> Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
Applied to the togreg branch of iio.git which will get first
pushed out as testing for the autobuilders to play with it.

Thanks,

Jonathan

> ---
>  drivers/staging/iio/adc/ad7280a.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> index 55b5879..d81a5bd 100644
> --- a/drivers/staging/iio/adc/ad7280a.c
> +++ b/drivers/staging/iio/adc/ad7280a.c
> @@ -97,9 +97,10 @@
>  #define AD7280A_NUM_CH			(AD7280A_AUX_ADC_6 - \
>  					AD7280A_CELL_VOLTAGE_1 + 1)
>  
> -#define AD7280A_CALC_VOLTAGE_CHAN_NUM(d, c) ((d * AD7280A_CELLS_PER_DEV) + c)
> -#define AD7280A_CALC_TEMP_CHAN_NUM(d, c)    ((d * AD7280A_CELLS_PER_DEV) + \
> -					     c - AD7280A_CELLS_PER_DEV)
> +#define AD7280A_CALC_VOLTAGE_CHAN_NUM(d, c) (((d) * AD7280A_CELLS_PER_DEV) + \
> +					     (c))
> +#define AD7280A_CALC_TEMP_CHAN_NUM(d, c)    (((d) * AD7280A_CELLS_PER_DEV) + \
> +					     (c) - AD7280A_CELLS_PER_DEV)
>  
>  #define AD7280A_DEVADDR_MASTER		0
>  #define AD7280A_DEVADDR_ALL		0x1F


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

* Re: [PATCH v2 4/5] staging: iio: adc: Adding temp var to improve readability
  2019-03-23 19:21   ` [PATCH v2 4/5] staging: iio: adc: Adding temp var to improve readability Cristian Sicilia
@ 2019-03-24 12:41     ` Jonathan Cameron
  0 siblings, 0 replies; 42+ messages in thread
From: Jonathan Cameron @ 2019-03-24 12:41 UTC (permalink / raw)
  To: Cristian Sicilia
  Cc: Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel

On Sat, 23 Mar 2019 20:21:45 +0100
Cristian Sicilia <sicilia.cristian@gmail.com> wrote:

> Creating a temporary variable to improve readability
> 
> Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>

Indeed makes it a little more readable, so fair enough.

Applied

Thanks,

Jonathan

> ---
>  drivers/staging/iio/adc/ad7280a.c | 55 ++++++++++++++++++---------------------
>  1 file changed, 25 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> index d81a5bd..5d848aa 100644
> --- a/drivers/staging/iio/adc/ad7280a.c
> +++ b/drivers/staging/iio/adc/ad7280a.c
> @@ -784,43 +784,38 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
>  	for (i = 0; i < st->scan_cnt; i++) {
>  		if (((channels[i] >> 23) & 0xF) <= AD7280A_CELL_VOLTAGE_6) {
>  			if (((channels[i] >> 11) & 0xFFF) >=
> -				st->cell_threshhigh)
> -				iio_push_event(indio_dev,
> -					       IIO_EVENT_CODE(IIO_VOLTAGE,
> -							1,
> -							0,
> -							IIO_EV_DIR_RISING,
> -							IIO_EV_TYPE_THRESH,
> -							0, 0, 0),
> +			    st->cell_threshhigh) {
> +				u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0,
> +							 IIO_EV_DIR_RISING,
> +							 IIO_EV_TYPE_THRESH,
> +							 0, 0, 0);
> +				iio_push_event(indio_dev, tmp,
>  					       iio_get_time_ns(indio_dev));
> -			else if (((channels[i] >> 11) & 0xFFF) <=
> -				st->cell_threshlow)
> -				iio_push_event(indio_dev,
> -					       IIO_EVENT_CODE(IIO_VOLTAGE,
> -							1,
> -							0,
> -							IIO_EV_DIR_FALLING,
> -							IIO_EV_TYPE_THRESH,
> -							0, 0, 0),
> +			} else if (((channels[i] >> 11) & 0xFFF) <=
> +				   st->cell_threshlow) {
> +				u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0,
> +							 IIO_EV_DIR_FALLING,
> +							 IIO_EV_TYPE_THRESH,
> +							 0, 0, 0);
> +				iio_push_event(indio_dev, tmp,
>  					       iio_get_time_ns(indio_dev));
> +			}
>  		} else {
> -			if (((channels[i] >> 11) & 0xFFF) >= st->aux_threshhigh)
> -				iio_push_event(indio_dev,
> -					       IIO_UNMOD_EVENT_CODE(
> -							IIO_TEMP,
> -							0,
> +			if (((channels[i] >> 11) & 0xFFF) >=
> +			    st->aux_threshhigh) {
> +				u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
>  							IIO_EV_TYPE_THRESH,
> -							IIO_EV_DIR_RISING),
> +							IIO_EV_DIR_RISING);
> +				iio_push_event(indio_dev, tmp,
>  					       iio_get_time_ns(indio_dev));
> -			else if (((channels[i] >> 11) & 0xFFF) <=
> -				st->aux_threshlow)
> -				iio_push_event(indio_dev,
> -					       IIO_UNMOD_EVENT_CODE(
> -							IIO_TEMP,
> -							0,
> +			} else if (((channels[i] >> 11) & 0xFFF) <=
> +				st->aux_threshlow) {
> +				u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
>  							IIO_EV_TYPE_THRESH,
> -							IIO_EV_DIR_FALLING),
> +							IIO_EV_DIR_FALLING);
> +				iio_push_event(indio_dev, tmp,
>  					       iio_get_time_ns(indio_dev));
> +			}
>  		}
>  	}
>  


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

* Re: [PATCH v2 5/5] staging: iio: adc: Remove CamelCase notation
  2019-03-23 19:21   ` [PATCH v2 5/5] staging: iio: adc: Remove CamelCase notation Cristian Sicilia
@ 2019-03-24 14:56     ` Jonathan Cameron
  0 siblings, 0 replies; 42+ messages in thread
From: Jonathan Cameron @ 2019-03-24 14:56 UTC (permalink / raw)
  To: Cristian Sicilia
  Cc: Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel

On Sat, 23 Mar 2019 20:21:49 +0100
Cristian Sicilia <sicilia.cristian@gmail.com> wrote:

> Fix CamelCase naming.
> 
> Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
Applied.

Note that I added the part number to the titles of all these patches
so that people can readily see what they are actually changing.
Directory isn't very helpful when there can potentially be many 10s
of drivers in there (not true in this case, but still more than 1!)

Thanks,

Jonathan


> ---
>  drivers/staging/iio/adc/ad7280a.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> index 5d848aa..c02454c 100644
> --- a/drivers/staging/iio/adc/ad7280a.c
> +++ b/drivers/staging/iio/adc/ad7280a.c
> @@ -917,8 +917,8 @@ static int ad7280_probe(struct spi_device *spi)
>  	const struct ad7280_platform_data *pdata = dev_get_platdata(&spi->dev);
>  	struct ad7280_state *st;
>  	int ret;
> -	const unsigned short tACQ_ns[4] = {465, 1010, 1460, 1890};
> -	const unsigned short nAVG[4] = {1, 2, 4, 8};
> +	const unsigned short t_acq_ns[4] = {465, 1010, 1460, 1890};
> +	const unsigned short n_avg[4] = {1, 2, 4, 8};
>  	struct iio_dev *indio_dev;
>  
>  	indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
> @@ -966,10 +966,9 @@ static int ad7280_probe(struct spi_device *spi)
>  	 */
>  
>  	st->readback_delay_us =
> -		((tACQ_ns[pdata->acquisition_time & 0x3] + 695) *
> -		(AD7280A_NUM_CH * nAVG[pdata->conversion_averaging & 0x3]))
> -		- tACQ_ns[pdata->acquisition_time & 0x3] +
> -		st->slave_num * 250;
> +		((t_acq_ns[pdata->acquisition_time & 0x3] + 695) *
> +		 (AD7280A_NUM_CH * n_avg[pdata->conversion_averaging & 0x3])) -
> +		t_acq_ns[pdata->acquisition_time & 0x3] + st->slave_num * 250;
>  
>  	/* Convert to usecs */
>  	st->readback_delay_us = DIV_ROUND_UP(st->readback_delay_us, 1000);


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

* Re: [PATCH v2 2/5] staging: iio: adc: Converted bool to bitfield format
  2019-03-24 12:34     ` Jonathan Cameron
@ 2019-03-24 16:33       ` Sicilia Cristian
  0 siblings, 0 replies; 42+ messages in thread
From: Sicilia Cristian @ 2019-03-24 16:33 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel

On Sun, Mar 24, 2019 at 12:34:52PM +0000, Jonathan Cameron wrote:
> On Sat, 23 Mar 2019 20:21:39 +0100
> Cristian Sicilia <sicilia.cristian@gmail.com> wrote:
> 
 > > Changed bool format to bitfield format to save space.
> > 
> > Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
> > 
> > ---
> > The strange thing is that this struct seems not populated
> > using a DTS binding function.
> Indeed and that should have definitely been a warning sign ;)
> We are looking at traditional platform data here (pre device
> tree) and generally we will want to drop it entirely for old
> drivers that we are looking to move out of staging.
> 
> I don't mind improving it prior to dropping (as it avoids
> setting bad precedence in the code base in the meantime) but
> one comment inline...
> 

Thanks for comment

> > ---
> >  drivers/staging/iio/adc/ad7192.h | 16 ++++++++--------
> >  1 file changed, 8 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/staging/iio/adc/ad7192.h b/drivers/staging/iio/adc/ad7192.h
> > index 7433a43..87891ba 100644
> > --- a/drivers/staging/iio/adc/ad7192.h
> > +++ b/drivers/staging/iio/adc/ad7192.h
> > @@ -35,13 +35,13 @@ struct ad7192_platform_data {
> >  	u16		vref_mv;
> >  	u8		clock_source_sel;
> >  	u32		ext_clk_hz;
> > -	bool		refin2_en;
> > -	bool		rej60_en;
> > -	bool		sinc3_en;
> > -	bool		chop_en;
> > -	bool		buf_en;
> > -	bool		unipolar_en;
> > -	bool		burnout_curr_en;
> > -};
> > +	u8		refin2_en:1;
> > +	u8		rej60_en:1;
> > +	u8		sinc3_en:1;
> > +	u8		chop_en:1;
> > +	u8		buf_en:1;
> > +	u8		unipolar_en:1;
> > +	u8		burnout_curr_en:1;
> > +} __attribute__((__packed__));
> Please don't use packed for anything without a very very good reason.
> it may result in data layouts that are much harder to read from.
> That obviously doesn't matter here as I doubt it's read in a fast path.

Ok, I remove it, thanks

> 
> >  
> >  #endif /* IIO_ADC_AD7192_H_ */
> 

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

* Re: [PATCH v2 1/5] staging: iio: adc: Tab alignment
  2019-03-24 12:35     ` Jonathan Cameron
@ 2019-03-24 16:34       ` Cristian Sicilia
  0 siblings, 0 replies; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-24 16:34 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel

On Sun, Mar 24, 2019 at 12:35:52PM +0000, Jonathan Cameron wrote:
> On Sat, 23 Mar 2019 20:21:36 +0100
> Cristian Sicilia <sicilia.cristian@gmail.com> wrote:
>
> > Aligned some parameters.
> >
> > Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
> > ---
> >  drivers/staging/iio/adc/ad7280a.c | 36 ++++++++++++++++++------------------
> >  1 file changed, 18 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> > index d9df126..55b5879 100644
> > --- a/drivers/staging/iio/adc/ad7280a.c
> > +++ b/drivers/staging/iio/adc/ad7280a.c
> > @@ -830,30 +830,30 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
> >  }
> >
> >  static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
> > -           in_voltage-voltage_thresh_low_value,
> > -           0644,
> > -           ad7280_read_channel_config,
> > -           ad7280_write_channel_config,
> > -           AD7280A_CELL_UNDERVOLTAGE);
> > +                        in_voltage - voltage_thresh_low_value,
> Firstly, that isn't in your description and secondly you just
> broke the userspace ABI.  Take a very good look at what is happening here.

Yes sorry, it will badly stringify, I fix it


>
> > +                        0644,
> > +                        ad7280_read_channel_config,
> > +                        ad7280_write_channel_config,
> > +                        AD7280A_CELL_UNDERVOLTAGE);
> >
> >  static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value,
> > -           in_voltage-voltage_thresh_high_value,
> > -           0644,
> > -           ad7280_read_channel_config,
> > -           ad7280_write_channel_config,
> > -           AD7280A_CELL_OVERVOLTAGE);
> > +                        in_voltage - voltage_thresh_high_value,
> > +                        0644,
> > +                        ad7280_read_channel_config,
> > +                        ad7280_write_channel_config,
> > +                        AD7280A_CELL_OVERVOLTAGE);
> >
> >  static IIO_DEVICE_ATTR(in_temp_thresh_low_value,
> > -           0644,
> > -           ad7280_read_channel_config,
> > -           ad7280_write_channel_config,
> > -           AD7280A_AUX_ADC_UNDERVOLTAGE);
> > +                  0644,
> > +                  ad7280_read_channel_config,
> > +                  ad7280_write_channel_config,
> > +                  AD7280A_AUX_ADC_UNDERVOLTAGE);
> >
> >  static IIO_DEVICE_ATTR(in_temp_thresh_high_value,
> > -           0644,
> > -           ad7280_read_channel_config,
> > -           ad7280_write_channel_config,
> > -           AD7280A_AUX_ADC_OVERVOLTAGE);
> > +                  0644,
> > +                  ad7280_read_channel_config,
> > +                  ad7280_write_channel_config,
> > +                  AD7280A_AUX_ADC_OVERVOLTAGE);
> >
> >  static struct attribute *ad7280_event_attributes[] = {
> >     &iio_dev_attr_in_thresh_low_value.dev_attr.attr,
>

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

* [PATCH v2 0/5] staging: iio: adc: Code refactoring and bool to bitfield change
@ 2019-03-24 17:27     ` Cristian Sicilia
  0 siblings, 0 replies; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-24 17:23 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Some source refactoring, parameters alignment and camel case clearing.

Replacement of bool to bitfield in a struct, but not found
the population to check if it is done correctly.

Cristian Sicilia (5):
  staging: iio: adc: ad7280a: Tab alignment
  staging: iio: adc: ad7192: Converted bool to bitfield format
  staging: iio: adc: ad7280a: Avoid precedence issues in macro
  staging: iio: adc: ad7280a: Adding temp var to improve readability
  staging: iio: adc: ad7280a: Remove CamelCase notation

 drivers/staging/iio/adc/ad7192.h  |  14 ++---
 drivers/staging/iio/adc/ad7280a.c | 109 ++++++++++++++++++--------------------
 2 files changed, 59 insertions(+), 64 deletions(-)

-- 
2.7.4


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

* [PATCH v3 1/5] staging: iio: adc: ad7280a: Tab alignment
  2019-03-24 17:27     ` [PATCH v3 " Cristian Sicilia
  (?)
@ 2019-03-24 17:23     ` Cristian Sicilia
  2019-03-31  9:29       ` Jonathan Cameron
  -1 siblings, 1 reply; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-24 17:23 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Aligned some parameters.

Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
---
 drivers/staging/iio/adc/ad7280a.c | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index d9df126..571535d 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -830,30 +830,30 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
 }
 
 static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
-		in_voltage-voltage_thresh_low_value,
-		0644,
-		ad7280_read_channel_config,
-		ad7280_write_channel_config,
-		AD7280A_CELL_UNDERVOLTAGE);
+			     in_voltage-voltage_thresh_low_value,
+			     0644,
+			     ad7280_read_channel_config,
+			     ad7280_write_channel_config,
+			     AD7280A_CELL_UNDERVOLTAGE);
 
 static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value,
-		in_voltage-voltage_thresh_high_value,
-		0644,
-		ad7280_read_channel_config,
-		ad7280_write_channel_config,
-		AD7280A_CELL_OVERVOLTAGE);
+			     in_voltage-voltage_thresh_high_value,
+			     0644,
+			     ad7280_read_channel_config,
+			     ad7280_write_channel_config,
+			     AD7280A_CELL_OVERVOLTAGE);
 
 static IIO_DEVICE_ATTR(in_temp_thresh_low_value,
-		0644,
-		ad7280_read_channel_config,
-		ad7280_write_channel_config,
-		AD7280A_AUX_ADC_UNDERVOLTAGE);
+		       0644,
+		       ad7280_read_channel_config,
+		       ad7280_write_channel_config,
+		       AD7280A_AUX_ADC_UNDERVOLTAGE);
 
 static IIO_DEVICE_ATTR(in_temp_thresh_high_value,
-		0644,
-		ad7280_read_channel_config,
-		ad7280_write_channel_config,
-		AD7280A_AUX_ADC_OVERVOLTAGE);
+		       0644,
+		       ad7280_read_channel_config,
+		       ad7280_write_channel_config,
+		       AD7280A_AUX_ADC_OVERVOLTAGE);
 
 static struct attribute *ad7280_event_attributes[] = {
 	&iio_dev_attr_in_thresh_low_value.dev_attr.attr,
-- 
2.7.4


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

* [PATCH v3 2/5] staging: iio: adc: ad7192: Converted bool to bitfield format
  2019-03-24 17:27     ` [PATCH v3 " Cristian Sicilia
  (?)
  (?)
@ 2019-03-24 17:23     ` Cristian Sicilia
  2019-03-31  9:32       ` Jonathan Cameron
  -1 siblings, 1 reply; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-24 17:23 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Changed bool format to bitfield format to save space.

Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
---
 drivers/staging/iio/adc/ad7192.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7192.h b/drivers/staging/iio/adc/ad7192.h
index 7433a43..9c1d223 100644
--- a/drivers/staging/iio/adc/ad7192.h
+++ b/drivers/staging/iio/adc/ad7192.h
@@ -35,13 +35,13 @@ struct ad7192_platform_data {
 	u16		vref_mv;
 	u8		clock_source_sel;
 	u32		ext_clk_hz;
-	bool		refin2_en;
-	bool		rej60_en;
-	bool		sinc3_en;
-	bool		chop_en;
-	bool		buf_en;
-	bool		unipolar_en;
-	bool		burnout_curr_en;
+	u8		refin2_en:1;
+	u8		rej60_en:1;
+	u8		sinc3_en:1;
+	u8		chop_en:1;
+	u8		buf_en:1;
+	u8		unipolar_en:1;
+	u8		burnout_curr_en:1;
 };
 
 #endif /* IIO_ADC_AD7192_H_ */
-- 
2.7.4


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

* [PATCH v3 3/5] staging: iio: adc: ad7280a: Avoid precedence issues in macro
  2019-03-24 17:27     ` [PATCH v3 " Cristian Sicilia
                       ` (2 preceding siblings ...)
  (?)
@ 2019-03-24 17:23     ` Cristian Sicilia
  2019-03-31  9:34       ` Jonathan Cameron
  -1 siblings, 1 reply; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-24 17:23 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Enclosing parameter with parenthesis due to avoid
possible precedence issue.

Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
---
 drivers/staging/iio/adc/ad7280a.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index 571535d..c2391f6 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -97,9 +97,10 @@
 #define AD7280A_NUM_CH			(AD7280A_AUX_ADC_6 - \
 					AD7280A_CELL_VOLTAGE_1 + 1)
 
-#define AD7280A_CALC_VOLTAGE_CHAN_NUM(d, c) ((d * AD7280A_CELLS_PER_DEV) + c)
-#define AD7280A_CALC_TEMP_CHAN_NUM(d, c)    ((d * AD7280A_CELLS_PER_DEV) + \
-					     c - AD7280A_CELLS_PER_DEV)
+#define AD7280A_CALC_VOLTAGE_CHAN_NUM(d, c) (((d) * AD7280A_CELLS_PER_DEV) + \
+					     (c))
+#define AD7280A_CALC_TEMP_CHAN_NUM(d, c)    (((d) * AD7280A_CELLS_PER_DEV) + \
+					     (c) - AD7280A_CELLS_PER_DEV)
 
 #define AD7280A_DEVADDR_MASTER		0
 #define AD7280A_DEVADDR_ALL		0x1F
-- 
2.7.4


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

* [PATCH v3 4/5] staging: iio: adc: ad7280a: Adding temp var to improve readability
  2019-03-24 17:27     ` [PATCH v3 " Cristian Sicilia
                       ` (3 preceding siblings ...)
  (?)
@ 2019-03-24 17:23     ` Cristian Sicilia
  2019-03-31  9:35       ` Jonathan Cameron
  2019-03-31  9:35       ` Jonathan Cameron
  -1 siblings, 2 replies; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-24 17:23 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Creating a temporary variable to improve readability

Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
---
 drivers/staging/iio/adc/ad7280a.c | 55 ++++++++++++++++++---------------------
 1 file changed, 25 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index c2391f6..4ff28f1 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -784,43 +784,38 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
 	for (i = 0; i < st->scan_cnt; i++) {
 		if (((channels[i] >> 23) & 0xF) <= AD7280A_CELL_VOLTAGE_6) {
 			if (((channels[i] >> 11) & 0xFFF) >=
-				st->cell_threshhigh)
-				iio_push_event(indio_dev,
-					       IIO_EVENT_CODE(IIO_VOLTAGE,
-							1,
-							0,
-							IIO_EV_DIR_RISING,
-							IIO_EV_TYPE_THRESH,
-							0, 0, 0),
+			    st->cell_threshhigh) {
+				u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0,
+							 IIO_EV_DIR_RISING,
+							 IIO_EV_TYPE_THRESH,
+							 0, 0, 0);
+				iio_push_event(indio_dev, tmp,
 					       iio_get_time_ns(indio_dev));
-			else if (((channels[i] >> 11) & 0xFFF) <=
-				st->cell_threshlow)
-				iio_push_event(indio_dev,
-					       IIO_EVENT_CODE(IIO_VOLTAGE,
-							1,
-							0,
-							IIO_EV_DIR_FALLING,
-							IIO_EV_TYPE_THRESH,
-							0, 0, 0),
+			} else if (((channels[i] >> 11) & 0xFFF) <=
+				   st->cell_threshlow) {
+				u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0,
+							 IIO_EV_DIR_FALLING,
+							 IIO_EV_TYPE_THRESH,
+							 0, 0, 0);
+				iio_push_event(indio_dev, tmp,
 					       iio_get_time_ns(indio_dev));
+			}
 		} else {
-			if (((channels[i] >> 11) & 0xFFF) >= st->aux_threshhigh)
-				iio_push_event(indio_dev,
-					       IIO_UNMOD_EVENT_CODE(
-							IIO_TEMP,
-							0,
+			if (((channels[i] >> 11) & 0xFFF) >=
+			    st->aux_threshhigh) {
+				u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
 							IIO_EV_TYPE_THRESH,
-							IIO_EV_DIR_RISING),
+							IIO_EV_DIR_RISING);
+				iio_push_event(indio_dev, tmp,
 					       iio_get_time_ns(indio_dev));
-			else if (((channels[i] >> 11) & 0xFFF) <=
-				st->aux_threshlow)
-				iio_push_event(indio_dev,
-					       IIO_UNMOD_EVENT_CODE(
-							IIO_TEMP,
-							0,
+			} else if (((channels[i] >> 11) & 0xFFF) <=
+				st->aux_threshlow) {
+				u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
 							IIO_EV_TYPE_THRESH,
-							IIO_EV_DIR_FALLING),
+							IIO_EV_DIR_FALLING);
+				iio_push_event(indio_dev, tmp,
 					       iio_get_time_ns(indio_dev));
+			}
 		}
 	}
 
-- 
2.7.4


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

* [PATCH v3 5/5] staging: iio: adc: ad7280a: Remove CamelCase notation
  2019-03-24 17:27     ` [PATCH v3 " Cristian Sicilia
                       ` (4 preceding siblings ...)
  (?)
@ 2019-03-24 17:23     ` Cristian Sicilia
  2019-03-31  9:37       ` Jonathan Cameron
  -1 siblings, 1 reply; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-24 17:23 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Fix CamelCase naming.

Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
---
 drivers/staging/iio/adc/ad7280a.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index 4ff28f1..229dcad 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -917,8 +917,8 @@ static int ad7280_probe(struct spi_device *spi)
 	const struct ad7280_platform_data *pdata = dev_get_platdata(&spi->dev);
 	struct ad7280_state *st;
 	int ret;
-	const unsigned short tACQ_ns[4] = {465, 1010, 1460, 1890};
-	const unsigned short nAVG[4] = {1, 2, 4, 8};
+	const unsigned short t_acq_ns[4] = {465, 1010, 1460, 1890};
+	const unsigned short n_avg[4] = {1, 2, 4, 8};
 	struct iio_dev *indio_dev;
 
 	indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
@@ -966,10 +966,9 @@ static int ad7280_probe(struct spi_device *spi)
 	 */
 
 	st->readback_delay_us =
-		((tACQ_ns[pdata->acquisition_time & 0x3] + 695) *
-		(AD7280A_NUM_CH * nAVG[pdata->conversion_averaging & 0x3]))
-		- tACQ_ns[pdata->acquisition_time & 0x3] +
-		st->slave_num * 250;
+		((t_acq_ns[pdata->acquisition_time & 0x3] + 695) *
+		 (AD7280A_NUM_CH * n_avg[pdata->conversion_averaging & 0x3])) -
+		t_acq_ns[pdata->acquisition_time & 0x3] + st->slave_num * 250;
 
 	/* Convert to usecs */
 	st->readback_delay_us = DIV_ROUND_UP(st->readback_delay_us, 1000);
-- 
2.7.4


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

* [PATCH v3 0/5] staging: iio: adc: Code refactoring and bool to bitfield change
@ 2019-03-24 17:27     ` Cristian Sicilia
  0 siblings, 0 replies; 42+ messages in thread
From: Cristian Sicilia @ 2019-03-24 17:27 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel

Some source refactoring, parameters alignment and camel case clearing.

Replacement of bool to bitfield in a struct, but not found
the population to check if it is done correctly.

Cristian Sicilia (5):
  staging: iio: adc: ad7280a: Tab alignment
  staging: iio: adc: ad7192: Converted bool to bitfield format
  staging: iio: adc: ad7280a: Avoid precedence issues in macro
  staging: iio: adc: ad7280a: Adding temp var to improve readability
  staging: iio: adc: ad7280a: Remove CamelCase notation

 drivers/staging/iio/adc/ad7192.h  |  14 ++---
 drivers/staging/iio/adc/ad7280a.c | 109 ++++++++++++++++++--------------------
 2 files changed, 59 insertions(+), 64 deletions(-)

-- 
2.7.4


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

* Re: [PATCH v3 1/5] staging: iio: adc: ad7280a: Tab alignment
  2019-03-24 17:23     ` [PATCH v3 1/5] staging: iio: adc: ad7280a: Tab alignment Cristian Sicilia
@ 2019-03-31  9:29       ` Jonathan Cameron
  0 siblings, 0 replies; 42+ messages in thread
From: Jonathan Cameron @ 2019-03-31  9:29 UTC (permalink / raw)
  To: Cristian Sicilia
  Cc: Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel

On Sun, 24 Mar 2019 18:23:09 +0100
Cristian Sicilia <sicilia.cristian@gmail.com> wrote:

> Aligned some parameters.
> 
> Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
Applied to the togreg branch of iio.git and pushed out as testing.

Thanks,

Jonathan

> ---
>  drivers/staging/iio/adc/ad7280a.c | 36 ++++++++++++++++++------------------
>  1 file changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> index d9df126..571535d 100644
> --- a/drivers/staging/iio/adc/ad7280a.c
> +++ b/drivers/staging/iio/adc/ad7280a.c
> @@ -830,30 +830,30 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
>  }
>  
>  static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
> -		in_voltage-voltage_thresh_low_value,
> -		0644,
> -		ad7280_read_channel_config,
> -		ad7280_write_channel_config,
> -		AD7280A_CELL_UNDERVOLTAGE);
> +			     in_voltage-voltage_thresh_low_value,
> +			     0644,
> +			     ad7280_read_channel_config,
> +			     ad7280_write_channel_config,
> +			     AD7280A_CELL_UNDERVOLTAGE);
>  
>  static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value,
> -		in_voltage-voltage_thresh_high_value,
> -		0644,
> -		ad7280_read_channel_config,
> -		ad7280_write_channel_config,
> -		AD7280A_CELL_OVERVOLTAGE);
> +			     in_voltage-voltage_thresh_high_value,
> +			     0644,
> +			     ad7280_read_channel_config,
> +			     ad7280_write_channel_config,
> +			     AD7280A_CELL_OVERVOLTAGE);
>  
>  static IIO_DEVICE_ATTR(in_temp_thresh_low_value,
> -		0644,
> -		ad7280_read_channel_config,
> -		ad7280_write_channel_config,
> -		AD7280A_AUX_ADC_UNDERVOLTAGE);
> +		       0644,
> +		       ad7280_read_channel_config,
> +		       ad7280_write_channel_config,
> +		       AD7280A_AUX_ADC_UNDERVOLTAGE);
>  
>  static IIO_DEVICE_ATTR(in_temp_thresh_high_value,
> -		0644,
> -		ad7280_read_channel_config,
> -		ad7280_write_channel_config,
> -		AD7280A_AUX_ADC_OVERVOLTAGE);
> +		       0644,
> +		       ad7280_read_channel_config,
> +		       ad7280_write_channel_config,
> +		       AD7280A_AUX_ADC_OVERVOLTAGE);
>  
>  static struct attribute *ad7280_event_attributes[] = {
>  	&iio_dev_attr_in_thresh_low_value.dev_attr.attr,


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

* Re: [PATCH v3 2/5] staging: iio: adc: ad7192: Converted bool to bitfield format
  2019-03-24 17:23     ` [PATCH v3 2/5] staging: iio: adc: ad7192: Converted bool to bitfield format Cristian Sicilia
@ 2019-03-31  9:32       ` Jonathan Cameron
  0 siblings, 0 replies; 42+ messages in thread
From: Jonathan Cameron @ 2019-03-31  9:32 UTC (permalink / raw)
  To: Cristian Sicilia
  Cc: Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel

On Sun, 24 Mar 2019 18:23:11 +0100
Cristian Sicilia <sicilia.cristian@gmail.com> wrote:

> Changed bool format to bitfield format to save space.
> 
> Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
This driver is undergoing active rework to move out of staging
and in the meantime these fields have been dropped.

So not applied as no longer relevant.

Thanks,

Jonathan

> ---
>  drivers/staging/iio/adc/ad7192.h | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7192.h b/drivers/staging/iio/adc/ad7192.h
> index 7433a43..9c1d223 100644
> --- a/drivers/staging/iio/adc/ad7192.h
> +++ b/drivers/staging/iio/adc/ad7192.h
> @@ -35,13 +35,13 @@ struct ad7192_platform_data {
>  	u16		vref_mv;
>  	u8		clock_source_sel;
>  	u32		ext_clk_hz;
> -	bool		refin2_en;
> -	bool		rej60_en;
> -	bool		sinc3_en;
> -	bool		chop_en;
> -	bool		buf_en;
> -	bool		unipolar_en;
> -	bool		burnout_curr_en;
> +	u8		refin2_en:1;
> +	u8		rej60_en:1;
> +	u8		sinc3_en:1;
> +	u8		chop_en:1;
> +	u8		buf_en:1;
> +	u8		unipolar_en:1;
> +	u8		burnout_curr_en:1;
>  };
>  
>  #endif /* IIO_ADC_AD7192_H_ */


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

* Re: [PATCH v3 3/5] staging: iio: adc: ad7280a: Avoid precedence issues in macro
  2019-03-24 17:23     ` [PATCH v3 3/5] staging: iio: adc: ad7280a: Avoid precedence issues in macro Cristian Sicilia
@ 2019-03-31  9:34       ` Jonathan Cameron
  0 siblings, 0 replies; 42+ messages in thread
From: Jonathan Cameron @ 2019-03-31  9:34 UTC (permalink / raw)
  To: Cristian Sicilia
  Cc: Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel

On Sun, 24 Mar 2019 18:23:12 +0100
Cristian Sicilia <sicilia.cristian@gmail.com> wrote:

> Enclosing parameter with parenthesis due to avoid
> possible precedence issue.
> 
> Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
I've already applied this one.

Thanks,

Jonathan

> ---
>  drivers/staging/iio/adc/ad7280a.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> index 571535d..c2391f6 100644
> --- a/drivers/staging/iio/adc/ad7280a.c
> +++ b/drivers/staging/iio/adc/ad7280a.c
> @@ -97,9 +97,10 @@
>  #define AD7280A_NUM_CH			(AD7280A_AUX_ADC_6 - \
>  					AD7280A_CELL_VOLTAGE_1 + 1)
>  
> -#define AD7280A_CALC_VOLTAGE_CHAN_NUM(d, c) ((d * AD7280A_CELLS_PER_DEV) + c)
> -#define AD7280A_CALC_TEMP_CHAN_NUM(d, c)    ((d * AD7280A_CELLS_PER_DEV) + \
> -					     c - AD7280A_CELLS_PER_DEV)
> +#define AD7280A_CALC_VOLTAGE_CHAN_NUM(d, c) (((d) * AD7280A_CELLS_PER_DEV) + \
> +					     (c))
> +#define AD7280A_CALC_TEMP_CHAN_NUM(d, c)    (((d) * AD7280A_CELLS_PER_DEV) + \
> +					     (c) - AD7280A_CELLS_PER_DEV)
>  
>  #define AD7280A_DEVADDR_MASTER		0
>  #define AD7280A_DEVADDR_ALL		0x1F


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

* Re: [PATCH v3 4/5] staging: iio: adc: ad7280a: Adding temp var to improve readability
  2019-03-24 17:23     ` [PATCH v3 4/5] staging: iio: adc: ad7280a: Adding temp var to improve readability Cristian Sicilia
@ 2019-03-31  9:35       ` Jonathan Cameron
  2019-03-31  9:35       ` Jonathan Cameron
  1 sibling, 0 replies; 42+ messages in thread
From: Jonathan Cameron @ 2019-03-31  9:35 UTC (permalink / raw)
  To: Cristian Sicilia
  Cc: Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel

On Sun, 24 Mar 2019 18:23:14 +0100
Cristian Sicilia <sicilia.cristian@gmail.com> wrote:

> Creating a temporary variable to improve readability
> 
> Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
I have already applied this one.

Thanks,

Jonathan

> ---
>  drivers/staging/iio/adc/ad7280a.c | 55 ++++++++++++++++++---------------------
>  1 file changed, 25 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> index c2391f6..4ff28f1 100644
> --- a/drivers/staging/iio/adc/ad7280a.c
> +++ b/drivers/staging/iio/adc/ad7280a.c
> @@ -784,43 +784,38 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
>  	for (i = 0; i < st->scan_cnt; i++) {
>  		if (((channels[i] >> 23) & 0xF) <= AD7280A_CELL_VOLTAGE_6) {
>  			if (((channels[i] >> 11) & 0xFFF) >=
> -				st->cell_threshhigh)
> -				iio_push_event(indio_dev,
> -					       IIO_EVENT_CODE(IIO_VOLTAGE,
> -							1,
> -							0,
> -							IIO_EV_DIR_RISING,
> -							IIO_EV_TYPE_THRESH,
> -							0, 0, 0),
> +			    st->cell_threshhigh) {
> +				u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0,
> +							 IIO_EV_DIR_RISING,
> +							 IIO_EV_TYPE_THRESH,
> +							 0, 0, 0);
> +				iio_push_event(indio_dev, tmp,
>  					       iio_get_time_ns(indio_dev));
> -			else if (((channels[i] >> 11) & 0xFFF) <=
> -				st->cell_threshlow)
> -				iio_push_event(indio_dev,
> -					       IIO_EVENT_CODE(IIO_VOLTAGE,
> -							1,
> -							0,
> -							IIO_EV_DIR_FALLING,
> -							IIO_EV_TYPE_THRESH,
> -							0, 0, 0),
> +			} else if (((channels[i] >> 11) & 0xFFF) <=
> +				   st->cell_threshlow) {
> +				u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0,
> +							 IIO_EV_DIR_FALLING,
> +							 IIO_EV_TYPE_THRESH,
> +							 0, 0, 0);
> +				iio_push_event(indio_dev, tmp,
>  					       iio_get_time_ns(indio_dev));
> +			}
>  		} else {
> -			if (((channels[i] >> 11) & 0xFFF) >= st->aux_threshhigh)
> -				iio_push_event(indio_dev,
> -					       IIO_UNMOD_EVENT_CODE(
> -							IIO_TEMP,
> -							0,
> +			if (((channels[i] >> 11) & 0xFFF) >=
> +			    st->aux_threshhigh) {
> +				u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
>  							IIO_EV_TYPE_THRESH,
> -							IIO_EV_DIR_RISING),
> +							IIO_EV_DIR_RISING);
> +				iio_push_event(indio_dev, tmp,
>  					       iio_get_time_ns(indio_dev));
> -			else if (((channels[i] >> 11) & 0xFFF) <=
> -				st->aux_threshlow)
> -				iio_push_event(indio_dev,
> -					       IIO_UNMOD_EVENT_CODE(
> -							IIO_TEMP,
> -							0,
> +			} else if (((channels[i] >> 11) & 0xFFF) <=
> +				st->aux_threshlow) {
> +				u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
>  							IIO_EV_TYPE_THRESH,
> -							IIO_EV_DIR_FALLING),
> +							IIO_EV_DIR_FALLING);
> +				iio_push_event(indio_dev, tmp,
>  					       iio_get_time_ns(indio_dev));
> +			}
>  		}
>  	}
>  


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

* Re: [PATCH v3 4/5] staging: iio: adc: ad7280a: Adding temp var to improve readability
  2019-03-24 17:23     ` [PATCH v3 4/5] staging: iio: adc: ad7280a: Adding temp var to improve readability Cristian Sicilia
  2019-03-31  9:35       ` Jonathan Cameron
@ 2019-03-31  9:35       ` Jonathan Cameron
  1 sibling, 0 replies; 42+ messages in thread
From: Jonathan Cameron @ 2019-03-31  9:35 UTC (permalink / raw)
  To: Cristian Sicilia
  Cc: Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel

On Sun, 24 Mar 2019 18:23:14 +0100
Cristian Sicilia <sicilia.cristian@gmail.com> wrote:

> Creating a temporary variable to improve readability
> 
> Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
Already applied this one as well.

Thanks,

Jonathan

> ---
>  drivers/staging/iio/adc/ad7280a.c | 55 ++++++++++++++++++---------------------
>  1 file changed, 25 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> index c2391f6..4ff28f1 100644
> --- a/drivers/staging/iio/adc/ad7280a.c
> +++ b/drivers/staging/iio/adc/ad7280a.c
> @@ -784,43 +784,38 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
>  	for (i = 0; i < st->scan_cnt; i++) {
>  		if (((channels[i] >> 23) & 0xF) <= AD7280A_CELL_VOLTAGE_6) {
>  			if (((channels[i] >> 11) & 0xFFF) >=
> -				st->cell_threshhigh)
> -				iio_push_event(indio_dev,
> -					       IIO_EVENT_CODE(IIO_VOLTAGE,
> -							1,
> -							0,
> -							IIO_EV_DIR_RISING,
> -							IIO_EV_TYPE_THRESH,
> -							0, 0, 0),
> +			    st->cell_threshhigh) {
> +				u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0,
> +							 IIO_EV_DIR_RISING,
> +							 IIO_EV_TYPE_THRESH,
> +							 0, 0, 0);
> +				iio_push_event(indio_dev, tmp,
>  					       iio_get_time_ns(indio_dev));
> -			else if (((channels[i] >> 11) & 0xFFF) <=
> -				st->cell_threshlow)
> -				iio_push_event(indio_dev,
> -					       IIO_EVENT_CODE(IIO_VOLTAGE,
> -							1,
> -							0,
> -							IIO_EV_DIR_FALLING,
> -							IIO_EV_TYPE_THRESH,
> -							0, 0, 0),
> +			} else if (((channels[i] >> 11) & 0xFFF) <=
> +				   st->cell_threshlow) {
> +				u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0,
> +							 IIO_EV_DIR_FALLING,
> +							 IIO_EV_TYPE_THRESH,
> +							 0, 0, 0);
> +				iio_push_event(indio_dev, tmp,
>  					       iio_get_time_ns(indio_dev));
> +			}
>  		} else {
> -			if (((channels[i] >> 11) & 0xFFF) >= st->aux_threshhigh)
> -				iio_push_event(indio_dev,
> -					       IIO_UNMOD_EVENT_CODE(
> -							IIO_TEMP,
> -							0,
> +			if (((channels[i] >> 11) & 0xFFF) >=
> +			    st->aux_threshhigh) {
> +				u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
>  							IIO_EV_TYPE_THRESH,
> -							IIO_EV_DIR_RISING),
> +							IIO_EV_DIR_RISING);
> +				iio_push_event(indio_dev, tmp,
>  					       iio_get_time_ns(indio_dev));
> -			else if (((channels[i] >> 11) & 0xFFF) <=
> -				st->aux_threshlow)
> -				iio_push_event(indio_dev,
> -					       IIO_UNMOD_EVENT_CODE(
> -							IIO_TEMP,
> -							0,
> +			} else if (((channels[i] >> 11) & 0xFFF) <=
> +				st->aux_threshlow) {
> +				u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
>  							IIO_EV_TYPE_THRESH,
> -							IIO_EV_DIR_FALLING),
> +							IIO_EV_DIR_FALLING);
> +				iio_push_event(indio_dev, tmp,
>  					       iio_get_time_ns(indio_dev));
> +			}
>  		}
>  	}
>  


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

* Re: [PATCH v3 5/5] staging: iio: adc: ad7280a: Remove CamelCase notation
  2019-03-24 17:23     ` [PATCH v3 5/5] staging: iio: adc: ad7280a: Remove CamelCase notation Cristian Sicilia
@ 2019-03-31  9:37       ` Jonathan Cameron
  0 siblings, 0 replies; 42+ messages in thread
From: Jonathan Cameron @ 2019-03-31  9:37 UTC (permalink / raw)
  To: Cristian Sicilia
  Cc: Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel

On Sun, 24 Mar 2019 18:23:16 +0100
Cristian Sicilia <sicilia.cristian@gmail.com> wrote:

> Fix CamelCase naming.
> 
> Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
Already applied this one as well.

So whole set has been applied.

Thanks,

Jonathan

> ---
>  drivers/staging/iio/adc/ad7280a.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> index 4ff28f1..229dcad 100644
> --- a/drivers/staging/iio/adc/ad7280a.c
> +++ b/drivers/staging/iio/adc/ad7280a.c
> @@ -917,8 +917,8 @@ static int ad7280_probe(struct spi_device *spi)
>  	const struct ad7280_platform_data *pdata = dev_get_platdata(&spi->dev);
>  	struct ad7280_state *st;
>  	int ret;
> -	const unsigned short tACQ_ns[4] = {465, 1010, 1460, 1890};
> -	const unsigned short nAVG[4] = {1, 2, 4, 8};
> +	const unsigned short t_acq_ns[4] = {465, 1010, 1460, 1890};
> +	const unsigned short n_avg[4] = {1, 2, 4, 8};
>  	struct iio_dev *indio_dev;
>  
>  	indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
> @@ -966,10 +966,9 @@ static int ad7280_probe(struct spi_device *spi)
>  	 */
>  
>  	st->readback_delay_us =
> -		((tACQ_ns[pdata->acquisition_time & 0x3] + 695) *
> -		(AD7280A_NUM_CH * nAVG[pdata->conversion_averaging & 0x3]))
> -		- tACQ_ns[pdata->acquisition_time & 0x3] +
> -		st->slave_num * 250;
> +		((t_acq_ns[pdata->acquisition_time & 0x3] + 695) *
> +		 (AD7280A_NUM_CH * n_avg[pdata->conversion_averaging & 0x3])) -
> +		t_acq_ns[pdata->acquisition_time & 0x3] + st->slave_num * 250;
>  
>  	/* Convert to usecs */
>  	st->readback_delay_us = DIV_ROUND_UP(st->readback_delay_us, 1000);


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

* Re: [PATCH 0/5] *** SUBJECT HERE ***
  2015-01-04  1:41     ` Konrad Zapalowicz
@ 2015-01-05 22:18       ` Paul Bolle
  0 siblings, 0 replies; 42+ messages in thread
From: Paul Bolle @ 2015-01-05 22:18 UTC (permalink / raw)
  To: Konrad Zapalowicz
  Cc: Greg KH, devel, pankaj.saraf, linux-kernel, abbotti,
	jitendra kumar khasdev

On Sun, 2015-01-04 at 02:41 +0100, Konrad Zapalowicz wrote:
> git send-email does one thing and one thing only - sends stuff via
> email. I do not see why it should parse the emails and decide whether to
> complete the operation or break based on what is in the emails.

It already has to parse the file(s) it's provided with. Perhaps it
already has checks to validate Subject: lines. Would an extra test be a
burden?

> It could
> warn though however since the cover letter is a product of different
> command introducing this logic would tightly couple those which is not
> good.

A warning would be too late: the message with the silly subject would be
already sent out.

> I guess that it is better that people who send stuff acctually care what
> they are sending. I mean that pretty quickly you learn to send the
> series of patches first to yourself and review before it goes out to the
> public.

It's good if people are careful. It's also good if programs help to
avoid silly mistakes.


Paul Bolle


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

* Re: [PATCH 0/5] *** SUBJECT HERE ***
  2015-01-03 22:54   ` Paul Bolle
@ 2015-01-04  1:41     ` Konrad Zapalowicz
  2015-01-05 22:18       ` Paul Bolle
  0 siblings, 1 reply; 42+ messages in thread
From: Konrad Zapalowicz @ 2015-01-04  1:41 UTC (permalink / raw)
  To: Paul Bolle
  Cc: Greg KH, devel, pankaj.saraf, linux-kernel, abbotti,
	jitendra kumar khasdev

On 01/03, Paul Bolle wrote:
> On Sat, 2015-01-03 at 08:45 -0800, Greg KH wrote:
> > On Sat, Jan 03, 2015 at 02:06:22PM +0530, jitendra kumar khasdev wrote:
> > > *** BLURB HERE ***
> > 
> > What blurb?  What subject?
> 
> jitendra used git-send-email to send this series. You'd expect
> git-send-email to die with an error if the cover letter, which it should
> see first, still contains these "*** [...] HERE ***" markers. What's the
> reason it doesn't do that?

git send-email does one thing and one thing only - sends stuff via
email. I do not see why it should parse the emails and decide whether to
complete the operation or break based on what is in the emails. It could
warn though however since the cover letter is a product of different
command introducing this logic would tightly couple those which is not
good.

I guess that it is better that people who send stuff acctually care what
they are sending. I mean that pretty quickly you learn to send the
series of patches first to yourself and review before it goes out to the
public.
 
> 
> Paul Bolle
> 
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 0/5] *** SUBJECT HERE ***
  2015-01-03 16:45 ` Greg KH
@ 2015-01-03 22:54   ` Paul Bolle
  2015-01-04  1:41     ` Konrad Zapalowicz
  0 siblings, 1 reply; 42+ messages in thread
From: Paul Bolle @ 2015-01-03 22:54 UTC (permalink / raw)
  To: Greg KH
  Cc: jitendra kumar khasdev, abbotti, hsweeten, devel, pankaj.saraf,
	linux-kernel

On Sat, 2015-01-03 at 08:45 -0800, Greg KH wrote:
> On Sat, Jan 03, 2015 at 02:06:22PM +0530, jitendra kumar khasdev wrote:
> > *** BLURB HERE ***
> 
> What blurb?  What subject?

jitendra used git-send-email to send this series. You'd expect
git-send-email to die with an error if the cover letter, which it should
see first, still contains these "*** [...] HERE ***" markers. What's the
reason it doesn't do that?


Paul Bolle


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

* Re: [PATCH 0/5] *** SUBJECT HERE ***
  2015-01-03  8:36 jitendra kumar khasdev
@ 2015-01-03 16:45 ` Greg KH
  2015-01-03 22:54   ` Paul Bolle
  0 siblings, 1 reply; 42+ messages in thread
From: Greg KH @ 2015-01-03 16:45 UTC (permalink / raw)
  To: jitendra kumar khasdev
  Cc: abbotti, hsweeten, devel, pankaj.saraf, linux-kernel

On Sat, Jan 03, 2015 at 02:06:22PM +0530, jitendra kumar khasdev wrote:
> *** BLURB HERE ***

What blurb?  What subject?


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

* [PATCH 0/5] *** SUBJECT HERE ***
@ 2015-01-03  8:36 jitendra kumar khasdev
  2015-01-03 16:45 ` Greg KH
  0 siblings, 1 reply; 42+ messages in thread
From: jitendra kumar khasdev @ 2015-01-03  8:36 UTC (permalink / raw)
  To: abbotti, hsweeten, gregkh
  Cc: devel, linux-kernel, pankaj.saraf, jitendra kumar khasdev

*** BLURB HERE ***

jitendra kumar khasdev (5):
  Staging: comedi: fix line over 80 characters warning
  Staging: comedi: fix line over 80 characters warning
  Staging: comedi: fix line over 80 characters warning
  Staging: comedi: fix line over 80 characters warning
  Staging: comedi: fix line over 80 characters warning

 drivers/staging/comedi/drivers/pcl812.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

-- 
1.9.1


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

* Re: [PATCH 0/5] *** SUBJECT HERE ***
  2012-01-26 20:11 Chase Maupin
  2012-01-26 20:12 ` Maupin, Chase
@ 2012-01-31 16:22 ` Maupin, Chase
  1 sibling, 0 replies; 42+ messages in thread
From: Maupin, Chase @ 2012-01-31 16:22 UTC (permalink / raw)
  To: Maupin, Chase, meta-ti

OK, so based on the layer decisions made, please ignore these patches as they will be relocated to meta-arago.  I will submit updated patches to remove matrix and others from meta-ti as well.

Sincerely,
Chase Maupin
Software Applications
ARM MPU
e-mail: chase.maupin@ti.com

For support:
Forums - http://community.ti.com/forums/
Wiki - http://wiki.davincidsp.com/ 


> -----Original Message-----
> From: Maupin, Chase
> Sent: Thursday, January 26, 2012 2:11 PM
> To: meta-ti@yoctoproject.org
> Cc: Maupin, Chase
> Subject: [PATCH 0/5] *** SUBJECT HERE ***
> 
> This patch set replaces the previous patches that were submitted.
> The patches were re-ordered because the dependency between
> applications
> such as arm-benchmarks and the matrix-gui-xxxx packages was
> reworked
> such that we want to patch in the benchmarks first.
> 
> This was done to bring consistency to how matrix applications were
> added.
> 
> Chase Maupin (5):
>   arm-benchmarks: port of am-benchmarks from arago
>   am-sysinfo: port to latest version from arago
>   matrix-gui-browser: port from arago overlay
>   refresh-screen: add package from arago
>   matrix-gui: update to latest version
> 
>  recipes-bsp/ti/am-sysinfo_svn.bb                   |   23 -----
>  recipes-ti/am-sysinfo/am-sysinfo_svn.bb            |   29 ++++++
>  recipes-ti/arm-benchmarks/arm-benchmarks_1.3.bb    |   24 +++++
>  recipes-ti/matrix/matrix-gui-3d-demos_1.0.bb       |   18 ----
>  recipes-ti/matrix/matrix-gui-3d-demos_2.0.bb       |   22 ++++
>  recipes-ti/matrix/matrix-gui-apps-git.inc          |   10 ++
>  recipes-ti/matrix/matrix-gui-apps-images_2.0.bb    |   20 ++++
>  .../matrix/matrix-gui-armbenchmarks-demos_2.0.bb   |   17 +++
>  recipes-ti/matrix/matrix-gui-browser_2.0.bb        |   24 +++++
>  .../matrix/matrix-gui-camera-loopback_2.0.bb       |   18 ++++
>  ...-gui-clocks_1.1.bb => matrix-gui-clocks_2.0.bb} |   18 ++--
>  recipes-ti/matrix/matrix-gui-coming-soon_1.0.bb    |   17 ---
>  recipes-ti/matrix/matrix-gui-crypto-demos_1.2.bb   |   19 ----
>  recipes-ti/matrix/matrix-gui-crypto-demos_2.0.bb   |   17 +++
>  .../matrix/matrix-gui-display-control_1.0.bb       |   21 ----
>  .../matrix/matrix-gui-display-control_2.0.bb       |   18 ++++
>  .../matrix/matrix-gui-multimedia-demos_2.0.bb      |   17 +++
>  recipes-ti/matrix/matrix-gui-oprofile-demos_2.0.bb |   17 +++
>  recipes-ti/matrix/matrix-gui-pm-demos_1.0.bb       |   21 ----
>  recipes-ti/matrix/matrix-gui-pm-demos_2.0.bb       |   17 +++
>  recipes-ti/matrix/matrix-gui-pru-demos_2.0.bb      |   17 +++
>  recipes-ti/matrix/matrix-gui-qt4-demos_1.0.bb      |   20 ----
>  recipes-ti/matrix/matrix-gui-qt4-demos_2.0.bb      |   17 +++
>  recipes-ti/matrix/matrix-gui-settings-demos_2.0.bb |   17 +++
>  recipes-ti/matrix/matrix-gui-submenus_1.0.bb       |  105 --------
> ------------
>  recipes-ti/matrix/matrix-gui-submenus_2.0.bb       |   50
> +++++++++
>  recipes-ti/matrix/matrix-gui-usb-demos_2.0.bb      |   17 +++
>  recipes-ti/matrix/matrix-gui-v4l2-demos_2.0.bb     |   17 +++
>  recipes-ti/matrix/matrix-gui-wifi-demos_1.1.bb     |   19 ----
>  recipes-ti/matrix/matrix-gui-wifi-demos_2.0.bb     |   17 +++
>  recipes-ti/matrix/matrix-gui/init                  |   57
> ++++++++---
>  recipes-ti/matrix/matrix-gui_2.0.bb                |   39 ++++++-
>  recipes-ti/matrix/refresh-screen_2.0.bb            |   25 +++++
>  33 files changed, 508 insertions(+), 296 deletions(-)
>  delete mode 100644 recipes-bsp/ti/am-sysinfo_svn.bb
>  create mode 100644 recipes-ti/am-sysinfo/am-sysinfo_svn.bb
>  create mode 100644 recipes-ti/arm-benchmarks/arm-benchmarks_1.3.bb
>  delete mode 100644 recipes-ti/matrix/matrix-gui-3d-demos_1.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-3d-demos_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-apps-git.inc
>  create mode 100644 recipes-ti/matrix/matrix-gui-apps-images_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-armbenchmarks-
> demos_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-browser_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-camera-
> loopback_2.0.bb
>  rename recipes-ti/matrix/{matrix-gui-clocks_1.1.bb => matrix-gui-
> clocks_2.0.bb} (66%)
>  delete mode 100644 recipes-ti/matrix/matrix-gui-coming-soon_1.0.bb
>  delete mode 100644 recipes-ti/matrix/matrix-gui-crypto-
> demos_1.2.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-crypto-
> demos_2.0.bb
>  delete mode 100644 recipes-ti/matrix/matrix-gui-display-
> control_1.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-display-
> control_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-multimedia-
> demos_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-oprofile-
> demos_2.0.bb
>  delete mode 100644 recipes-ti/matrix/matrix-gui-pm-demos_1.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-pm-demos_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-pru-demos_2.0.bb
>  delete mode 100644 recipes-ti/matrix/matrix-gui-qt4-demos_1.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-qt4-demos_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-settings-
> demos_2.0.bb
>  delete mode 100644 recipes-ti/matrix/matrix-gui-submenus_1.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-submenus_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-usb-demos_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-v4l2-demos_2.0.bb
>  delete mode 100644 recipes-ti/matrix/matrix-gui-wifi-demos_1.1.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-wifi-demos_2.0.bb
>  create mode 100644 recipes-ti/matrix/refresh-screen_2.0.bb



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

* Re: [PATCH 0/5] *** SUBJECT HERE ***
  2012-01-26 20:11 Chase Maupin
@ 2012-01-26 20:12 ` Maupin, Chase
  2012-01-31 16:22 ` Maupin, Chase
  1 sibling, 0 replies; 42+ messages in thread
From: Maupin, Chase @ 2012-01-26 20:12 UTC (permalink / raw)
  To: Maupin, Chase, meta-ti

Sorry, I'm new to cover letters and it looks like I messed this up a little

Sincerely,
Chase Maupin
Software Applications
ARM MPU
e-mail: chase.maupin@ti.com
phone: (214) 567-2950

For support:
Forums - http://community.ti.com/forums/
Wiki - http://wiki.davincidsp.com/ 


> -----Original Message-----
> From: Maupin, Chase
> Sent: Thursday, January 26, 2012 2:11 PM
> To: meta-ti@yoctoproject.org
> Cc: Maupin, Chase
> Subject: [PATCH 0/5] *** SUBJECT HERE ***
> 
> This patch set replaces the previous patches that were submitted.
> The patches were re-ordered because the dependency between
> applications
> such as arm-benchmarks and the matrix-gui-xxxx packages was
> reworked
> such that we want to patch in the benchmarks first.
> 
> This was done to bring consistency to how matrix applications were
> added.
> 
> Chase Maupin (5):
>   arm-benchmarks: port of am-benchmarks from arago
>   am-sysinfo: port to latest version from arago
>   matrix-gui-browser: port from arago overlay
>   refresh-screen: add package from arago
>   matrix-gui: update to latest version
> 
>  recipes-bsp/ti/am-sysinfo_svn.bb                   |   23 -----
>  recipes-ti/am-sysinfo/am-sysinfo_svn.bb            |   29 ++++++
>  recipes-ti/arm-benchmarks/arm-benchmarks_1.3.bb    |   24 +++++
>  recipes-ti/matrix/matrix-gui-3d-demos_1.0.bb       |   18 ----
>  recipes-ti/matrix/matrix-gui-3d-demos_2.0.bb       |   22 ++++
>  recipes-ti/matrix/matrix-gui-apps-git.inc          |   10 ++
>  recipes-ti/matrix/matrix-gui-apps-images_2.0.bb    |   20 ++++
>  .../matrix/matrix-gui-armbenchmarks-demos_2.0.bb   |   17 +++
>  recipes-ti/matrix/matrix-gui-browser_2.0.bb        |   24 +++++
>  .../matrix/matrix-gui-camera-loopback_2.0.bb       |   18 ++++
>  ...-gui-clocks_1.1.bb => matrix-gui-clocks_2.0.bb} |   18 ++--
>  recipes-ti/matrix/matrix-gui-coming-soon_1.0.bb    |   17 ---
>  recipes-ti/matrix/matrix-gui-crypto-demos_1.2.bb   |   19 ----
>  recipes-ti/matrix/matrix-gui-crypto-demos_2.0.bb   |   17 +++
>  .../matrix/matrix-gui-display-control_1.0.bb       |   21 ----
>  .../matrix/matrix-gui-display-control_2.0.bb       |   18 ++++
>  .../matrix/matrix-gui-multimedia-demos_2.0.bb      |   17 +++
>  recipes-ti/matrix/matrix-gui-oprofile-demos_2.0.bb |   17 +++
>  recipes-ti/matrix/matrix-gui-pm-demos_1.0.bb       |   21 ----
>  recipes-ti/matrix/matrix-gui-pm-demos_2.0.bb       |   17 +++
>  recipes-ti/matrix/matrix-gui-pru-demos_2.0.bb      |   17 +++
>  recipes-ti/matrix/matrix-gui-qt4-demos_1.0.bb      |   20 ----
>  recipes-ti/matrix/matrix-gui-qt4-demos_2.0.bb      |   17 +++
>  recipes-ti/matrix/matrix-gui-settings-demos_2.0.bb |   17 +++
>  recipes-ti/matrix/matrix-gui-submenus_1.0.bb       |  105 --------
> ------------
>  recipes-ti/matrix/matrix-gui-submenus_2.0.bb       |   50
> +++++++++
>  recipes-ti/matrix/matrix-gui-usb-demos_2.0.bb      |   17 +++
>  recipes-ti/matrix/matrix-gui-v4l2-demos_2.0.bb     |   17 +++
>  recipes-ti/matrix/matrix-gui-wifi-demos_1.1.bb     |   19 ----
>  recipes-ti/matrix/matrix-gui-wifi-demos_2.0.bb     |   17 +++
>  recipes-ti/matrix/matrix-gui/init                  |   57
> ++++++++---
>  recipes-ti/matrix/matrix-gui_2.0.bb                |   39 ++++++-
>  recipes-ti/matrix/refresh-screen_2.0.bb            |   25 +++++
>  33 files changed, 508 insertions(+), 296 deletions(-)
>  delete mode 100644 recipes-bsp/ti/am-sysinfo_svn.bb
>  create mode 100644 recipes-ti/am-sysinfo/am-sysinfo_svn.bb
>  create mode 100644 recipes-ti/arm-benchmarks/arm-benchmarks_1.3.bb
>  delete mode 100644 recipes-ti/matrix/matrix-gui-3d-demos_1.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-3d-demos_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-apps-git.inc
>  create mode 100644 recipes-ti/matrix/matrix-gui-apps-images_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-armbenchmarks-
> demos_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-browser_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-camera-
> loopback_2.0.bb
>  rename recipes-ti/matrix/{matrix-gui-clocks_1.1.bb => matrix-gui-
> clocks_2.0.bb} (66%)
>  delete mode 100644 recipes-ti/matrix/matrix-gui-coming-soon_1.0.bb
>  delete mode 100644 recipes-ti/matrix/matrix-gui-crypto-
> demos_1.2.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-crypto-
> demos_2.0.bb
>  delete mode 100644 recipes-ti/matrix/matrix-gui-display-
> control_1.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-display-
> control_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-multimedia-
> demos_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-oprofile-
> demos_2.0.bb
>  delete mode 100644 recipes-ti/matrix/matrix-gui-pm-demos_1.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-pm-demos_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-pru-demos_2.0.bb
>  delete mode 100644 recipes-ti/matrix/matrix-gui-qt4-demos_1.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-qt4-demos_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-settings-
> demos_2.0.bb
>  delete mode 100644 recipes-ti/matrix/matrix-gui-submenus_1.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-submenus_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-usb-demos_2.0.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-v4l2-demos_2.0.bb
>  delete mode 100644 recipes-ti/matrix/matrix-gui-wifi-demos_1.1.bb
>  create mode 100644 recipes-ti/matrix/matrix-gui-wifi-demos_2.0.bb
>  create mode 100644 recipes-ti/matrix/refresh-screen_2.0.bb



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

* [PATCH 0/5] *** SUBJECT HERE ***
@ 2012-01-26 20:11 Chase Maupin
  2012-01-26 20:12 ` Maupin, Chase
  2012-01-31 16:22 ` Maupin, Chase
  0 siblings, 2 replies; 42+ messages in thread
From: Chase Maupin @ 2012-01-26 20:11 UTC (permalink / raw)
  To: meta-ti

This patch set replaces the previous patches that were submitted.
The patches were re-ordered because the dependency between applications
such as arm-benchmarks and the matrix-gui-xxxx packages was reworked
such that we want to patch in the benchmarks first.

This was done to bring consistency to how matrix applications were
added.

Chase Maupin (5):
  arm-benchmarks: port of am-benchmarks from arago
  am-sysinfo: port to latest version from arago
  matrix-gui-browser: port from arago overlay
  refresh-screen: add package from arago
  matrix-gui: update to latest version

 recipes-bsp/ti/am-sysinfo_svn.bb                   |   23 -----
 recipes-ti/am-sysinfo/am-sysinfo_svn.bb            |   29 ++++++
 recipes-ti/arm-benchmarks/arm-benchmarks_1.3.bb    |   24 +++++
 recipes-ti/matrix/matrix-gui-3d-demos_1.0.bb       |   18 ----
 recipes-ti/matrix/matrix-gui-3d-demos_2.0.bb       |   22 ++++
 recipes-ti/matrix/matrix-gui-apps-git.inc          |   10 ++
 recipes-ti/matrix/matrix-gui-apps-images_2.0.bb    |   20 ++++
 .../matrix/matrix-gui-armbenchmarks-demos_2.0.bb   |   17 +++
 recipes-ti/matrix/matrix-gui-browser_2.0.bb        |   24 +++++
 .../matrix/matrix-gui-camera-loopback_2.0.bb       |   18 ++++
 ...-gui-clocks_1.1.bb => matrix-gui-clocks_2.0.bb} |   18 ++--
 recipes-ti/matrix/matrix-gui-coming-soon_1.0.bb    |   17 ---
 recipes-ti/matrix/matrix-gui-crypto-demos_1.2.bb   |   19 ----
 recipes-ti/matrix/matrix-gui-crypto-demos_2.0.bb   |   17 +++
 .../matrix/matrix-gui-display-control_1.0.bb       |   21 ----
 .../matrix/matrix-gui-display-control_2.0.bb       |   18 ++++
 .../matrix/matrix-gui-multimedia-demos_2.0.bb      |   17 +++
 recipes-ti/matrix/matrix-gui-oprofile-demos_2.0.bb |   17 +++
 recipes-ti/matrix/matrix-gui-pm-demos_1.0.bb       |   21 ----
 recipes-ti/matrix/matrix-gui-pm-demos_2.0.bb       |   17 +++
 recipes-ti/matrix/matrix-gui-pru-demos_2.0.bb      |   17 +++
 recipes-ti/matrix/matrix-gui-qt4-demos_1.0.bb      |   20 ----
 recipes-ti/matrix/matrix-gui-qt4-demos_2.0.bb      |   17 +++
 recipes-ti/matrix/matrix-gui-settings-demos_2.0.bb |   17 +++
 recipes-ti/matrix/matrix-gui-submenus_1.0.bb       |  105 --------------------
 recipes-ti/matrix/matrix-gui-submenus_2.0.bb       |   50 +++++++++
 recipes-ti/matrix/matrix-gui-usb-demos_2.0.bb      |   17 +++
 recipes-ti/matrix/matrix-gui-v4l2-demos_2.0.bb     |   17 +++
 recipes-ti/matrix/matrix-gui-wifi-demos_1.1.bb     |   19 ----
 recipes-ti/matrix/matrix-gui-wifi-demos_2.0.bb     |   17 +++
 recipes-ti/matrix/matrix-gui/init                  |   57 ++++++++---
 recipes-ti/matrix/matrix-gui_2.0.bb                |   39 ++++++-
 recipes-ti/matrix/refresh-screen_2.0.bb            |   25 +++++
 33 files changed, 508 insertions(+), 296 deletions(-)
 delete mode 100644 recipes-bsp/ti/am-sysinfo_svn.bb
 create mode 100644 recipes-ti/am-sysinfo/am-sysinfo_svn.bb
 create mode 100644 recipes-ti/arm-benchmarks/arm-benchmarks_1.3.bb
 delete mode 100644 recipes-ti/matrix/matrix-gui-3d-demos_1.0.bb
 create mode 100644 recipes-ti/matrix/matrix-gui-3d-demos_2.0.bb
 create mode 100644 recipes-ti/matrix/matrix-gui-apps-git.inc
 create mode 100644 recipes-ti/matrix/matrix-gui-apps-images_2.0.bb
 create mode 100644 recipes-ti/matrix/matrix-gui-armbenchmarks-demos_2.0.bb
 create mode 100644 recipes-ti/matrix/matrix-gui-browser_2.0.bb
 create mode 100644 recipes-ti/matrix/matrix-gui-camera-loopback_2.0.bb
 rename recipes-ti/matrix/{matrix-gui-clocks_1.1.bb => matrix-gui-clocks_2.0.bb} (66%)
 delete mode 100644 recipes-ti/matrix/matrix-gui-coming-soon_1.0.bb
 delete mode 100644 recipes-ti/matrix/matrix-gui-crypto-demos_1.2.bb
 create mode 100644 recipes-ti/matrix/matrix-gui-crypto-demos_2.0.bb
 delete mode 100644 recipes-ti/matrix/matrix-gui-display-control_1.0.bb
 create mode 100644 recipes-ti/matrix/matrix-gui-display-control_2.0.bb
 create mode 100644 recipes-ti/matrix/matrix-gui-multimedia-demos_2.0.bb
 create mode 100644 recipes-ti/matrix/matrix-gui-oprofile-demos_2.0.bb
 delete mode 100644 recipes-ti/matrix/matrix-gui-pm-demos_1.0.bb
 create mode 100644 recipes-ti/matrix/matrix-gui-pm-demos_2.0.bb
 create mode 100644 recipes-ti/matrix/matrix-gui-pru-demos_2.0.bb
 delete mode 100644 recipes-ti/matrix/matrix-gui-qt4-demos_1.0.bb
 create mode 100644 recipes-ti/matrix/matrix-gui-qt4-demos_2.0.bb
 create mode 100644 recipes-ti/matrix/matrix-gui-settings-demos_2.0.bb
 delete mode 100644 recipes-ti/matrix/matrix-gui-submenus_1.0.bb
 create mode 100644 recipes-ti/matrix/matrix-gui-submenus_2.0.bb
 create mode 100644 recipes-ti/matrix/matrix-gui-usb-demos_2.0.bb
 create mode 100644 recipes-ti/matrix/matrix-gui-v4l2-demos_2.0.bb
 delete mode 100644 recipes-ti/matrix/matrix-gui-wifi-demos_1.1.bb
 create mode 100644 recipes-ti/matrix/matrix-gui-wifi-demos_2.0.bb
 create mode 100644 recipes-ti/matrix/refresh-screen_2.0.bb



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

* [PATCH 0/5] *** SUBJECT HERE ***
@ 2010-06-14  9:44 Nicholas A. Bellinger
  0 siblings, 0 replies; 42+ messages in thread
From: Nicholas A. Bellinger @ 2010-06-14  9:44 UTC (permalink / raw)
  To: Gerd Hoffmann, Kevin Wolf, FUJITA Tomonori
  Cc: Hannes Reinecke, Paul Brook, Christoph Hellwig, kvm-devel,
	qemu-devel, Nicholas Bellinger

From: Nicholas Bellinger <nab@linux-iscsi.org>

Greetings Gerd, Hannes and co,

This series adds initial support for a hw/scsi-bsg.c backstore for scsi-bus
compatible HBA emulation in QEMU-KVM on Linux hosts supporting the BSG driver.
This code is available from the scsi-bsg branch in the megasas/scsi friendly QEMU-KVM tree at:

http://git.kernel.org/?p=virt/kvm/nab/qemu-kvm.git;a=shortlog;h=refs/heads/scsi-bsg

Note that this initial code is being posted for review and to see how useful a BSG backstore
would be for QEMU-KVM and Linux hosts.  Note that in order for BSG I/O to function using vectored
AIO a kernel patch to linux/block/bsg.c:bsg_map_hdr() is currently required running on a bit paired
user/kernel enviroment.  The kernel patch in question is here:

http://marc.info/?l=linux-scsi&m=127649585524598&w=2

The first three patches involve updating block code to support the BSG backstore for scsi-bsg.

The forth patch adds the minor changes to hw/scsi-bus.c and hw/scsi-disk.c in order to
function with scsi-bsg.

And the fifth patch adds the main hw/scsi-bsg.c logic necessary to run the new struct
SCSIDeviceInfo and for BSG AIO using struct iovec and paio_submit_len() to function.

So far this patch series has been tested with a Linux based x86_64 KVM host and guest
using the hw/megasas.c 8708EM2 HBA Emulation with TCM_Loop virtual SAS Port LUNs.

Comments are welcome,

Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>

Nicholas Bellinger (5):
  [block]: Add top level BSG support
  [block]: Add BSG qemu_open() in block/raw.c:raw_open()
  [block]: Add paio_submit_len() non sector sized AIO
  [scsi]: Add BSG support for scsi-bus and scsi-disk
  [scsi-bsg]: Add initial support for BSG based SCSIDeviceInfo

 Makefile.objs         |    2 +-
 block.c               |   23 ++-
 block.h               |    1 +
 block/raw-posix-aio.h |    3 +
 block/raw-posix.c     |   17 ++-
 block/raw.c           |   20 ++
 block_int.h           |    5 +
 hw/scsi-bsg.c         |  588 +++++++++++++++++++++++++++++++++++++++++++++++++
 hw/scsi-bus.c         |    3 +-
 hw/scsi-disk.c        |    4 +
 posix-aio-compat.c    |   28 +++
 11 files changed, 687 insertions(+), 7 deletions(-)
 create mode 100644 hw/scsi-bsg.c


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

end of thread, other threads:[~2019-03-31  9:37 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-23 12:53 [PATCH 0/5] *** SUBJECT HERE *** Cristian Sicilia
2019-03-23 12:53 ` [PATCH 3/5] staging: iio: adc: Avoid precedence issues in macro Cristian Sicilia
2019-03-23 12:53 ` [PATCH 4/5] staging: iio: adc: Adding temp var to improve readability Cristian Sicilia
2019-03-23 12:54 ` [PATCH 2/5] staging: iio: adc: Converted bool to bitfield format Cristian Sicilia
2019-03-23 12:54 ` [PATCH 5/5] staging: iio: adc: Remove CamelCase notation Cristian Sicilia
2019-03-23 12:58 ` [PATCH 1/5] staging: iio: adc: Tab alignment Cristian Sicilia
2019-03-23 19:21 ` [PATCH v2 0/5] staging: iio: adc: Code refactoring and bool to bitfield change Cristian Sicilia
2019-03-23 19:21   ` [PATCH v2 1/5] staging: iio: adc: Tab alignment Cristian Sicilia
2019-03-24 12:35     ` Jonathan Cameron
2019-03-24 16:34       ` Cristian Sicilia
2019-03-23 19:21   ` [PATCH v2 2/5] staging: iio: adc: Converted bool to bitfield format Cristian Sicilia
2019-03-24 12:34     ` Jonathan Cameron
2019-03-24 16:33       ` Sicilia Cristian
2019-03-23 19:21   ` [PATCH v2 3/5] staging: iio: adc: Avoid precedence issues in macro Cristian Sicilia
2019-03-24 12:37     ` Jonathan Cameron
2019-03-23 19:21   ` [PATCH v2 4/5] staging: iio: adc: Adding temp var to improve readability Cristian Sicilia
2019-03-24 12:41     ` Jonathan Cameron
2019-03-23 19:21   ` [PATCH v2 5/5] staging: iio: adc: Remove CamelCase notation Cristian Sicilia
2019-03-24 14:56     ` Jonathan Cameron
2019-03-24 17:23   ` [PATCH v2 0/5] staging: iio: adc: Code refactoring and bool to bitfield change Cristian Sicilia
2019-03-24 17:27     ` [PATCH v3 " Cristian Sicilia
2019-03-24 17:23     ` [PATCH v3 1/5] staging: iio: adc: ad7280a: Tab alignment Cristian Sicilia
2019-03-31  9:29       ` Jonathan Cameron
2019-03-24 17:23     ` [PATCH v3 2/5] staging: iio: adc: ad7192: Converted bool to bitfield format Cristian Sicilia
2019-03-31  9:32       ` Jonathan Cameron
2019-03-24 17:23     ` [PATCH v3 3/5] staging: iio: adc: ad7280a: Avoid precedence issues in macro Cristian Sicilia
2019-03-31  9:34       ` Jonathan Cameron
2019-03-24 17:23     ` [PATCH v3 4/5] staging: iio: adc: ad7280a: Adding temp var to improve readability Cristian Sicilia
2019-03-31  9:35       ` Jonathan Cameron
2019-03-31  9:35       ` Jonathan Cameron
2019-03-24 17:23     ` [PATCH v3 5/5] staging: iio: adc: ad7280a: Remove CamelCase notation Cristian Sicilia
2019-03-31  9:37       ` Jonathan Cameron
2019-03-23 19:24 ` [PATCH 0/5] *** SUBJECT HERE *** Matt Ranostay
  -- strict thread matches above, loose matches on Subject: below --
2015-01-03  8:36 jitendra kumar khasdev
2015-01-03 16:45 ` Greg KH
2015-01-03 22:54   ` Paul Bolle
2015-01-04  1:41     ` Konrad Zapalowicz
2015-01-05 22:18       ` Paul Bolle
2012-01-26 20:11 Chase Maupin
2012-01-26 20:12 ` Maupin, Chase
2012-01-31 16:22 ` Maupin, Chase
2010-06-14  9:44 Nicholas A. Bellinger

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.