linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Valentin <edubezval@gmail.com>
To: Caesar Wang <wxt@rock-chips.com>
Cc: rui.zhang@intel.com, heiko@sntech.de, smbarber@chromium.org,
	briannorris@chromium.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-rockchip@lists.infradead.org
Subject: Re: [PATCH v3 1/5] thermal: rockchip: improve conversion error messages
Date: Mon, 28 Nov 2016 17:51:55 -0800	[thread overview]
Message-ID: <20161129015155.GA3329@localhost.localdomain> (raw)
In-Reply-To: <1480331524-18741-2-git-send-email-wxt@rock-chips.com>

Hello,

On Mon, Nov 28, 2016 at 07:12:00PM +0800, Caesar Wang wrote:
> From: Brian Norris <briannorris@chromium.org>
> 
> These error messages don't give much information about what went wrong.
> It would be nice, for one, to see what invalid temperature was being
> requested when conversion fails. It's also good to return an error when
> we can't handle a conversion properly.
> 
> While we're at it, fix the grammar too.
> 
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> Signed-off-by: Caesar Wang <wxt@rock-chips.com>
> 
> ---
> 
> Changes in v3: None
> Changes in v2: None
> Changes in v1:
> - The original Brian posted on https://patchwork.kernel.org/patch/9437686
>   Note: it'd probably be even nicer to know which sensor this was, but we've
>   kinda abstracted that one away by this point...
> 
>  drivers/thermal/rockchip_thermal.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
> index b811b0f..26c247c 100644
> --- a/drivers/thermal/rockchip_thermal.c
> +++ b/drivers/thermal/rockchip_thermal.c
> @@ -424,7 +424,8 @@ static u32 rk_tsadcv2_temp_to_code(struct chip_tsadc_table table,
>  	}
>  
>  exit:
> -	pr_err("Invalid the conversion, error=%d\n", error);
> +	pr_err("%s: invalid temperature, temp=%d error=%d\n",
> +	       __func__, temp, error);
>  	return error;
>  }
>  
> @@ -475,7 +476,9 @@ static int rk_tsadcv2_code_to_temp(struct chip_tsadc_table table, u32 code,
>  		}
>  		break;
>  	default:
> -		pr_err("Invalid the conversion table\n");
> +		pr_err("%s: invalid conversion table, mode=%d\n",
> +		       __func__, table.mode);

Given that we are improving messages, would it be more informative to
say that you have an invalid table mode?

> +		return -EINVAL;
>  	}
>  
>  	/*
> -- 
> 2.7.4
> 

  reply	other threads:[~2016-11-29  1:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-28 11:11 [PATCH v3 0/5] thermal: fixes the rockchip thermal Caesar Wang
     [not found] ` <1480331524-18741-1-git-send-email-wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-11-28 11:12   ` [PATCH v3 1/5] thermal: rockchip: improve conversion error messages Caesar Wang
2016-11-29  1:51     ` Eduardo Valentin [this message]
2016-11-29  5:47       ` Brian Norris
2016-11-30  5:04         ` Eduardo Valentin
2016-12-12 10:47           ` Caesar Wang
2016-11-28 11:12   ` [PATCH v3 2/5] thermal: rockchip: don't pass table structs by value Caesar Wang
2016-11-28 11:12   ` [PATCH v3 4/5] thermal: rockchip: optimize the conversion table Caesar Wang
2016-11-29  1:48     ` Eduardo Valentin
2016-11-30  6:29     ` Eduardo Valentin
2016-12-12 10:48       ` Caesar Wang
2016-11-28 11:12   ` [PATCH v3 5/5] thermal: rockchip: handle set_trips without the trip points Caesar Wang
2016-11-28 11:12 ` [PATCH v3 3/5] thermal: rockchip: fixes invalid temperature case Caesar Wang
2016-11-28 18:47   ` Brian Norris
2016-11-29  1:45   ` Eduardo Valentin
     [not found]     ` <20161129014553.GA3097-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2016-11-29 21:57       ` Brian Norris
2016-11-30  5:02         ` Eduardo Valentin
2016-11-30  5:59           ` Brian Norris
2016-11-30  6:26             ` Eduardo Valentin
2016-12-12 10:46               ` Caesar Wang

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=20161129015155.GA3329@localhost.localdomain \
    --to=edubezval@gmail.com \
    --cc=briannorris@chromium.org \
    --cc=heiko@sntech.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=rui.zhang@intel.com \
    --cc=smbarber@chromium.org \
    --cc=wxt@rock-chips.com \
    /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 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).