All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] iio: trivial trigger cleanups and RFC
@ 2013-11-12 21:49 Peter Meerwald
  2013-11-12 21:49 ` [PATCH 1/2] iio: Minor kerneldoc fix for iio_trigger_write_current() Peter Meerwald
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Peter Meerwald @ 2013-11-12 21:49 UTC (permalink / raw)
  To: linux-iio

two trivial cleanups and a question: the behaviour of 
iio_trigger_write_current() currently is that all strings are 
accepted -- if the string matches a trigger's name, a new trigger
is set for the device (given the trigger passes validation); if the
string doesn't match a trigger's name, then the current trigger
is unset

so arbitrary garbage can be passed and is used to unset a trigger
(I'd have expected -EINVAL for unknown trigger names and a defined 
value such as "" to unset) -- is this what we want?

Peter Meerwald (2):
  iio: Minor kerneldoc fix for iio_trigger_write_current()
  iio: Remove redundant check that new trigger is different from old

 drivers/iio/industrialio-trigger.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
1.8.4.3


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

* [PATCH 1/2] iio: Minor kerneldoc fix for iio_trigger_write_current()
  2013-11-12 21:49 [PATCH 0/2] iio: trivial trigger cleanups and RFC Peter Meerwald
@ 2013-11-12 21:49 ` Peter Meerwald
  2013-11-13 20:32   ` Jonathan Cameron
  2013-11-12 21:49 ` [PATCH 2/2] iio: Remove redundant check that new trigger is different from old Peter Meerwald
  2013-11-13 20:31 ` [PATCH 0/2] iio: trivial trigger cleanups and RFC Jonathan Cameron
  2 siblings, 1 reply; 6+ messages in thread
From: Peter Meerwald @ 2013-11-12 21:49 UTC (permalink / raw)
  To: linux-iio; +Cc: Peter Meerwald

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
---
 drivers/iio/industrialio-trigger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
index bf5e70a..021d735 100644
--- a/drivers/iio/industrialio-trigger.c
+++ b/drivers/iio/industrialio-trigger.c
@@ -318,7 +318,7 @@ static ssize_t iio_trigger_read_current(struct device *dev,
  * iio_trigger_write_current() - trigger consumer sysfs set current trigger
  *
  * For trigger consumers the current_trigger interface allows the trigger
- * used for this device to be specified at run time based on the triggers
+ * used for this device to be specified at run time based on the trigger's
  * name.
  **/
 static ssize_t iio_trigger_write_current(struct device *dev,
-- 
1.8.4.3


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

* [PATCH 2/2] iio: Remove redundant check that new trigger is different from old
  2013-11-12 21:49 [PATCH 0/2] iio: trivial trigger cleanups and RFC Peter Meerwald
  2013-11-12 21:49 ` [PATCH 1/2] iio: Minor kerneldoc fix for iio_trigger_write_current() Peter Meerwald
@ 2013-11-12 21:49 ` Peter Meerwald
  2013-11-13 20:37   ` Jonathan Cameron
  2013-11-13 20:31 ` [PATCH 0/2] iio: trivial trigger cleanups and RFC Jonathan Cameron
  2 siblings, 1 reply; 6+ messages in thread
From: Peter Meerwald @ 2013-11-12 21:49 UTC (permalink / raw)
  To: linux-iio; +Cc: Peter Meerwald

same check is performed a new lines above

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
---
 drivers/iio/industrialio-trigger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
index 021d735..5bf13ed 100644
--- a/drivers/iio/industrialio-trigger.c
+++ b/drivers/iio/industrialio-trigger.c
@@ -356,7 +356,7 @@ static ssize_t iio_trigger_write_current(struct device *dev,
 
 	indio_dev->trig = trig;
 
-	if (oldtrig && indio_dev->trig != oldtrig)
+	if (oldtrig)
 		iio_trigger_put(oldtrig);
 	if (indio_dev->trig)
 		iio_trigger_get(indio_dev->trig);
-- 
1.8.4.3


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

* Re: [PATCH 0/2] iio: trivial trigger cleanups and RFC
  2013-11-12 21:49 [PATCH 0/2] iio: trivial trigger cleanups and RFC Peter Meerwald
  2013-11-12 21:49 ` [PATCH 1/2] iio: Minor kerneldoc fix for iio_trigger_write_current() Peter Meerwald
  2013-11-12 21:49 ` [PATCH 2/2] iio: Remove redundant check that new trigger is different from old Peter Meerwald
@ 2013-11-13 20:31 ` Jonathan Cameron
  2 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2013-11-13 20:31 UTC (permalink / raw)
  To: Peter Meerwald, linux-iio

On 11/12/13 21:49, Peter Meerwald wrote:
> two trivial cleanups and a question: the behaviour of 
> iio_trigger_write_current() currently is that all strings are 
> accepted -- if the string matches a trigger's name, a new trigger
> is set for the device (given the trigger passes validation); if the
> string doesn't match a trigger's name, then the current trigger
> is unset
> 
> so arbitrary garbage can be passed and is used to unset a trigger
> (I'd have expected -EINVAL for unknown trigger names and a defined 
> value such as "" to unset) -- is this what we want?

It's ABI now so even though what you suggest is sensible, we can't really
change it.


> 
> Peter Meerwald (2):
>   iio: Minor kerneldoc fix for iio_trigger_write_current()
>   iio: Remove redundant check that new trigger is different from old
> 
>  drivers/iio/industrialio-trigger.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

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

* Re: [PATCH 1/2] iio: Minor kerneldoc fix for iio_trigger_write_current()
  2013-11-12 21:49 ` [PATCH 1/2] iio: Minor kerneldoc fix for iio_trigger_write_current() Peter Meerwald
@ 2013-11-13 20:32   ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2013-11-13 20:32 UTC (permalink / raw)
  To: Peter Meerwald, linux-iio

On 11/12/13 21:49, Peter Meerwald wrote:
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Applied to the togreg branch of iio.git

thanks,
> ---
>  drivers/iio/industrialio-trigger.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
> index bf5e70a..021d735 100644
> --- a/drivers/iio/industrialio-trigger.c
> +++ b/drivers/iio/industrialio-trigger.c
> @@ -318,7 +318,7 @@ static ssize_t iio_trigger_read_current(struct device *dev,
>   * iio_trigger_write_current() - trigger consumer sysfs set current trigger
>   *
>   * For trigger consumers the current_trigger interface allows the trigger
> - * used for this device to be specified at run time based on the triggers
> + * used for this device to be specified at run time based on the trigger's
>   * name.
>   **/
>  static ssize_t iio_trigger_write_current(struct device *dev,
> 

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

* Re: [PATCH 2/2] iio: Remove redundant check that new trigger is different from old
  2013-11-12 21:49 ` [PATCH 2/2] iio: Remove redundant check that new trigger is different from old Peter Meerwald
@ 2013-11-13 20:37   ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2013-11-13 20:37 UTC (permalink / raw)
  To: Peter Meerwald, linux-iio

On 11/12/13 21:49, Peter Meerwald wrote:
> same check is performed a new lines above
> 
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Good catch, applied to the togreg branch of iio.git

Thanks,
> ---
>  drivers/iio/industrialio-trigger.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
> index 021d735..5bf13ed 100644
> --- a/drivers/iio/industrialio-trigger.c
> +++ b/drivers/iio/industrialio-trigger.c
> @@ -356,7 +356,7 @@ static ssize_t iio_trigger_write_current(struct device *dev,
>  
>  	indio_dev->trig = trig;
>  
> -	if (oldtrig && indio_dev->trig != oldtrig)
> +	if (oldtrig)
>  		iio_trigger_put(oldtrig);
>  	if (indio_dev->trig)
>  		iio_trigger_get(indio_dev->trig);
> 

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

end of thread, other threads:[~2013-11-13 19:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-12 21:49 [PATCH 0/2] iio: trivial trigger cleanups and RFC Peter Meerwald
2013-11-12 21:49 ` [PATCH 1/2] iio: Minor kerneldoc fix for iio_trigger_write_current() Peter Meerwald
2013-11-13 20:32   ` Jonathan Cameron
2013-11-12 21:49 ` [PATCH 2/2] iio: Remove redundant check that new trigger is different from old Peter Meerwald
2013-11-13 20:37   ` Jonathan Cameron
2013-11-13 20:31 ` [PATCH 0/2] iio: trivial trigger cleanups and RFC Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.