All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Peter Meerwald <pmeerw@pmeerw.net>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH 1/8] iio: Replace printk in __iio_update_buffers with dev_dbg
Date: Sun, 17 May 2015 09:42:15 +0100	[thread overview]
Message-ID: <55585467.5080705@kernel.org> (raw)
In-Reply-To: <1431525891-19285-2-git-send-email-lars@metafoo.de>

On 13/05/15 15:04, Lars-Peter Clausen wrote:
> While more verbose error messages are useful for debugging we should really
> not put those error messages into the kernel log for normal errors that are
> already reported to the application via the error code, when running in
> non-debug mode.
> 
> Otherwise application authors might expect that this is part of the ABI and
> to get the error they should scan the kernel log. Which would be rather
> error prone itself since there is no direct mapping between a operation and
> the error message so it is impossible to find out which error message
> belongs to which error.
Let's just hope no one is using these already!
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Applied to the togreg branch of iio.git, initially pushed out as testing (etc etc).

> ---
>  drivers/iio/industrialio-buffer.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
> index df919f4..1f91031 100644
> --- a/drivers/iio/industrialio-buffer.c
> +++ b/drivers/iio/industrialio-buffer.c
> @@ -663,7 +663,7 @@ static int __iio_update_buffers(struct iio_dev *indio_dev,
>  	if (indio_dev->setup_ops->preenable) {
>  		ret = indio_dev->setup_ops->preenable(indio_dev);
>  		if (ret) {
> -			printk(KERN_ERR
> +			dev_dbg(&indio_dev->dev,
>  			       "Buffer not started: buffer preenable failed (%d)\n", ret);
>  			goto error_remove_inserted;
>  		}
> @@ -677,7 +677,7 @@ static int __iio_update_buffers(struct iio_dev *indio_dev,
>  		if (buffer->access->request_update) {
>  			ret = buffer->access->request_update(buffer);
>  			if (ret) {
> -				printk(KERN_INFO
> +				dev_dbg(&indio_dev->dev,
>  				       "Buffer not started: buffer parameter update failed (%d)\n", ret);
>  				goto error_run_postdisable;
>  			}
> @@ -688,7 +688,9 @@ static int __iio_update_buffers(struct iio_dev *indio_dev,
>  			->update_scan_mode(indio_dev,
>  					   indio_dev->active_scan_mask);
>  		if (ret < 0) {
> -			printk(KERN_INFO "Buffer not started: update scan mode failed (%d)\n", ret);
> +			dev_dbg(&indio_dev->dev,
> +				"Buffer not started: update scan mode failed (%d)\n",
> +				ret);
>  			goto error_run_postdisable;
>  		}
>  	}
> @@ -702,7 +704,7 @@ static int __iio_update_buffers(struct iio_dev *indio_dev,
>  	} else { /* Should never be reached */
>  		/* Can only occur on first buffer */
>  		if (indio_dev->modes & INDIO_BUFFER_TRIGGERED)
> -			pr_info("Buffer not started: no trigger\n");
> +			dev_dbg(&indio_dev->dev, "Buffer not started: no trigger\n");
>  		ret = -EINVAL;
>  		goto error_run_postdisable;
>  	}
> @@ -710,7 +712,7 @@ static int __iio_update_buffers(struct iio_dev *indio_dev,
>  	if (indio_dev->setup_ops->postenable) {
>  		ret = indio_dev->setup_ops->postenable(indio_dev);
>  		if (ret) {
> -			printk(KERN_INFO
> +			dev_dbg(&indio_dev->dev,
>  			       "Buffer not started: postenable failed (%d)\n", ret);
>  			indio_dev->currentmode = INDIO_DIRECT_MODE;
>  			if (indio_dev->setup_ops->postdisable)
> 


  reply	other threads:[~2015-05-17  8:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13 14:04 [PATCH 0/8] iio: Refactor __iio_update_buffers() Lars-Peter Clausen
2015-05-13 14:04 ` [PATCH 1/8] iio: Replace printk in __iio_update_buffers with dev_dbg Lars-Peter Clausen
2015-05-17  8:42   ` Jonathan Cameron [this message]
2015-05-13 14:04 ` [PATCH 2/8] iio: __iio_update_buffers: Slightly refactor scan mask memory management Lars-Peter Clausen
2015-05-17  8:48   ` Jonathan Cameron
2015-05-13 14:04 ` [PATCH 3/8] iio: __iio_update_buffers: Perform request_update() only for new buffers Lars-Peter Clausen
2015-05-17  9:01   ` Jonathan Cameron
2015-05-13 14:04 ` [PATCH 4/8] iio: __iio_update_buffers: Update mode before preenable/after postdisable Lars-Peter Clausen
2015-05-17  9:10   ` Jonathan Cameron
2015-05-17 11:38     ` Lars-Peter Clausen
2015-05-17 11:44       ` Jonathan Cameron
2015-05-13 14:04 ` [PATCH 5/8] iio: __iio_update_buffers: Verify configuration before starting to apply it Lars-Peter Clausen
2015-05-17  9:14   ` Jonathan Cameron
2015-05-13 14:04 ` [PATCH 6/8] iio: __iio_update_buffers: Split enable and disable path into helper functions Lars-Peter Clausen
2015-05-17  9:17   ` Jonathan Cameron
2015-05-13 14:04 ` [PATCH 7/8] iio: __iio_update_buffers: Leave device in sane state on error Lars-Peter Clausen
2015-05-17  9:22   ` Jonathan Cameron
2015-05-13 14:04 ` [PATCH 8/8] DO NOT APPLY! __iio_update_buffers error path testing Lars-Peter Clausen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55585467.5080705@kernel.org \
    --to=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.