Re: [1/1] w1: w1 temp calculation overflow fix.

Evgeniy Polyakov
2009-02-09T22:10:26Z

On Mon, Feb 09, 2009 at 01:48:44PM -0800, Harvey Harrison (harvey.harrison@gmail.com) wrote:
> > {
> > - s16 t = (rom[1] << 8) | rom[0];
> > + int t = ((s16)rom[1] << 8) | rom[0];
>
> Alternatively,
>
> int t = (s16)le16_to_cpup((__le16 *)rom);

Well, yes, but for the consistency with the other conversation functions
I think above is more appropriate.

--
Evgeniy Polyakov