All of lore.kernel.org
 help / color / mirror / Atom feed
From: Colin Leroy <colin@colino.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] pmac: don't add "°C" suffix in sys	for adt746x driver
Date: Tue, 21 Sep 2004 08:33:18 +0200	[thread overview]
Message-ID: <20040921083318.1bdddd72@pirandello> (raw)
In-Reply-To: <1095401127.5105.73.camel@gaston>

On 17 Sep 2004 at 16h09, Benjamin Herrenschmidt wrote:

Hi, 

> The adt746x driver currently adds a "°C" suffix to temperatures
> exposed via sysfs, and I don't like that. First, we all agree that any
> other unit here makes no sense (do we ? do we ? yes of course :) and I
> don't like having anything but numbers in there, and finally it's more
> consistent with what the g5 driver does.
> 
> And finally, the _REAL_ reason is that this is not a low ASCII
> character and so has nothing to do in the kernel sources or in /sys :)

Fine with me!  (Patch may be broken too...)

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Colin Leroy <colin@colino.net>
===== drivers/macintosh/therm_adt746x.c 1.4 vs edited =====
--- 1.4/drivers/macintosh/therm_adt746x.c	2004-05-29 17:26:34 +10:00
+++ edited/drivers/macintosh/therm_adt746x.c	2004-09-17 15:59:59 +10:00
@@ -417,11 +417,6 @@
  * choice but implement a bunch of them...
  *
  */
-#define BUILD_SHOW_FUNC_DEG(name, data)				\
-static ssize_t show_##name(struct device *dev, char *buf)	\
-{								\
-	return sprintf(buf, "%d°C\n", data);			\
-}
 #define BUILD_SHOW_FUNC_INT(name, data)				\
 static ssize_t show_##name(struct device *dev, char *buf)	\
 {								\
@@ -453,10 +448,10 @@
 	return n;						\
 }
 
-BUILD_SHOW_FUNC_DEG(cpu_temperature,	 (read_reg(thermostat, TEMP_REG[1])))
-BUILD_SHOW_FUNC_DEG(gpu_temperature,	 (read_reg(thermostat, TEMP_REG[2])))
-BUILD_SHOW_FUNC_DEG(cpu_limit,		 thermostat->limits[1])
-BUILD_SHOW_FUNC_DEG(gpu_limit,		 thermostat->limits[2])
+BUILD_SHOW_FUNC_INT(cpu_temperature,	 (read_reg(thermostat, TEMP_REG[1])))
+BUILD_SHOW_FUNC_INT(gpu_temperature,	 (read_reg(thermostat, TEMP_REG[2])))
+BUILD_SHOW_FUNC_INT(cpu_limit,		 thermostat->limits[1])
+BUILD_SHOW_FUNC_INT(gpu_limit,		 thermostat->limits[2])
 
 BUILD_SHOW_FUNC_INT(specified_fan_speed, fan_speed)
 BUILD_SHOW_FUNC_INT(cpu_fan_speed,	 (read_fan_speed(thermostat, FAN_SPEED[0])))
-- 
Colin

      parent reply	other threads:[~2004-09-21  6:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-17  6:05 [PATCH] pmac: don't add "°C" suffix in sys for adt746x driver Benjamin Herrenschmidt
2004-09-17 10:50 ` Geert Uytterhoeven
2004-09-17 11:38   ` Benjamin Herrenschmidt
2004-09-18 23:09   ` Max Valdez
2004-09-20  1:42     ` [OT] " Tonnerre
2004-09-20 14:26       ` Max Valdez
2004-09-21  6:33 ` Colin Leroy [this message]

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=20040921083318.1bdddd72@pirandello \
    --to=colin@colino.net \
    --cc=akpm@osdl.org \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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.