lkml.org 
[lkml]   [2015]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/6] i2c: qup: Add V2 tags support
From
Date
Hi Sricharan,

On Thu, 2015-03-26 at 11:14 +0530, Sricharan R wrote:
>
> > > + if (msg->flags & I2C_M_RD)
> > > + qup->rx_tag_len = (qup->blocks << 1);
> >
> > here again.
> >
> hmm, why not shift ?

Because it makes reading code harder and because compiler
is smart enough to choose appropriate instruction for
underling CPU architecture.

> > > + else
> > > + qup->rx_tag_len = 0;
> > > +}
> > > +
> > > +static u32 qup_i2c_xfer_data(struct qup_i2c_dev *qup, int len,
> > > + u8 *buf, int last)
> > > +{
> >
> > I think that xfer is too vague in this case, prefer write or send.
> >
> ok. Will change it to send.
> > > + static u32 val, idx;
> >
> > static? please fix.
> That was intentional. Using to pack tag and data in to one word across
> two calls. So preserving val, idx across calls.

Sorry this is no go! Reorganize the code, please.

Regards,
Ivan


\
 
 \ /
  Last update: 2015-03-26 08:41    [W:0.374 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site