Re: [RFC][PATCH] hwmon: add support for Sensirion C1 sensor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 20, 2012 at 05:14:49PM +0200, Oliver Neukum wrote:
> On Friday 20 July 2012 17:13:51 Johannes Winkelmann wrote:
> > On Fri, Jul 20, 2012 at 4:03 PM, Oliver Neukum <oneukum@xxxxxxx> wrote:
> 
> > > We have dedicated macros for conversion of endianness.
> > 
> > Like this:
> > 		val = swab16p((__le16 *)buf);
> > 		data->temperature = ((21875 * val) >> 13) - 45000;
> > 		val = swab16p((__le16 *)(buf+2));
> > 		data->humidity = ((15000 * val) >> 13) - 10000;
> 
> I was thinking of be16_to_cpu()
> 
be16_to_cpup(), maybe.

Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors


[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux