[PATCH] staging: vc04_services: Add 32-bit compatibility ioctls

Greg KH gregkh at linuxfoundation.org
Tue Nov 8 06:45:19 PST 2016


On Tue, Nov 08, 2016 at 04:33:24AM -0800, Michael Zoran wrote:
> On Tue, 2016-11-08 at 13:11 +0100, Arnd Bergmann wrote:
> > On Monday, November 7, 2016 4:48:35 PM CET Michael Zoran wrote:
> > >  .../vc04_services/interface/vchiq_arm/vchiq_arm.c  | 269
> > > +++++++++++++++++++++
> > >  .../vc04_services/interface/vchiq_arm/vchiq_if.h   |  25 ++
> > >  .../interface/vchiq_arm/vchiq_ioctl.h              | 102 ++++++++
> > >  3 files changed, 396 insertions(+)
> > > 
> > > diff --git
> > > a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> > > b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> > > index 8fcd940..df343a0 100644
> > > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> > > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> > > @@ -573,12 +573,40 @@ vchiq_ioctl(struct file *file, unsigned int
> > > cmd, unsigned long arg)
> > >  				"vchiq: could not connect: %d",
> > > status);
> > >  		break;
> > >  
> > > +#if defined(CONFIG_64BIT)
> > > +	case VCHIQ_IOC_CREATE_SERVICE32:
> > > +#endif
> > >  	case VCHIQ_IOC_CREATE_SERVICE: {
> > >  		VCHIQ_CREATE_SERVICE_T args;
> > >  		USER_SERVICE_T *user_service = NULL;
> > >  		void *userdata;
> > >  		int srvstate;
> > >  
> > > +#if defined(CONFIG_64BIT)
> > > +		if (cmd == VCHIQ_IOC_CREATE_SERVICE32) {
> > 
> > Better use CONFIG_COMPAT here. Also, a simple #ifdef is sufficient
> > as neither of those symbols can be a loadable module.
> > 
> 
> OK, I can clean that up and resubmit.
> 
> > Also, just move all the compat handling into the .compat_ioctl
> > callback function and move out the common parts into helpers
> > for simplicity.
> > 
> 
> That's a bit tricky.  Hopefully GregK will respond if he'll willing
> to approve a change that rewrites the whole ioctl path.
> 
> The ioctl path is currently a mess and yes it needs to be broken up
> into smaller helper functions.  I just don't know if now is the best 
> time to do that.

I don't want to take a patch that will then later have to be reworked
because of this, so might as well break it up now!

thanks,

greg k-h



More information about the linux-rpi-kernel mailing list