All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Wei Ni <wni-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: rui.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	MLongnecker-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
	swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org,
	mikko.perttunen-/1wQRMveznE@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH V3 05/11] thermal: tegra: add T210-specific SOC_THERM driver
Date: Thu, 21 Jan 2016 15:25:46 +0100	[thread overview]
Message-ID: <20160121142546.GA32301@ulmo> (raw)
In-Reply-To: <1453111426-12356-1-git-send-email-wni-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2733 bytes --]

On Mon, Jan 18, 2016 at 06:03:46PM +0800, Wei Ni wrote:
> Add Tegra210 specific SOC_THERM driver.
> 
> Signed-off-by: Wei Ni <wni-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
>  drivers/thermal/tegra/Makefile            |   1 +
>  drivers/thermal/tegra/soctherm-fuse.c     |  11 ++
>  drivers/thermal/tegra/soctherm.c          |   6 +
>  drivers/thermal/tegra/soctherm.h          |   4 +
>  drivers/thermal/tegra/tegra210-soctherm.c | 181 ++++++++++++++++++++++++++++++
>  5 files changed, 203 insertions(+)
>  create mode 100644 drivers/thermal/tegra/tegra210-soctherm.c

This looks pretty good, just a few minor nits...

> diff --git a/drivers/thermal/tegra/soctherm.h b/drivers/thermal/tegra/soctherm.h
[...]
> index 1ac66cafb392..bd0f03bc9d80 100644
> --- a/drivers/thermal/tegra/soctherm.h
> +++ b/drivers/thermal/tegra/soctherm.h
> @@ -108,5 +108,9 @@ int tegra_soctherm_calculate_tsensor_calibration(
>  extern struct tegra_soctherm_soc tegra124_soctherm;
>  #endif
>  
> +#ifdef CONFIG_ARCH_TEGRA_210_SOC
> +extern struct tegra_soctherm_soc tegra210_soctherm;

I would've expected this to be "const".

> diff --git a/drivers/thermal/tegra/tegra210-soctherm.c b/drivers/thermal/tegra/tegra210-soctherm.c
[...]
> +static const struct tegra_tsensor_group tegra210_tsensor_group_cpu = {
> +	.id				= TEGRA124_SOCTHERM_SENSOR_CPU,
> +	.name				= "cpu",
> +	.sensor_temp_offset		= SENSOR_TEMP1,
> +	.sensor_temp_mask		= SENSOR_TEMP1_CPU_TEMP_MASK,
> +	.pdiv				= 8,
> +	.pdiv_ate			= 8,
> +	.pdiv_mask			= SENSOR_PDIV_CPU_MASK,
> +	.pllx_hotspot_diff		= 10,
> +	.pllx_hotspot_mask		= SENSOR_HOTSPOT_CPU_MASK,
> +};

I prefer single spaces for padding because I find it easier to read that
way. Also using tabs to make this look like a table has the drawback
that you run the risk of having to adjust padding for all fields when a
new field is added whose name is longer than any existing ones. Or you
have to rely on excessive padding (such as in this case) to make that
unlikely. So I don't see any advantage in this, but I don't have very
strong objections either.

> +static const struct tegra_tsensor_group *
> +tegra210_tsensor_groups[] = {

Why wrap these two lines? They seem to fit on one line and within 78
columns.

> +static struct tegra_tsensor tegra210_tsensors[] = {

"static const"?

> +	{
> +		.name = "cpu0",
> +		.base = 0xc0,
> +		.config = &tegra210_tsensor_config,
> +		.calib_fuse_offset = 0x098,
> +		.fuse_corr_alpha = 1085000,
> +		.fuse_corr_beta = 3244200,
> +		.group = &tegra210_tsensor_group_cpu,
> +	},
> +	{

"}," and "{" can go on the same line.

> +struct tegra_soctherm_soc tegra210_soctherm = {

"const"?

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Thierry Reding <thierry.reding@gmail.com>
To: Wei Ni <wni@nvidia.com>
Cc: rui.zhang@intel.com, MLongnecker@nvidia.com,
	swarren@wwwdotorg.org, mikko.perttunen@kapsi.fi,
	linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3 05/11] thermal: tegra: add T210-specific SOC_THERM driver
Date: Thu, 21 Jan 2016 15:25:46 +0100	[thread overview]
Message-ID: <20160121142546.GA32301@ulmo> (raw)
In-Reply-To: <1453111426-12356-1-git-send-email-wni@nvidia.com>

[-- Attachment #1: Type: text/plain, Size: 2704 bytes --]

On Mon, Jan 18, 2016 at 06:03:46PM +0800, Wei Ni wrote:
> Add Tegra210 specific SOC_THERM driver.
> 
> Signed-off-by: Wei Ni <wni@nvidia.com>
> ---
>  drivers/thermal/tegra/Makefile            |   1 +
>  drivers/thermal/tegra/soctherm-fuse.c     |  11 ++
>  drivers/thermal/tegra/soctherm.c          |   6 +
>  drivers/thermal/tegra/soctherm.h          |   4 +
>  drivers/thermal/tegra/tegra210-soctherm.c | 181 ++++++++++++++++++++++++++++++
>  5 files changed, 203 insertions(+)
>  create mode 100644 drivers/thermal/tegra/tegra210-soctherm.c

This looks pretty good, just a few minor nits...

> diff --git a/drivers/thermal/tegra/soctherm.h b/drivers/thermal/tegra/soctherm.h
[...]
> index 1ac66cafb392..bd0f03bc9d80 100644
> --- a/drivers/thermal/tegra/soctherm.h
> +++ b/drivers/thermal/tegra/soctherm.h
> @@ -108,5 +108,9 @@ int tegra_soctherm_calculate_tsensor_calibration(
>  extern struct tegra_soctherm_soc tegra124_soctherm;
>  #endif
>  
> +#ifdef CONFIG_ARCH_TEGRA_210_SOC
> +extern struct tegra_soctherm_soc tegra210_soctherm;

I would've expected this to be "const".

> diff --git a/drivers/thermal/tegra/tegra210-soctherm.c b/drivers/thermal/tegra/tegra210-soctherm.c
[...]
> +static const struct tegra_tsensor_group tegra210_tsensor_group_cpu = {
> +	.id				= TEGRA124_SOCTHERM_SENSOR_CPU,
> +	.name				= "cpu",
> +	.sensor_temp_offset		= SENSOR_TEMP1,
> +	.sensor_temp_mask		= SENSOR_TEMP1_CPU_TEMP_MASK,
> +	.pdiv				= 8,
> +	.pdiv_ate			= 8,
> +	.pdiv_mask			= SENSOR_PDIV_CPU_MASK,
> +	.pllx_hotspot_diff		= 10,
> +	.pllx_hotspot_mask		= SENSOR_HOTSPOT_CPU_MASK,
> +};

I prefer single spaces for padding because I find it easier to read that
way. Also using tabs to make this look like a table has the drawback
that you run the risk of having to adjust padding for all fields when a
new field is added whose name is longer than any existing ones. Or you
have to rely on excessive padding (such as in this case) to make that
unlikely. So I don't see any advantage in this, but I don't have very
strong objections either.

> +static const struct tegra_tsensor_group *
> +tegra210_tsensor_groups[] = {

Why wrap these two lines? They seem to fit on one line and within 78
columns.

> +static struct tegra_tsensor tegra210_tsensors[] = {

"static const"?

> +	{
> +		.name = "cpu0",
> +		.base = 0xc0,
> +		.config = &tegra210_tsensor_config,
> +		.calib_fuse_offset = 0x098,
> +		.fuse_corr_alpha = 1085000,
> +		.fuse_corr_beta = 3244200,
> +		.group = &tegra210_tsensor_group_cpu,
> +	},
> +	{

"}," and "{" can go on the same line.

> +struct tegra_soctherm_soc tegra210_soctherm = {

"const"?

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2016-01-21 14:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-18 10:03 [PATCH V3 05/11] thermal: tegra: add T210-specific SOC_THERM driver Wei Ni
2016-01-18 10:03 ` Wei Ni
     [not found] ` <1453111426-12356-1-git-send-email-wni-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-01-21 14:25   ` Thierry Reding [this message]
2016-01-21 14:25     ` Thierry Reding
2016-01-25  5:48     ` Wei Ni
2016-01-25  5:48       ` Wei Ni

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=20160121142546.GA32301@ulmo \
    --to=thierry.reding-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=MLongnecker-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mikko.perttunen-/1wQRMveznE@public.gmane.org \
    --cc=rui.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
    --cc=wni-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    /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.