From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean Delvare Subject: Re: [PATCH v1] i2c-hid: introduce HID over i2c specification implementation Date: Sun, 7 Oct 2012 21:03:59 +0200 Message-ID: <20121007210359.29f40ecf@endymion.delvare> References: <1347630103-4105-1-git-send-email-benjamin.tissoires@gmail.com> <20121007162838.01f36b7c@endymion.delvare> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Benjamin Tissoires Cc: Dmitry Torokhov , Jiri Kosina , Stephane Chatty , fabien.andre-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, scott.liu-9cfG7bMpBgR9nmWX13WWKA@public.gmane.org, Ben Dooks , Wolfram Sang , linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-i2c@vger.kernel.org On Sun, 7 Oct 2012 18:57:36 +0200, Benjamin Tissoires wrote: > On Sun, Oct 7, 2012 at 4:28 PM, Jean Delvare 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. -- Jean Delvare