* i2c via686a.c: save at least 0.5k of space by long v[256] -> u16 v[256]
@ 2005-09-01 6:10 Denis Vlasenko
2005-09-01 15:59 ` Greg KH
0 siblings, 1 reply; 9+ messages in thread
From: Denis Vlasenko @ 2005-09-01 6:10 UTC (permalink / raw)
To: greg; +Cc: khali, lm-sensors, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 44 bytes --]
Not tested, but it's rather obvious.
--
vda
[-- Attachment #2: via686a.patch --]
[-- Type: text/x-diff, Size: 677 bytes --]
--- linux-2.6.12.src/drivers/i2c/chips/via686a.c.orig Sun Jun 19 16:10:10 2005
+++ linux-2.6.12.src/drivers/i2c/chips/via686a.c Tue Aug 30 00:21:39 2005
@@ -205,7 +205,7 @@ static inline u8 FAN_TO_REG(long rpm, in
but the function is very linear in the useful range (0-80 deg C), so
we'll just use linear interpolation for 10-bit readings.) So, tempLUT
is the temp at via register values 0-255: */
-static const long tempLUT[] =
+static const int16_t tempLUT[] =
{ -709, -688, -667, -646, -627, -607, -589, -570, -553, -536, -519,
-503, -487, -471, -456, -442, -428, -414, -400, -387, -375,
-362, -350, -339, -327, -316, -305, -295, -285, -275, -265,
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: i2c via686a.c: save at least 0.5k of space by long v[256] -> u16 v[256]
2005-09-01 6:10 i2c via686a.c: save at least 0.5k of space by long v[256] -> u16 v[256] Denis Vlasenko
@ 2005-09-01 15:59 ` Greg KH
2005-09-02 5:54 ` Denis Vlasenko
0 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2005-09-01 15:59 UTC (permalink / raw)
To: Denis Vlasenko; +Cc: khali, lm-sensors, linux-kernel
On Thu, Sep 01, 2005 at 09:10:14AM +0300, Denis Vlasenko wrote:
> Not tested, but it's rather obvious.
Except you forgot a "Signed-off-by:" line...
> --- linux-2.6.12.src/drivers/i2c/chips/via686a.c.orig Sun Jun 19 16:10:10 2005
> +++ linux-2.6.12.src/drivers/i2c/chips/via686a.c Tue Aug 30 00:21:39 2005
> @@ -205,7 +205,7 @@ static inline u8 FAN_TO_REG(long rpm, in
> but the function is very linear in the useful range (0-80 deg C), so
> we'll just use linear interpolation for 10-bit readings.) So, tempLUT
> is the temp at via register values 0-255: */
> -static const long tempLUT[] =
> +static const int16_t tempLUT[] =
int16_t is not a proper kernel type. Do you really mean s16 instead?
Care to redo this?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: i2c via686a.c: save at least 0.5k of space by long v[256] -> u16 v[256]
2005-09-01 15:59 ` Greg KH
@ 2005-09-02 5:54 ` Denis Vlasenko
2005-09-03 8:22 ` Jean Delvare
2005-09-03 8:26 ` i2c via686a.c: save at least 0.5k of space by long v[256] -> u16 v[256] Jean Delvare
0 siblings, 2 replies; 9+ messages in thread
From: Denis Vlasenko @ 2005-09-02 5:54 UTC (permalink / raw)
To: Greg KH; +Cc: khali, lm-sensors, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 946 bytes --]
On Thursday 01 September 2005 18:59, Greg KH wrote:
> On Thu, Sep 01, 2005 at 09:10:14AM +0300, Denis Vlasenko wrote:
> > Not tested, but it's rather obvious.
>
> Except you forgot a "Signed-off-by:" line...
>
> > --- linux-2.6.12.src/drivers/i2c/chips/via686a.c.orig Sun Jun 19 16:10:10 2005
> > +++ linux-2.6.12.src/drivers/i2c/chips/via686a.c Tue Aug 30 00:21:39 2005
> > @@ -205,7 +205,7 @@ static inline u8 FAN_TO_REG(long rpm, in
> > but the function is very linear in the useful range (0-80 deg C), so
> > we'll just use linear interpolation for 10-bit readings.) So, tempLUT
> > is the temp at via register values 0-255: */
> > -static const long tempLUT[] =
> > +static const int16_t tempLUT[] =
>
> int16_t is not a proper kernel type. Do you really mean s16 instead?
Ok. Please be informed that there are lots of intNN_t's in i2c dir tho...
> Care to redo this?
Signed-off-by: Denis Vlasenko <vda@ilport.com.ua>
--
vda
[-- Attachment #2: via686a.patch --]
[-- Type: text/x-diff, Size: 673 bytes --]
--- linux-2.6.12.src/drivers/i2c/chips/via686a.c.orig Sun Jun 19 16:10:10 2005
+++ linux-2.6.12.src/drivers/i2c/chips/via686a.c Tue Aug 30 00:21:39 2005
@@ -205,7 +205,7 @@ static inline u8 FAN_TO_REG(long rpm, in
but the function is very linear in the useful range (0-80 deg C), so
we'll just use linear interpolation for 10-bit readings.) So, tempLUT
is the temp at via register values 0-255: */
-static const long tempLUT[] =
+static const s16 tempLUT[] =
{ -709, -688, -667, -646, -627, -607, -589, -570, -553, -536, -519,
-503, -487, -471, -456, -442, -428, -414, -400, -387, -375,
-362, -350, -339, -327, -316, -305, -295, -285, -275, -265,
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: i2c via686a.c: save at least 0.5k of space by long v[256] -> u16 v[256]
2005-09-02 5:54 ` Denis Vlasenko
@ 2005-09-03 8:22 ` Jean Delvare
2005-09-03 14:13 ` [PATCH 2.6] hwmon: via686a: save 0.5k by long v[256] -> s16 v[256] Jean Delvare
2005-09-03 8:26 ` i2c via686a.c: save at least 0.5k of space by long v[256] -> u16 v[256] Jean Delvare
1 sibling, 1 reply; 9+ messages in thread
From: Jean Delvare @ 2005-09-03 8:22 UTC (permalink / raw)
To: Denis Vlasenko; +Cc: Greg KH, LM Sensors, LKML
Hi Denis,
> --- linux-2.6.12.src/drivers/i2c/chips/via686a.c.orig Sun Jun 19 16:10:10 2005
> +++ linux-2.6.12.src/drivers/i2c/chips/via686a.c Tue Aug 30 00:21:39 2005
> @@ -205,7 +205,7 @@ static inline u8 FAN_TO_REG(long rpm, in
> but the function is very linear in the useful range (0-80 deg C), so
> we'll just use linear interpolation for 10-bit readings.) So, tempLUT
> is the temp at via register values 0-255: */
> -static const long tempLUT[] =
> +static const s16 tempLUT[] =
> { -709, -688, -667, -646, -627, -607, -589, -570, -553, -536, -519,
> -503, -487, -471, -456, -442, -428, -414, -400, -387, -375,
> -362, -350, -339, -327, -316, -305, -295, -285, -275, -265,
This patch doesn't apply on top of my stack, first because the hardware
monitoring drivers have been moved to drivers/hwmon, second because the
via686a driver had indentation cleanups since 2.6.12.
Could you please provide this patch against 2.6.13-mm1?
Thanks,
--
Jean Delvare
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: i2c via686a.c: save at least 0.5k of space by long v[256] -> u16 v[256]
2005-09-02 5:54 ` Denis Vlasenko
2005-09-03 8:22 ` Jean Delvare
@ 2005-09-03 8:26 ` Jean Delvare
2005-09-03 12:51 ` Denis Vlasenko
1 sibling, 1 reply; 9+ messages in thread
From: Jean Delvare @ 2005-09-03 8:26 UTC (permalink / raw)
To: Denis Vlasenko; +Cc: Greg KH, LKML
Hi Denis,
BTW...
> Please be informed that there are lots of intNN_t's in i2c dir
> tho...
I couldn't find any. What were you refering to exactly?
Thanks,
--
Jean Delvare
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: i2c via686a.c: save at least 0.5k of space by long v[256] -> u16 v[256]
2005-09-03 8:26 ` i2c via686a.c: save at least 0.5k of space by long v[256] -> u16 v[256] Jean Delvare
@ 2005-09-03 12:51 ` Denis Vlasenko
0 siblings, 0 replies; 9+ messages in thread
From: Denis Vlasenko @ 2005-09-03 12:51 UTC (permalink / raw)
To: Jean Delvare; +Cc: Greg KH, LKML
On Saturday 03 September 2005 11:26, Jean Delvare wrote:
> Hi Denis,
>
> BTW...
>
> > Please be informed that there are lots of intNN_t's in i2c dir
> > tho...
>
> I couldn't find any. What were you refering to exactly?
Sorry I was wrong. While kernel has ~15000 [u]intNN_t's
they are all _not_ in i2c.
--
vda
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2.6] hwmon: via686a: save 0.5k by long v[256] -> s16 v[256]
2005-09-03 8:22 ` Jean Delvare
@ 2005-09-03 14:13 ` Jean Delvare
2005-09-09 21:32 ` Greg KH
0 siblings, 1 reply; 9+ messages in thread
From: Jean Delvare @ 2005-09-03 14:13 UTC (permalink / raw)
To: Greg KH; +Cc: Denis Vlasenko, LKML, LM Sensors
Hi Greg, all,
> This patch doesn't apply on top of my stack, first because the
> hardware monitoring drivers have been moved to drivers/hwmon, second
> because the via686a driver had indentation cleanups since 2.6.12.
>
> Could you please provide this patch against 2.6.13-mm1?
On Denis' request, I have done that myself.
------
We can save 0.5kB of data in the via686a driver.
From: Denis Vlasenko <vda@ilport.com.ua>
Signed-off-by: Denis Vlasenko <vda@ilport.com.ua>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/hwmon/via686a.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-2.6.13.orig/drivers/hwmon/via686a.c 2005-08-29 20:54:28.000000000 +0200
+++ linux-2.6.13/drivers/hwmon/via686a.c 2005-09-03 16:05:14.000000000 +0200
@@ -198,7 +198,7 @@
but the function is very linear in the useful range (0-80 deg C), so
we'll just use linear interpolation for 10-bit readings.) So, tempLUT
is the temp at via register values 0-255: */
-static const long tempLUT[] =
+static const s16 tempLUT[] =
{ -709, -688, -667, -646, -627, -607, -589, -570, -553, -536, -519,
-503, -487, -471, -456, -442, -428, -414, -400, -387, -375,
-362, -350, -339, -327, -316, -305, -295, -285, -275, -265,
--
Jean Delvare
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2.6] hwmon: via686a: save 0.5k by long v[256] -> s16 v[256]
2005-09-03 14:13 ` [PATCH 2.6] hwmon: via686a: save 0.5k by long v[256] -> s16 v[256] Jean Delvare
@ 2005-09-09 21:32 ` Greg KH
2005-09-10 21:00 ` Jean Delvare
0 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2005-09-09 21:32 UTC (permalink / raw)
To: Jean Delvare; +Cc: Denis Vlasenko, LKML, LM Sensors
On Sat, Sep 03, 2005 at 04:13:31PM +0200, Jean Delvare wrote:
> Hi Greg, all,
>
> > This patch doesn't apply on top of my stack, first because the
> > hardware monitoring drivers have been moved to drivers/hwmon, second
> > because the via686a driver had indentation cleanups since 2.6.12.
> >
> > Could you please provide this patch against 2.6.13-mm1?
>
> On Denis' request, I have done that myself.
Unfortunatly, no one noticed that this patch adds a build warning :(
So I'm not going to apply it, sorry.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2.6] hwmon: via686a: save 0.5k by long v[256] -> s16 v[256]
2005-09-09 21:32 ` Greg KH
@ 2005-09-10 21:00 ` Jean Delvare
0 siblings, 0 replies; 9+ messages in thread
From: Jean Delvare @ 2005-09-10 21:00 UTC (permalink / raw)
To: Greg KH; +Cc: LM Sensors, LKML, Denis Vlasenko
Hi Greg,
> Unfortunatly, no one noticed that this patch adds a build warning :(
I'm sorry about that, I though I had checked but now it seems not. A new
patch addressing the issue follows.
Thanks.
----------------------
We can save 0.5kB of data in the via686a driver.
From: Denis Vlasenko <vda@ilport.com.ua>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/hwmon/via686a.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- linux-2.6.13-git7.orig/drivers/hwmon/via686a.c 2005-09-08 22:40:16.000000000 +0200
+++ linux-2.6.13-git7/drivers/hwmon/via686a.c 2005-09-10 10:56:12.000000000 +0200
@@ -198,7 +198,7 @@
but the function is very linear in the useful range (0-80 deg C), so
we'll just use linear interpolation for 10-bit readings.) So, tempLUT
is the temp at via register values 0-255: */
-static const long tempLUT[] =
+static const s16 tempLUT[] =
{ -709, -688, -667, -646, -627, -607, -589, -570, -553, -536, -519,
-503, -487, -471, -456, -442, -428, -414, -400, -387, -375,
-362, -350, -339, -327, -316, -305, -295, -285, -275, -265,
@@ -270,7 +270,7 @@
}
/* for 8-bit temperature hyst and over registers */
-#define TEMP_FROM_REG(val) (tempLUT[(val)] * 100)
+#define TEMP_FROM_REG(val) ((long)tempLUT[val] * 100)
/* for 10-bit temperature readings */
static inline long TEMP_FROM_REG10(u16 val)
--
Jean Delvare
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2005-09-10 21:00 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-01 6:10 i2c via686a.c: save at least 0.5k of space by long v[256] -> u16 v[256] Denis Vlasenko
2005-09-01 15:59 ` Greg KH
2005-09-02 5:54 ` Denis Vlasenko
2005-09-03 8:22 ` Jean Delvare
2005-09-03 14:13 ` [PATCH 2.6] hwmon: via686a: save 0.5k by long v[256] -> s16 v[256] Jean Delvare
2005-09-09 21:32 ` Greg KH
2005-09-10 21:00 ` Jean Delvare
2005-09-03 8:26 ` i2c via686a.c: save at least 0.5k of space by long v[256] -> u16 v[256] Jean Delvare
2005-09-03 12:51 ` Denis Vlasenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox