| diff -up vanilla-2.6.29-rc7-git2/arch/sparc/include/asm/ioctl.h.BAD vanilla-2.6.29-rc7-git2/arch/sparc/include/asm/ioctl.h |
| |
| |
| @@ -41,6 +41,17 @@ |
| ((nr) << _IOC_NRSHIFT) | \ |
| ((size) << _IOC_SIZESHIFT)) |
| |
| +#ifdef __KERNEL__ |
| +/* provoke compile error for invalid uses of size argument */ |
| +extern unsigned int __invalid_size_argument_for_IOC; |
| +#define _IOC_TYPECHECK(t) \ |
| + ((sizeof(t) == sizeof(t[1]) && \ |
| + sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ |
| + sizeof(t) : __invalid_size_argument_for_IOC) |
| +#else |
| +#define _IOC_TYPECHECK(t) (sizeof(t)) |
| +#endif |
| + |
| #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) |
| #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) |
| #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) |