* [PATCH 1/3] staging: iio: core: fix argument of iio_buffer_register (must be const)
@ 2012-01-09 16:02 Manuel Stahl
2012-01-09 16:02 ` [PATCH 2/3] staging: iio: core: add missing spaces to error output Manuel Stahl
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Manuel Stahl @ 2012-01-09 16:02 UTC (permalink / raw)
To: linux-iio, jic23; +Cc: Jonathan Cameron, Manuel Stahl
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
---
drivers/staging/iio/buffer.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/iio/buffer.h b/drivers/staging/iio/buffer.h
index 44593b2..1a35006 100644
--- a/drivers/staging/iio/buffer.h
+++ b/drivers/staging/iio/buffer.h
@@ -197,8 +197,8 @@ int iio_sw_buffer_preenable(struct iio_dev *indio_dev);
#else /* CONFIG_IIO_BUFFER */
static inline int iio_buffer_register(struct iio_dev *indio_dev,
- struct iio_chan_spec *channels,
- int num_channels)
+ const struct iio_chan_spec *channels,
+ int num_channels)
{
return 0;
}
--
1.7.3.rc1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 2/3] staging: iio: core: add missing spaces to error output
2012-01-09 16:02 [PATCH 1/3] staging: iio: core: fix argument of iio_buffer_register (must be const) Manuel Stahl
@ 2012-01-09 16:02 ` Manuel Stahl
2012-01-12 19:32 ` Jonathan Cameron
2012-01-09 16:02 ` [PATCH 3/3] staging: iio: core: add error message when buffer length is zero Manuel Stahl
2012-01-12 19:31 ` [PATCH 1/3] staging: iio: core: fix argument of iio_buffer_register (must be const) Jonathan Cameron
2 siblings, 1 reply; 7+ messages in thread
From: Manuel Stahl @ 2012-01-09 16:02 UTC (permalink / raw)
To: linux-iio, jic23; +Cc: Jonathan Cameron, Manuel Stahl
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
---
drivers/staging/iio/industrialio-buffer.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/iio/industrialio-buffer.c b/drivers/staging/iio/industrialio-buffer.c
index a03a574..f5c4999 100644
--- a/drivers/staging/iio/industrialio-buffer.c
+++ b/drivers/staging/iio/industrialio-buffer.c
@@ -430,7 +430,7 @@ ssize_t iio_buffer_store_enable(struct device *dev,
ret = indio_dev->setup_ops->preenable(indio_dev);
if (ret) {
printk(KERN_ERR
- "Buffer not started:"
+ "Buffer not started: "
"buffer preenable failed\n");
goto error_ret;
}
@@ -439,7 +439,7 @@ ssize_t iio_buffer_store_enable(struct device *dev,
ret = buffer->access->request_update(buffer);
if (ret) {
printk(KERN_INFO
- "Buffer not started:"
+ "Buffer not started: "
"buffer parameter update failed\n");
goto error_ret;
}
@@ -468,7 +468,7 @@ ssize_t iio_buffer_store_enable(struct device *dev,
ret = indio_dev->setup_ops->postenable(indio_dev);
if (ret) {
printk(KERN_INFO
- "Buffer not started:"
+ "Buffer not started: "
"postenable failed\n");
if (buffer->access->unmark_in_use)
buffer->access->unmark_in_use(buffer);
--
1.7.3.rc1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 2/3] staging: iio: core: add missing spaces to error output
2012-01-09 16:02 ` [PATCH 2/3] staging: iio: core: add missing spaces to error output Manuel Stahl
@ 2012-01-12 19:32 ` Jonathan Cameron
0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2012-01-12 19:32 UTC (permalink / raw)
To: Manuel Stahl; +Cc: linux-iio, jic23
Fine. But while we are here, isn't conventionto have error strings on
one line even if they break the 80 character limit so that they can
be grepped for? I guess we have two logical parts here, so not too
bad...
> Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
> ---
> drivers/staging/iio/industrialio-buffer.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/iio/industrialio-buffer.c b/drivers/staging/iio/industrialio-buffer.c
> index a03a574..f5c4999 100644
> --- a/drivers/staging/iio/industrialio-buffer.c
> +++ b/drivers/staging/iio/industrialio-buffer.c
> @@ -430,7 +430,7 @@ ssize_t iio_buffer_store_enable(struct device *dev,
> ret = indio_dev->setup_ops->preenable(indio_dev);
> if (ret) {
> printk(KERN_ERR
> - "Buffer not started:"
> + "Buffer not started: "
> "buffer preenable failed\n");
> goto error_ret;
> }
> @@ -439,7 +439,7 @@ ssize_t iio_buffer_store_enable(struct device *dev,
> ret = buffer->access->request_update(buffer);
> if (ret) {
> printk(KERN_INFO
> - "Buffer not started:"
> + "Buffer not started: "
> "buffer parameter update failed\n");
> goto error_ret;
> }
> @@ -468,7 +468,7 @@ ssize_t iio_buffer_store_enable(struct device *dev,
> ret = indio_dev->setup_ops->postenable(indio_dev);
> if (ret) {
> printk(KERN_INFO
> - "Buffer not started:"
> + "Buffer not started: "
> "postenable failed\n");
> if (buffer->access->unmark_in_use)
> buffer->access->unmark_in_use(buffer);
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] staging: iio: core: add error message when buffer length is zero
2012-01-09 16:02 [PATCH 1/3] staging: iio: core: fix argument of iio_buffer_register (must be const) Manuel Stahl
2012-01-09 16:02 ` [PATCH 2/3] staging: iio: core: add missing spaces to error output Manuel Stahl
@ 2012-01-09 16:02 ` Manuel Stahl
2012-01-12 19:35 ` Jonathan Cameron
2012-01-12 19:31 ` [PATCH 1/3] staging: iio: core: fix argument of iio_buffer_register (must be const) Jonathan Cameron
2 siblings, 1 reply; 7+ messages in thread
From: Manuel Stahl @ 2012-01-09 16:02 UTC (permalink / raw)
To: linux-iio, jic23; +Cc: Jonathan Cameron, Manuel Stahl
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
---
drivers/staging/iio/industrialio-buffer.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/iio/industrialio-buffer.c b/drivers/staging/iio/industrialio-buffer.c
index f5c4999..c789d39 100644
--- a/drivers/staging/iio/industrialio-buffer.c
+++ b/drivers/staging/iio/industrialio-buffer.c
@@ -426,6 +426,17 @@ ssize_t iio_buffer_store_enable(struct device *dev,
goto done;
}
if (requested_state) {
+ if (buffer->access->get_length) {
+ ret = buffer->access->get_length(buffer);
+ if (ret <= 0) {
+ printk(KERN_INFO
+ "Buffer not started: "
+ "buffer length must be greater than zero\n");
+ ret = -EINVAL;
+ goto error_ret;
+ }
+ }
+
if (indio_dev->setup_ops->preenable) {
ret = indio_dev->setup_ops->preenable(indio_dev);
if (ret) {
--
1.7.3.rc1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 3/3] staging: iio: core: add error message when buffer length is zero
2012-01-09 16:02 ` [PATCH 3/3] staging: iio: core: add error message when buffer length is zero Manuel Stahl
@ 2012-01-12 19:35 ` Jonathan Cameron
0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2012-01-12 19:35 UTC (permalink / raw)
To: Manuel Stahl; +Cc: linux-iio, jic23
I'd like a little more or a commit message for this.
Why is such a message useful? (I agree it probably is, having
at least once stumbled into a 0 length buffer myself).
Anyhow, a good idea.
> Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Thanks for these 3 patches Manuel, and glad to see you are active in IIO
again!
> ---
> drivers/staging/iio/industrialio-buffer.c | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/staging/iio/industrialio-buffer.c b/drivers/staging/iio/industrialio-buffer.c
> index f5c4999..c789d39 100644
> --- a/drivers/staging/iio/industrialio-buffer.c
> +++ b/drivers/staging/iio/industrialio-buffer.c
> @@ -426,6 +426,17 @@ ssize_t iio_buffer_store_enable(struct device *dev,
> goto done;
> }
> if (requested_state) {
> + if (buffer->access->get_length) {
> + ret = buffer->access->get_length(buffer);
> + if (ret <= 0) {
> + printk(KERN_INFO
> + "Buffer not started: "
> + "buffer length must be greater than zero\n");
> + ret = -EINVAL;
> + goto error_ret;
> + }
> + }
> +
> if (indio_dev->setup_ops->preenable) {
> ret = indio_dev->setup_ops->preenable(indio_dev);
> if (ret) {
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] staging: iio: core: fix argument of iio_buffer_register (must be const)
2012-01-09 16:02 [PATCH 1/3] staging: iio: core: fix argument of iio_buffer_register (must be const) Manuel Stahl
2012-01-09 16:02 ` [PATCH 2/3] staging: iio: core: add missing spaces to error output Manuel Stahl
2012-01-09 16:02 ` [PATCH 3/3] staging: iio: core: add error message when buffer length is zero Manuel Stahl
@ 2012-01-12 19:31 ` Jonathan Cameron
2012-01-12 19:32 ` Jonathan Cameron
2 siblings, 1 reply; 7+ messages in thread
From: Jonathan Cameron @ 2012-01-12 19:31 UTC (permalink / raw)
To: Manuel Stahl; +Cc: linux-iio, jic23
Oops. One trivial point here. Perhaps the commit message could make it
clear that this is for the stub? Had me briefly confused. Either way
fine with me.
On 01/09/2012 04:02 PM, Manuel Stahl wrote:
> Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
> ---
> drivers/staging/iio/buffer.h | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/iio/buffer.h b/drivers/staging/iio/buffer.h
> index 44593b2..1a35006 100644
> --- a/drivers/staging/iio/buffer.h
> +++ b/drivers/staging/iio/buffer.h
> @@ -197,8 +197,8 @@ int iio_sw_buffer_preenable(struct iio_dev *indio_dev);
> #else /* CONFIG_IIO_BUFFER */
>
> static inline int iio_buffer_register(struct iio_dev *indio_dev,
> - struct iio_chan_spec *channels,
> - int num_channels)
> + const struct iio_chan_spec *channels,
> + int num_channels)
> {
> return 0;
> }
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 1/3] staging: iio: core: fix argument of iio_buffer_register (must be const)
2012-01-12 19:31 ` [PATCH 1/3] staging: iio: core: fix argument of iio_buffer_register (must be const) Jonathan Cameron
@ 2012-01-12 19:32 ` Jonathan Cameron
0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2012-01-12 19:32 UTC (permalink / raw)
To: Manuel Stahl; +Cc: linux-iio, jic23
On 01/12/2012 07:31 PM, Jonathan Cameron wrote:
> Oops. One trivial point here. Perhaps the commit message could make it
> clear that this is for the stub? Had me briefly confused. Either way
> fine with me.
>
> On 01/09/2012 04:02 PM, Manuel Stahl wrote:
>> Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
> Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Sorry, finger memory.
Acked-by: Jonathan Cameron <jic23@kernel.org>
>> ---
>> drivers/staging/iio/buffer.h | 4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/staging/iio/buffer.h b/drivers/staging/iio/buffer.h
>> index 44593b2..1a35006 100644
>> --- a/drivers/staging/iio/buffer.h
>> +++ b/drivers/staging/iio/buffer.h
>> @@ -197,8 +197,8 @@ int iio_sw_buffer_preenable(struct iio_dev *indio_dev);
>> #else /* CONFIG_IIO_BUFFER */
>>
>> static inline int iio_buffer_register(struct iio_dev *indio_dev,
>> - struct iio_chan_spec *channels,
>> - int num_channels)
>> + const struct iio_chan_spec *channels,
>> + int num_channels)
>> {
>> return 0;
>> }
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-01-12 19:35 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-09 16:02 [PATCH 1/3] staging: iio: core: fix argument of iio_buffer_register (must be const) Manuel Stahl
2012-01-09 16:02 ` [PATCH 2/3] staging: iio: core: add missing spaces to error output Manuel Stahl
2012-01-12 19:32 ` Jonathan Cameron
2012-01-09 16:02 ` [PATCH 3/3] staging: iio: core: add error message when buffer length is zero Manuel Stahl
2012-01-12 19:35 ` Jonathan Cameron
2012-01-12 19:31 ` [PATCH 1/3] staging: iio: core: fix argument of iio_buffer_register (must be const) Jonathan Cameron
2012-01-12 19:32 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).