All of lore.kernel.org
 help / color / mirror / Atom feed
* [1/1] w1: w1 temp calculation overflow fix.
@ 2009-02-09 21:42 Evgeniy Polyakov
  2009-02-09 21:48 ` Harvey Harrison
  2009-02-09 21:56 ` Andrew Morton
  0 siblings, 2 replies; 9+ messages in thread
From: Evgeniy Polyakov @ 2009-02-09 21:42 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Ian Dall

Signed-off-by: Ian Dall <ian@beware.dropbear.id.au>
Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>

diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index 2c8dff9..1ed3d55 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -115,7 +115,7 @@ static struct w1_therm_family_converter w1_therm_families[] = {
 
 static inline int w1_DS18B20_convert_temp(u8 rom[9])
 {
-	s16 t = (rom[1] << 8) | rom[0];
+	int t = ((s16)rom[1] << 8) | rom[0];
 	t = t*1000/16;
 	return t;
 }


-- 
	Evgeniy Polyakov

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-02-11  7:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-09 21:42 [1/1] w1: w1 temp calculation overflow fix Evgeniy Polyakov
2009-02-09 21:48 ` Harvey Harrison
2009-02-09 22:09   ` Evgeniy Polyakov
2009-02-09 21:56 ` Andrew Morton
2009-02-09 22:08   ` Evgeniy Polyakov
2009-02-09 22:48     ` Andrew Morton
2009-02-09 23:31       ` Andrew Morton
2009-02-10  8:54         ` Evgeniy Polyakov
2009-02-11  6:41         ` Ian Dall

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.