public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Javi Merino <javi.merino@arm.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Zhang Rui <rui.zhang@intel.com>, Len Brown <lenb@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Corentin Chary <corentin.chary@gmail.com>,
	Matthew Garrett <matthew.garrett@nebula.com>,
	Sujith Thomas <sujith.thomas@intel.com>,
	Eduardo Valentin <eduardo.valentin@ti.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"acpi4asus-user@lists.sourceforge.net"
	<acpi4asus-user@lists.sourceforge.net>,
	"platform-driver-x86@vger.kernel.org"
	<platform-driver-x86@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Joe Perches <joe@perches.com>
Subject: Re: [PATCH] linux/thermal.h: Rename KELVIN_TO_CELSIUS to DECI_KELVIN_TO_CELSIUS
Date: Mon, 24 Mar 2014 17:45:28 +0000	[thread overview]
Message-ID: <20140324174528.GC22346@e102654-lin.cambridge.arm.com> (raw)
In-Reply-To: <1395682149-16563-1-git-send-email-linux@rasmusvillemoes.dk>

On Mon, Mar 24, 2014 at 05:29:09PM +0000, Rasmus Villemoes wrote:
> The macros KELVIN_TO_CELSIUS and CELSIUS_TO_KELVIN actually work on
> decikelvins, so rename them to reflect their actual semantics.
> 
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
>  drivers/acpi/thermal.c              | 12 ++++++------
>  drivers/platform/x86/asus-wmi.c     |  2 +-
>  drivers/platform/x86/intel_menlow.c |  8 ++++----
>  include/linux/thermal.h             |  6 +++---
>  4 files changed, 14 insertions(+), 14 deletions(-)

[snip]

> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index f7e11c7..c978aa3 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -41,9 +41,9 @@
>  #define THERMAL_NO_LIMIT	THERMAL_CSTATE_INVALID
>  
>  /* Unit conversion macros */
> -#define KELVIN_TO_CELSIUS(t)	(long)(((long)t-2732 >= 0) ?	\
> -				((long)t-2732+5)/10 : ((long)t-2732-5)/10)
> -#define CELSIUS_TO_KELVIN(t)	((t)*10+2732)
> +#define DECI_KELVIN_TO_CELSIUS(t)	(long)(((long)t-2732 >= 0) ?	\
> +					((long)t-2732+5)/10 : ((long)t-2732-5)/10)
> +#define CELSIUS_TO_DECI_KELVIN(t)	((t)*10+2732)

While you are at it, you could also make it use a statement expression
as Joe Perches suggested earlier:

http://thread.gmane.org/gmane.linux.power-management.general/43978/focus=1671955

Cheers,
Javi

  reply	other threads:[~2014-03-24 17:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-24 17:29 [PATCH] linux/thermal.h: Rename KELVIN_TO_CELSIUS to DECI_KELVIN_TO_CELSIUS Rasmus Villemoes
2014-03-24 17:45 ` Javi Merino [this message]
2014-04-03  2:42 ` Zhang Rui
  -- strict thread matches above, loose matches on Subject: below --
2015-10-01 21:45 [PATCH] linux/thermal.h: rename " Rasmus Villemoes
2015-10-06 22:30 ` Darren Hart

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=20140324174528.GC22346@e102654-lin.cambridge.arm.com \
    --to=javi.merino@arm.com \
    --cc=acpi4asus-user@lists.sourceforge.net \
    --cc=corentin.chary@gmail.com \
    --cc=eduardo.valentin@ti.com \
    --cc=joe@perches.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=matthew.garrett@nebula.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=rui.zhang@intel.com \
    --cc=sujith.thomas@intel.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