[PATCH] staging: vc04_services: rework ioctl code path

Arnd Bergmann arnd at arndb.de
Thu Nov 10 00:44:58 PST 2016


On Wednesday, November 9, 2016 3:22:22 PM CET Michael Zoran wrote:
> Perhaps it would make sense to even write "accessor" macros for the
> various fields of the passed in structure and put some of the ioctl
> handling code into a header.  then the code could be included twice. 
> Once for the native case, and once for the compat case.
> 
> The only real complication is the silly compiler gives hard to diagnose
> error messages when putting code in a header and it makes it extremely
> hard to use traditional debuggers on the code.
> 

I'd recommend staying away from too much cleverness. The driver is
already hard to read as it is, better just do what everyone else is
doing for ioctls, to give the least amount of surprise to readers.

	Arnd




More information about the linux-rpi-kernel mailing list