* [PATCH 4/6] headers_check fix: mips, ioctl.h
[not found] ` <1244118714.5172.33.camel@ht.satnam>
@ 2009-06-04 12:35 ` Jaswinder Singh Rajput
2009-06-04 12:46 ` Ralf Baechle
0 siblings, 1 reply; 5+ messages in thread
From: Jaswinder Singh Rajput @ 2009-06-04 12:35 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Ingo Molnar, Andrew Morton, LKML, Ralf Baechle, linux-mips,
Michael Abbott
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 <jaswinderrajput@gmail.com>
---
arch/mips/include/asm/ioctl.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
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)
--
1.6.0.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 4/6] headers_check fix: mips, ioctl.h
2009-06-04 12:35 ` [PATCH 4/6] headers_check fix: mips, ioctl.h Jaswinder Singh Rajput
@ 2009-06-04 12:46 ` Ralf Baechle
2009-06-04 20:09 ` Sam Ravnborg
0 siblings, 1 reply; 5+ messages in thread
From: Ralf Baechle @ 2009-06-04 12:46 UTC (permalink / raw)
To: Jaswinder Singh Rajput
Cc: Sam Ravnborg, Ingo Molnar, Andrew Morton, LKML, linux-mips,
Michael Abbott
On Thu, Jun 04, 2009 at 06:05:49PM +0530, Jaswinder Singh Rajput wrote:
> 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 <jaswinderrajput@gmail.com>
Thanks, applied.
Ralf
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 4/6] headers_check fix: mips, ioctl.h
2009-06-04 12:46 ` Ralf Baechle
@ 2009-06-04 20:09 ` Sam Ravnborg
2009-06-05 9:34 ` Arnd Bergmann
0 siblings, 1 reply; 5+ messages in thread
From: Sam Ravnborg @ 2009-06-04 20:09 UTC (permalink / raw)
To: Ralf Baechle
Cc: Jaswinder Singh Rajput, Ingo Molnar, Andrew Morton, LKML,
linux-mips, Michael Abbott
On Thu, Jun 04, 2009 at 01:46:31PM +0100, Ralf Baechle wrote:
> On Thu, Jun 04, 2009 at 06:05:49PM +0530, Jaswinder Singh Rajput wrote:
>
> > 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 <jaswinderrajput@gmail.com>
>
> Thanks, applied.
Hi Ralf.
Any specific reason why mips does not use include/asm-generic/ioctl.h?
Had mips done so this would not have been an issue.
Sam
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 4/6] headers_check fix: mips, ioctl.h
2009-06-04 20:09 ` Sam Ravnborg
@ 2009-06-05 9:34 ` Arnd Bergmann
2009-06-05 12:04 ` Ralf Baechle
0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2009-06-05 9:34 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Ralf Baechle, Jaswinder Singh Rajput, Ingo Molnar, Andrew Morton,
LKML, linux-mips, Michael Abbott
On Thursday 04 June 2009, Sam Ravnborg wrote:
> Any specific reason why mips does not use include/asm-generic/ioctl.h?
> Had mips done so this would not have been an issue.
The original include/asm-generic/ioctl.h did not allow overriding
the values of _IOC_{SIZEBITS,DIRBITS,NONE,READ,WRITE}, so it
was initially not possible to use it.
Nowadays, you can simply use the same approach as powerpc:
#ifndef _ASM_MIPS_IOCTL_H
#define _ASM_MIPS_IOCTL_H
#define _IOC_SIZEBITS 13
#define _IOC_DIRBITS 3
#define _IOC_NONE 1U
#define _IOC_READ 2U
#define _IOC_WRITE 4U
/*
* The following are included for compatibility
*/
#define _IOC_VOID 0x20000000
#define _IOC_OUT 0x40000000
#define _IOC_IN 0x80000000
#define _IOC_INOUT (IOC_IN|IOC_OUT)
#include <asm-generic/ioctl.h>
#endif /* _ASM_MIPS_IOCTL_H */
This would indeed be a cleaner fix.
Arnd <><
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 4/6] headers_check fix: mips, ioctl.h
2009-06-05 9:34 ` Arnd Bergmann
@ 2009-06-05 12:04 ` Ralf Baechle
0 siblings, 0 replies; 5+ messages in thread
From: Ralf Baechle @ 2009-06-05 12:04 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sam Ravnborg, Jaswinder Singh Rajput, Ingo Molnar, Andrew Morton,
LKML, linux-mips, Michael Abbott
On Fri, Jun 05, 2009 at 10:34:00AM +0100, Arnd Bergmann wrote:
> On Thursday 04 June 2009, Sam Ravnborg wrote:
> > Any specific reason why mips does not use include/asm-generic/ioctl.h?
> > Had mips done so this would not have been an issue.
>
> The original include/asm-generic/ioctl.h did not allow overriding
> the values of _IOC_{SIZEBITS,DIRBITS,NONE,READ,WRITE}, so it
> was initially not possible to use it.
>
> Nowadays, you can simply use the same approach as powerpc:
>
> #ifndef _ASM_MIPS_IOCTL_H
> #define _ASM_MIPS_IOCTL_H
>
> #define _IOC_SIZEBITS 13
> #define _IOC_DIRBITS 3
>
> #define _IOC_NONE 1U
> #define _IOC_READ 2U
> #define _IOC_WRITE 4U
>
> /*
> * The following are included for compatibility
> */
> #define _IOC_VOID 0x20000000
> #define _IOC_OUT 0x40000000
> #define _IOC_IN 0x80000000
> #define _IOC_INOUT (IOC_IN|IOC_OUT)
>
> #include <asm-generic/ioctl.h>
>
> #endif /* _ASM_MIPS_IOCTL_H */
>
> This would indeed be a cleaner fix.
In fact that's almost identical to what I already have. But I don't even
recall what _IOC_VOID, _IOC_OUT, _IOC_IN and _IOC_INOUT were meant to be
compatible with. They were added in 2.1.14 so presumably they've become
irrlevant, so I've dropped them. I bet nobody will notice.
Ralf
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-06-05 12:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1244118232.5172.26.camel@ht.satnam>
[not found] ` <1244118476.5172.29.camel@ht.satnam>
[not found] ` <1244118599.5172.31.camel@ht.satnam>
[not found] ` <1244118714.5172.33.camel@ht.satnam>
2009-06-04 12:35 ` [PATCH 4/6] headers_check fix: mips, ioctl.h Jaswinder Singh Rajput
2009-06-04 12:46 ` Ralf Baechle
2009-06-04 20:09 ` Sam Ravnborg
2009-06-05 9:34 ` Arnd Bergmann
2009-06-05 12:04 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).