diff --git a/sys/sys/ioccom.h b/sys/sys/ioccom.h index acbd0ebf9be9..be2ce66b3f79 100644 --- a/sys/sys/ioccom.h +++ b/sys/sys/ioccom.h @@ -50,8 +50,8 @@ #define IOC_INOUT (IOC_IN|IOC_OUT) #define IOC_DIRMASK (IOC_VOID|IOC_OUT|IOC_IN) -#define _IOC(inout,group,num,len) \ - ((unsigned long)(inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num))) +#define _IOC(inout,group,num,len) ((unsigned long) \ + ((inout) | (((len) & IOCPARM_MASK) << 16) | ((group) << 8) | (num))) #define _IO(g,n) _IOC(IOC_VOID, (g), (n), 0) #define _IOWINT(g,n) _IOC(IOC_VOID, (g), (n), sizeof(int)) #define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t))