lkml.org 
[lkml]   [2016]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] driver: input :touchscreen : add Raydium I2C touch driver
From
Date
On Thu, 2016-03-03 at 03:14 +0000, Jeffrey Lin (林義章) wrote:
> Hi Joe:
> Thank you for your response. I'll follow your comments in next version.

OK, btw: the below looks very odd

> > +static int raydium_i2c_send_message(struct i2c_client *client,
> > + size_t len, void *data)
> > +{
> > + int error;
> > + u8 buf[HEADER_SIZE], ii;
> > +
> > + for (ii = 0; ii < HEADER_SIZE; ii++)
> > + buf[ii] = ((u8 *)data)[3 - ii];

It intermixes a #define of 4 with a hard declaration of 3
to reverse copy a byte array of length HEADER_SIZE.

Maybe use:
for (ii = 0; ii < HEADER_SIZE; ii++)
buf[ii] = ((u8 *)data)[HEADER_SIZE - 1 - ii]

\
 
 \ /
  Last update: 2016-03-03 05:41    [W:0.052 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site