* [PATCH] pmac: don't add "°C" suffix in sys for adt746x driver
@ 2004-09-17 6:05 Benjamin Herrenschmidt
2004-09-17 10:50 ` Geert Uytterhoeven
2004-09-21 6:33 ` [PATCH] " Colin Leroy
0 siblings, 2 replies; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2004-09-17 6:05 UTC (permalink / raw)
To: Colin Leroy, Andrew Morton; +Cc: Linus Torvalds, Linux Kernel list
[-- Attachment #1: Type: text/plain, Size: 766 bytes --]
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 :)
Unfortunately, generating a patch here is nasty because of that (my mailer
is rightfully complaining about the non-ASCII char on text import) so you
might have to apply by hand...
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
(attached, evolution will really not let me paste that bit in)
[-- Attachment #2: adt.diff --]
[-- Type: text/x-patch, Size: 1273 bytes --]
===== 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])))
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] pmac: don't add "°C" suffix in sys for adt746x driver
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-21 6:33 ` [PATCH] " Colin Leroy
1 sibling, 2 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2004-09-17 10:50 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Colin Leroy, Andrew Morton, Linus Torvalds, Linux Kernel list
On Fri, 17 Sep 2004, Benjamin Herrenschmidt wrote:
> 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
Universal temperature, in K? And you'll never ever see negative numbers ;-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] pmac: don't add "°C" suffix in sys for adt746x driver
2004-09-17 10:50 ` Geert Uytterhoeven
@ 2004-09-17 11:38 ` Benjamin Herrenschmidt
2004-09-18 23:09 ` Max Valdez
1 sibling, 0 replies; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2004-09-17 11:38 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Colin Leroy, Andrew Morton, Linus Torvalds, Linux Kernel list
On Fri, 2004-09-17 at 20:50, Geert Uytterhoeven wrote:
> On Fri, 17 Sep 2004, Benjamin Herrenschmidt wrote:
> > 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
>
> Universal temperature, in K? And you'll never ever see negative numbers ;-)
I was waiting for this one :)
Ben.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] pmac: don't add "°C" suffix in sys for adt746x driver
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
1 sibling, 1 reply; 7+ messages in thread
From: Max Valdez @ 2004-09-18 23:09 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Linux Kernel list
On Friday 17 September 2004 05:50, Geert Uytterhoeven wrote:
> On Fri, 17 Sep 2004, Benjamin Herrenschmidt wrote:
> > 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
>
> Universal temperature, in K? And you'll never ever see negative numbers ;-)
It's called Absolute Temperature, (Kelvins for thos who dont know) :-)
Sorry for the nerdy comment, can't help it
Max
--
Linux garaged 2.6.9-rc1-mm1 #3 SMP Mon Aug 30 12:14:50 CDT 2004 i686 Intel(R)
Pentium(R) 4 CPU 2.80GHz GenuineIntel GNU/Linux
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GS/S d- s: a-29 C++(+++) ULAHI+++ P+ L++>+++ E--- W++ N* o-- K- w++++ O- M--
V-- PS+ PE Y-- PGP++ t- 5- X+ R tv++ b+ DI+++ D- G++ e++ h+ r+ z**
------END GEEK CODE BLOCK------
gpg-key: http://garaged.homeip.net/gpg-key.txt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OT] pmac: don't add "°C" suffix in sys for adt746x driver
2004-09-18 23:09 ` Max Valdez
@ 2004-09-20 1:42 ` Tonnerre
2004-09-20 14:26 ` Max Valdez
0 siblings, 1 reply; 7+ messages in thread
From: Tonnerre @ 2004-09-20 1:42 UTC (permalink / raw)
To: Max Valdez; +Cc: Geert Uytterhoeven, Linux Kernel list
[-- Attachment #1: Type: text/plain, Size: 326 bytes --]
Salut,
On Sat, Sep 18, 2004 at 06:09:46PM -0500, Max Valdez wrote:
> > Universal temperature, in K? And you'll never ever see negative numbers ;-)
> It's called Absolute Temperature, (Kelvins for thos who dont know) :-)
Or degree of Brownian Movement. Absolute temperature is not really an
unique identifier.
Tonnerre
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OT] pmac: don't add "°C" suffix in sys for adt746x driver
2004-09-20 1:42 ` [OT] " Tonnerre
@ 2004-09-20 14:26 ` Max Valdez
0 siblings, 0 replies; 7+ messages in thread
From: Max Valdez @ 2004-09-20 14:26 UTC (permalink / raw)
To: Tonnerre; +Cc: Linux Kernel list
On Sunday 19 September 2004 20:42, Tonnerre wrote:
> Salut,
>
> On Sat, Sep 18, 2004 at 06:09:46PM -0500, Max Valdez wrote:
> > > Universal temperature, in K? And you'll never ever see negative numbers
> > > ;-)
> >
> > It's called Absolute Temperature, (Kelvins for thos who dont know) :-)
>
> Or degree of Brownian Movement. Absolute temperature is not really an
> unique identifier.
Actually Brownian Motion, and Molecular Dynamics in general depends on
Temperature, and that dependency gave out the idea of an "Absolute
Temperature" wich is quite handy when making computations on gases, and the
whole molecular simulation theory.
When it comes to electrons temperature afects, but don't determines movement,
but for the mecanics of molecules and the suchs temperature is one of the
most important variables.
Max
--
Linux garaged 2.6.9-rc1-mm1 #3 SMP Mon Aug 30 12:14:50 CDT 2004 i686 Intel(R)
Pentium(R) 4 CPU 2.80GHz GenuineIntel GNU/Linux
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GS/S d- s: a-29 C++(+++) ULAHI+++ P+ L++>+++ E--- W++ N* o-- K- w++++ O- M--
V-- PS+ PE Y-- PGP++ t- 5- X+ R tv++ b+ DI+++ D- G++ e++ h+ r+ z**
------END GEEK CODE BLOCK------
gpg-key: http://garaged.homeip.net/gpg-key.txt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] pmac: don't add "°C" suffix in sys for adt746x driver
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-21 6:33 ` Colin Leroy
1 sibling, 0 replies; 7+ messages in thread
From: Colin Leroy @ 2004-09-21 6:33 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Andrew Morton, Linus Torvalds, Linux Kernel list
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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-09-21 6:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH] " Colin Leroy
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.