All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: Fix iio_validate_scan_mask_oneshot function name typo
@ 2015-07-18 14:31 Cristina Opriceana
  2015-07-19  9:49 ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Cristina Opriceana @ 2015-07-18 14:31 UTC (permalink / raw)
  To: jic23; +Cc: knaack.h, lars, pmeerw, linux-iio, linux-kernel, daniel.baluta

Rename function to iio_validate_scan_mask_oneshot() since it's used to
validate that only one channel is selected.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
---
 drivers/iio/adc/ad_sigma_delta.c         | 2 +-
 drivers/iio/industrialio-buffer.c        | 8 ++++----
 drivers/staging/iio/meter/ade7758_ring.c | 2 +-
 include/linux/iio/buffer.h               | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c
index d10bd0c..2fa4e42 100644
--- a/drivers/iio/adc/ad_sigma_delta.c
+++ b/drivers/iio/adc/ad_sigma_delta.c
@@ -400,7 +400,7 @@ static const struct iio_buffer_setup_ops ad_sd_buffer_setup_ops = {
 	.postenable = &ad_sd_buffer_postenable,
 	.predisable = &iio_triggered_buffer_predisable,
 	.postdisable = &ad_sd_buffer_postdisable,
-	.validate_scan_mask = &iio_validate_scan_mask_onehot,
+	.validate_scan_mask = &iio_validate_scan_mask_oneshot,
 };
 
 static irqreturn_t ad_sd_data_rdy_trig_poll(int irq, void *private)
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index f72be48..b13f941 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -1106,7 +1106,7 @@ void iio_buffer_free_sysfs_and_mask(struct iio_dev *indio_dev)
 }
 
 /**
- * iio_validate_scan_mask_onehot() - Validates that exactly one channel is selected
+ * iio_validate_scan_mask_oneshot() - Validates that exactly one channel is selected
  * @indio_dev: the iio device
  * @mask: scan mask to be checked
  *
@@ -1114,12 +1114,12 @@ void iio_buffer_free_sysfs_and_mask(struct iio_dev *indio_dev)
  * can be used for devices where only one channel can be active for sampling at
  * a time.
  */
-bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev,
-	const unsigned long *mask)
+bool iio_validate_scan_mask_oneshot(struct iio_dev *indio_dev,
+				    const unsigned long *mask)
 {
 	return bitmap_weight(mask, indio_dev->masklength) == 1;
 }
-EXPORT_SYMBOL_GPL(iio_validate_scan_mask_onehot);
+EXPORT_SYMBOL_GPL(iio_validate_scan_mask_oneshot);
 
 int iio_scan_mask_query(struct iio_dev *indio_dev,
 			struct iio_buffer *buffer, int bit)
diff --git a/drivers/staging/iio/meter/ade7758_ring.c b/drivers/staging/iio/meter/ade7758_ring.c
index 9a24e02..d2fa9ef 100644
--- a/drivers/staging/iio/meter/ade7758_ring.c
+++ b/drivers/staging/iio/meter/ade7758_ring.c
@@ -103,7 +103,7 @@ static const struct iio_buffer_setup_ops ade7758_ring_setup_ops = {
 	.preenable = &ade7758_ring_preenable,
 	.postenable = &iio_triggered_buffer_postenable,
 	.predisable = &iio_triggered_buffer_predisable,
-	.validate_scan_mask = &iio_validate_scan_mask_onehot,
+	.validate_scan_mask = &iio_validate_scan_mask_oneshot,
 };
 
 void ade7758_unconfigure_ring(struct iio_dev *indio_dev)
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h
index 1600c55..78d27b7 100644
--- a/include/linux/iio/buffer.h
+++ b/include/linux/iio/buffer.h
@@ -152,8 +152,8 @@ static inline int iio_push_to_buffers_with_timestamp(struct iio_dev *indio_dev,
 
 int iio_update_demux(struct iio_dev *indio_dev);
 
-bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev,
-	const unsigned long *mask);
+bool iio_validate_scan_mask_oneshot(struct iio_dev *indio_dev,
+				    const unsigned long *mask);
 
 struct iio_buffer *iio_buffer_get(struct iio_buffer *buffer);
 void iio_buffer_put(struct iio_buffer *buffer);
-- 
1.9.1


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

* Re: [PATCH] iio: Fix iio_validate_scan_mask_oneshot function name typo
  2015-07-18 14:31 [PATCH] iio: Fix iio_validate_scan_mask_oneshot function name typo Cristina Opriceana
@ 2015-07-19  9:49 ` Jonathan Cameron
  2015-07-19  9:54   ` Lars-Peter Clausen
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2015-07-19  9:49 UTC (permalink / raw)
  To: Cristina Opriceana
  Cc: knaack.h, lars, pmeerw, linux-iio, linux-kernel, daniel.baluta

On 18/07/15 15:31, Cristina Opriceana wrote:
> Rename function to iio_validate_scan_mask_oneshot() since it's used to
> validate that only one channel is selected.
> 
> Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
I'm sure Lars (who I think named it?) will come back with a fuller response, but
I believe the naming (if not necessarily clear!) was deliberate.

one hot - as in only one channel is enabled at a time.
oneshot - only a single reading of all channels is taken
(like a one shot interrupt).

Jonathan
> ---
>  drivers/iio/adc/ad_sigma_delta.c         | 2 +-
>  drivers/iio/industrialio-buffer.c        | 8 ++++----
>  drivers/staging/iio/meter/ade7758_ring.c | 2 +-
>  include/linux/iio/buffer.h               | 4 ++--
>  4 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c
> index d10bd0c..2fa4e42 100644
> --- a/drivers/iio/adc/ad_sigma_delta.c
> +++ b/drivers/iio/adc/ad_sigma_delta.c
> @@ -400,7 +400,7 @@ static const struct iio_buffer_setup_ops ad_sd_buffer_setup_ops = {
>  	.postenable = &ad_sd_buffer_postenable,
>  	.predisable = &iio_triggered_buffer_predisable,
>  	.postdisable = &ad_sd_buffer_postdisable,
> -	.validate_scan_mask = &iio_validate_scan_mask_onehot,
> +	.validate_scan_mask = &iio_validate_scan_mask_oneshot,
>  };
>  
>  static irqreturn_t ad_sd_data_rdy_trig_poll(int irq, void *private)
> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
> index f72be48..b13f941 100644
> --- a/drivers/iio/industrialio-buffer.c
> +++ b/drivers/iio/industrialio-buffer.c
> @@ -1106,7 +1106,7 @@ void iio_buffer_free_sysfs_and_mask(struct iio_dev *indio_dev)
>  }
>  
>  /**
> - * iio_validate_scan_mask_onehot() - Validates that exactly one channel is selected
> + * iio_validate_scan_mask_oneshot() - Validates that exactly one channel is selected
>   * @indio_dev: the iio device
>   * @mask: scan mask to be checked
>   *
> @@ -1114,12 +1114,12 @@ void iio_buffer_free_sysfs_and_mask(struct iio_dev *indio_dev)
>   * can be used for devices where only one channel can be active for sampling at
>   * a time.
>   */
> -bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev,
> -	const unsigned long *mask)
> +bool iio_validate_scan_mask_oneshot(struct iio_dev *indio_dev,
> +				    const unsigned long *mask)
>  {
>  	return bitmap_weight(mask, indio_dev->masklength) == 1;
>  }
> -EXPORT_SYMBOL_GPL(iio_validate_scan_mask_onehot);
> +EXPORT_SYMBOL_GPL(iio_validate_scan_mask_oneshot);
>  
>  int iio_scan_mask_query(struct iio_dev *indio_dev,
>  			struct iio_buffer *buffer, int bit)
> diff --git a/drivers/staging/iio/meter/ade7758_ring.c b/drivers/staging/iio/meter/ade7758_ring.c
> index 9a24e02..d2fa9ef 100644
> --- a/drivers/staging/iio/meter/ade7758_ring.c
> +++ b/drivers/staging/iio/meter/ade7758_ring.c
> @@ -103,7 +103,7 @@ static const struct iio_buffer_setup_ops ade7758_ring_setup_ops = {
>  	.preenable = &ade7758_ring_preenable,
>  	.postenable = &iio_triggered_buffer_postenable,
>  	.predisable = &iio_triggered_buffer_predisable,
> -	.validate_scan_mask = &iio_validate_scan_mask_onehot,
> +	.validate_scan_mask = &iio_validate_scan_mask_oneshot,
>  };
>  
>  void ade7758_unconfigure_ring(struct iio_dev *indio_dev)
> diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h
> index 1600c55..78d27b7 100644
> --- a/include/linux/iio/buffer.h
> +++ b/include/linux/iio/buffer.h
> @@ -152,8 +152,8 @@ static inline int iio_push_to_buffers_with_timestamp(struct iio_dev *indio_dev,
>  
>  int iio_update_demux(struct iio_dev *indio_dev);
>  
> -bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev,
> -	const unsigned long *mask);
> +bool iio_validate_scan_mask_oneshot(struct iio_dev *indio_dev,
> +				    const unsigned long *mask);
>  
>  struct iio_buffer *iio_buffer_get(struct iio_buffer *buffer);
>  void iio_buffer_put(struct iio_buffer *buffer);
> 


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

* Re: [PATCH] iio: Fix iio_validate_scan_mask_oneshot function name typo
  2015-07-19  9:49 ` Jonathan Cameron
@ 2015-07-19  9:54   ` Lars-Peter Clausen
  2015-07-21  9:15     ` Cristina Georgiana Opriceana
  0 siblings, 1 reply; 4+ messages in thread
From: Lars-Peter Clausen @ 2015-07-19  9:54 UTC (permalink / raw)
  To: Jonathan Cameron, Cristina Opriceana
  Cc: knaack.h, pmeerw, linux-iio, linux-kernel, daniel.baluta

On 07/19/2015 11:49 AM, Jonathan Cameron wrote:
> On 18/07/15 15:31, Cristina Opriceana wrote:
>> Rename function to iio_validate_scan_mask_oneshot() since it's used to
>> validate that only one channel is selected.
>>
>> Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
> I'm sure Lars (who I think named it?) will come back with a fuller response, but
> I believe the naming (if not necessarily clear!) was deliberate.
>
> one hot - as in only one channel is enabled at a time.
> oneshot - only a single reading of all channels is taken
> (like a one shot interrupt).

Yes. See https://en.wikipedia.org/wiki/One-hot

Thanks.

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

* Re: [PATCH] iio: Fix iio_validate_scan_mask_oneshot function name typo
  2015-07-19  9:54   ` Lars-Peter Clausen
@ 2015-07-21  9:15     ` Cristina Georgiana Opriceana
  0 siblings, 0 replies; 4+ messages in thread
From: Cristina Georgiana Opriceana @ 2015-07-21  9:15 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Jonathan Cameron, Hartmut Knaack, Peter Meerwald, linux-iio,
	linux-kernel, Daniel Baluta

On Sun, Jul 19, 2015 at 12:54 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> On 07/19/2015 11:49 AM, Jonathan Cameron wrote:
>>
>> On 18/07/15 15:31, Cristina Opriceana wrote:
>>>
>>> Rename function to iio_validate_scan_mask_oneshot() since it's used to
>>> validate that only one channel is selected.
>>>
>>> Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
>>
>> I'm sure Lars (who I think named it?) will come back with a fuller
>> response, but
>> I believe the naming (if not necessarily clear!) was deliberate.
>>
>> one hot - as in only one channel is enabled at a time.
>> oneshot - only a single reading of all channels is taken
>> (like a one shot interrupt).
>
>
> Yes. See https://en.wikipedia.org/wiki/One-hot
>
> Thanks.

Ah, I see. Thanks for the info!

Cristina

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

end of thread, other threads:[~2015-07-21  9:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-18 14:31 [PATCH] iio: Fix iio_validate_scan_mask_oneshot function name typo Cristina Opriceana
2015-07-19  9:49 ` Jonathan Cameron
2015-07-19  9:54   ` Lars-Peter Clausen
2015-07-21  9:15     ` Cristina Georgiana Opriceana

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.