aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/ioctl.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic/ioctl.h')
-rw-r--r--include/asm-generic/ioctl.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/asm-generic/ioctl.h b/include/asm-generic/ioctl.h
index 864181385579..15828b2d663c 100644
--- a/include/asm-generic/ioctl.h
+++ b/include/asm-generic/ioctl.h
@@ -68,12 +68,16 @@
68 ((nr) << _IOC_NRSHIFT) | \ 68 ((nr) << _IOC_NRSHIFT) | \
69 ((size) << _IOC_SIZESHIFT)) 69 ((size) << _IOC_SIZESHIFT))
70 70
71#ifdef __KERNEL__
71/* provoke compile error for invalid uses of size argument */ 72/* provoke compile error for invalid uses of size argument */
72extern unsigned int __invalid_size_argument_for_IOC; 73extern unsigned int __invalid_size_argument_for_IOC;
73#define _IOC_TYPECHECK(t) \ 74#define _IOC_TYPECHECK(t) \
74 ((sizeof(t) == sizeof(t[1]) && \ 75 ((sizeof(t) == sizeof(t[1]) && \
75 sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ 76 sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
76 sizeof(t) : __invalid_size_argument_for_IOC) 77 sizeof(t) : __invalid_size_argument_for_IOC)
78#else
79#define _IOC_TYPECHECK(t) (sizeof(t))
80#endif
77 81
78/* used to create numbers */ 82/* used to create numbers */
79#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) 83#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)