Brian Gerst | af4cd3f | 2006-01-09 20:52:18 -0800 | [diff] [blame] | 1 | #ifndef _ASM_GENERIC_IOCTL_H |
| 2 | #define _ASM_GENERIC_IOCTL_H |
| 3 | |
David Howells | 8a1ab31 | 2012-10-04 18:20:15 +0100 | [diff] [blame] | 4 | #include <uapi/asm-generic/ioctl.h> |
Brian Gerst | af4cd3f | 2006-01-09 20:52:18 -0800 | [diff] [blame] | 5 | |
Hans Verkuil | d55875f | 2014-06-06 14:37:22 -0700 | [diff] [blame] | 6 | #ifdef __CHECKER__ |
| 7 | #define _IOC_TYPECHECK(t) (sizeof(t)) |
| 8 | #else |
Brian Gerst | af4cd3f | 2006-01-09 20:52:18 -0800 | [diff] [blame] | 9 | /* provoke compile error for invalid uses of size argument */ |
| 10 | extern unsigned int __invalid_size_argument_for_IOC; |
| 11 | #define _IOC_TYPECHECK(t) \ |
| 12 | ((sizeof(t) == sizeof(t[1]) && \ |
| 13 | sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ |
| 14 | sizeof(t) : __invalid_size_argument_for_IOC) |
Hans Verkuil | d55875f | 2014-06-06 14:37:22 -0700 | [diff] [blame] | 15 | #endif |
| 16 | |
Brian Gerst | af4cd3f | 2006-01-09 20:52:18 -0800 | [diff] [blame] | 17 | #endif /* _ASM_GENERIC_IOCTL_H */ |