Commit 28da9dc4 authored by Eric Brower's avatar Eric Brower Committed by David S. Miller

[SPARC]: Fix _IOC_SIZE() macro when direction is _IOC_NONE.

parent a7fa6cb1
...@@ -54,7 +54,9 @@ ...@@ -54,7 +54,9 @@
(((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) ) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) )
#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_XSIZEMASK) #define _IOC_SIZE(nr) \
((((((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) & (_IOC_WRITE|_IOC_READ)) == 0)? \
0: (((nr) >> _IOC_SIZESHIFT) & _IOC_XSIZEMASK))
/* ...and for the PCMCIA and sound. */ /* ...and for the PCMCIA and sound. */
#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
......
...@@ -54,7 +54,9 @@ ...@@ -54,7 +54,9 @@
(((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) ) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) )
#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_XSIZEMASK) #define _IOC_SIZE(nr) \
((((((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) & (_IOC_WRITE|_IOC_READ)) == 0)? \
0: (((nr) >> _IOC_SIZESHIFT) & _IOC_XSIZEMASK))
/* ...and for the PCMCIA and sound. */ /* ...and for the PCMCIA and sound. */
#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment