← Back to team overview

ac100 team mailing list archive

Re: [PATCH] staging: nvec: convert to use platform register andmfdcells

 

On Friday 05 August 2011 21:31:05 Joe Perches wrote:
> On Fri, 2011-08-05 at 21:03 +0200, Marc Dietrich wrote:
> > On Sunday 24 July 2011 23:01:19 Joe Perches wrote:
> > > On Sun, 2011-07-24 at 21:56 +0200, Marc Dietrich wrote:
> > > > This patch converts the nvec to use mfd cells and improves the
> > > > registration of the platform driver. The child drivers are also
> > > > converted to use mfd cells and platform registration.
> > > 
> > > trivia:
> > > > diff --git a/drivers/staging/nvec/nvec.c
> > > > b/drivers/staging/nvec/nvec.c
> > > 
> > > []
> > > 
> > > > @@ -23,6 +23,7 @@
> > > 
> > > []
> > > 
> > > >  static unsigned char EC_DISABLE_EVENT_REPORTING[]
> > > >  =	{'\x04','\x00','\x00'};
> > > 
> > > Please use const where appropriate.
> > 
> > while these message strings are constant most of the time, there are
> > places where they aren't. So the nvec_write_{a}sync functions (which
> > are feeded by these strings) cannot be called with a const argument.
> 
> That doesn't matter.
> 
> nvec_write_async should be changed to:
> 
> void nvec_write_async(struct nvec_chip *nvec, const unsigned char *data,
> short size)
> 
> and nvec_write_sync should be:
> 
> static struct nvec_msg *nvec_write_sync(struct nvec_chip *nvec, const
> unsigned char *data, short size)

sure, but does this also work if *data is not constant, e.g. points to a buffer 
(e.g. on the stack) with variable content, as mentioned above? 

> > I know this looks ugly and I plan to replace these with some macros
> > which build up the string. This will also help to explain the deeper
> > meaning of them.
> 
> Clearer is better.
> 
> cheers, Joe


Follow ups

References