MIPS: ioctl.h: Fix headers_check warnings [Linux 2.6.30]

This Linux kernel change "MIPS: ioctl.h: Fix headers_check warnings" is included in the Linux 2.6.30 release. This change is authored by Jaswinder Singh Rajput <jaswinder [at] kernel.org> on Thu Jun 4 18:05:49 2009 +0530. The commit for this change in Linux stable tree is 3a55314 (patch).

MIPS: ioctl.h: Fix headers_check warnings

Make ioctl.h compatible with asm-generic/ioctl.h and userspace

fix the following 'make headers_check' warning:

  usr/include/asm-mips/ioctl.h:64: extern's make no sense in userspace

Signed-off-by: Jaswinder Singh Rajput <[email protected]>
Signed-off-by: Ralf Baechle <[email protected]>

There are 4 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 arch/mips/include/asm/ioctl.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/mips/include/asm/ioctl.h b/arch/mips/include/asm/ioctl.h
index 85067e2..9161634 100644
--- a/arch/mips/include/asm/ioctl.h
+++ b/arch/mips/include/asm/ioctl.h
@@ -60,12 +60,16 @@
     ((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

 /* used to create numbers */
 #define _IO(type, nr)      _IOC(_IOC_NONE, (type), (nr), 0)

Leave a Reply

Your email address will not be published. Required fields are marked *