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

From: Evgeniy Polyakov
Date: Mon Feb 09 2009 - 17:10:27 EST


On Mon, Feb 09, 2009 at 01:48:44PM -0800, Harvey Harrison (harvey.harrison@xxxxxxxxx) 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/