lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 13 Mar 2015 11:45:20 +0100
From:	Lars-Peter Clausen <lars@...afoo.de>
To:	Andrey Smirnov <andrew.smirnov@...il.com>,
	linux-iio@...r.kernel.org
CC:	linux-kernel@...r.kernel.org, quad@...bo1ics.com
Subject: Re: [PATCH] iio: si7020: Fix endianness for I2C reads

On 03/13/2015 03:53 AM, Andrey Smirnov wrote:
> Si7020 outputs most significant byte of the measurement result first
> and least significant byte last. As a result the data returned by
> i2c_smbus_read_word_data appears as big endian. Fix this by making a
> call to an approbriate byte conversion routine.

i2c_smbus_read_word_data() returns data in native endianess. But it 
interprets the word on the bus as little-endian (As specified by the SMBus 
spec). If your chip returns data in big-endian use 
i2c_smbus_read_word_data_swapped().

- Lars
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ