lkml.org 
[lkml]   [2012]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v1] i2c-hid: introduce HID over i2c specification implementation
From
On Sun, Oct 7, 2012 at 9:03 PM, Jean Delvare <khali@linux-fr.org> wrote:
> On Sun, 7 Oct 2012 18:57:36 +0200, Benjamin Tissoires wrote:
>> On Sun, Oct 7, 2012 at 4:28 PM, Jean Delvare <khali@linux-fr.org> wrote:
>> > On Fri, 14 Sep 2012 15:41:43 +0200, benjamin.tissoires wrote:
>> >> + u16 readRegister = ihid->hdesc.wDataRegister;
>> >
>> > This is missing le16_to_cpu().
>>
>> I agree this is awful, but not putting it allows me to not have to
>> check the endianness when I'm using it.
>> But I may be totally wrong on this.
>
> I'm afraid I don't follow you. I want to see:
>
> u16 readRegister = le16_to_cpu(ihid->hdesc.wDataRegister);
>
> If you don't do that, your driver is broken on bigendian systems. And
> there's no need to "check the endianness when you're using it", the
> above should be enough for things to work just fine.
>

a little bit late, but yes, you are entirely right. I was confused by
the fact that I only wanted to use the number coming from the device
to communicate with it, but as I made bit shifting within the CPU, I
need to convert it.
So forget my previous words here, it is fixed in v2.

Thanks
Benjamin

> --
> Jean Delvare


\
 
 \ /
  Last update: 2012-10-15 23:21    [W:0.076 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site