[PATCH V2 1/7] staging: vchiq_arm: Add compat ioctl for create service

Dan Carpenter dan.carpenter at oracle.com
Tue Jan 24 14:07:47 UTC 2017


On Mon, Jan 23, 2017 at 07:43:09AM -0800, Michael Zoran wrote:
> On Mon, 2017-01-23 at 14:38 +0300, Dan Carpenter wrote:
> > I'm attaching how I would basically like to see patch 1/7 done.  It's
> > not perfect, I did it as quickly as possible and haven't tested
> > anything.  I would normally be more careful if I were sending this
> > for
> > inclusion so there are no sign offs etc.
> 
> Thanks, Dan. I appreciate the clarify on what you are looking for.
> 
> Sounds like if I go that route it's going to take some time.  I'm
> thinking that if I do this I should deal with one ioctl cleanup per
> series instead of aiming for the goal of getting compat to work.
> 

It doesn't take that long really...  I kind of figured things out as I
went along.  Implementing the second ioctl would maybe have been
quicker.  But it also might be good to just go through and break the
ioctl up into tons of little functions first before implementing the
COMPAT stuff.  Do the cleanup first then the rest.

What I like about my code is that it removes abstractions.  The
do_ioctl_create_service() takes a VCHIQ_CREATE_SERVICE_T and writes an
int at the end.  It's not generic at all.

> What's your opinion of building the compat_ioctl function on top of the
> existing code?  Using the internal compat functions to build a 64 bit
> version of the data on the user mode stack? With that approach none of
> the existing code would need to be touched although the end result
> wouldn't be as nice or maintainable.

My instinct is that would be more subtle and complicated.

regards,
dan carpenter



More information about the devel mailing list