Add a small number of preprocessor directives to include/asm-generic/ioctl.h so that individual architectures need only override a small number of values, if any, before including the generic version. Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> --- i'll take one more crack at this -- the patch below will allow almost all of the arch-specific ioctl.h header files to be replaced by a small number of preprocessor directives, followed by including the asm-generic version. and, no, i don't want to include those other header file changes in this patch. this patch should go in first, followed by each of the others on an arch-by-arch basis. diff --git a/include/asm-generic/ioctl.h b/include/asm-generic/ioctl.h index cd02729..e035e6d 100644 --- a/include/asm-generic/ioctl.h +++ b/include/asm-generic/ioctl.h @@ -21,8 +21,15 @@ */ #define _IOC_NRBITS 8 #define _IOC_TYPEBITS 8 -#define _IOC_SIZEBITS 14 -#define _IOC_DIRBITS 2 +/* + * Let any architecture override either of the following. + */ +#ifndef _IOC_SIZEBITS +# define _IOC_SIZEBITS 14 +#endif +#ifndef _IOC_DIRBITS +# define _IOC_DIRBITS 2 +#endif #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) @@ -35,11 +42,17 @@ #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) /* - * Direction bits. + * Direction bits, which any architecture can choose to override. */ -#define _IOC_NONE 0U -#define _IOC_WRITE 1U -#define _IOC_READ 2U +#ifndef _IOC_NONE +# define _IOC_NONE 0U +#endif +#ifndef _IOC_WRITE +# define _IOC_WRITE 1U +#endif +#ifndef _IOC_READ +# define _IOC_READ 2U +#endif #define _IOC(dir,type,nr,size) \ (((dir) << _IOC_DIRSHIFT) | \ -- ======================================================================== Robert P. J. Day Linux Consulting, Training and Annoying Kernel Pedantry Waterloo, Ontario, CANADA http://fsdev.net/wiki/index.php?title=Main_Page ======================================================================== -
| Linus Torvalds | Re: LSM conversion to static interface |
| Ingo Molnar | [patch 03/13] syslets: generic kernel bits |
| Ingo Molnar | Re: [PATCH 6/6] sched: disabled rt-bandwidth by default |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
git: | |
| David Miller | [GIT]: Networking |
| Gregory Haskins | [RFC PATCH 00/17] virtual-bus |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
