From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Scholz Date: Tue, 14 Mar 2006 09:49:11 +0100 Subject: [U-Boot-Users] Bug in DTT for temperatures below zero degress !!! In-Reply-To: <20060312145444.1E148352616@atlas.denx.de> References: <20060312145444.1E148352616@atlas.denx.de> Message-ID: <44168387.5010604@imc-berlin.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk wrote: >> - return (dtt_read(sensor, DTT_READ_TEMP) / 256); >> + return ( ((signed short) dtt_read(sensor, DTT_READ_TEMP)) / 256); > > This is not the right way to fix it. I reject this patch. > > dtt_read() is declared to return "int", so no such cast should be > needed, i. e. you fix the symptoms instead of the cause. You're probably right. But at the moment I have no access to suitable hardware and I am off for a two weeks vacations today. I promise to test this when I am back. Thansk. -- Steven