Commit 003e16bb authored by Linus Torvalds's avatar Linus Torvalds

Fix more ioctl _IOR/_IOW misusage.

parent eddef4fe
...@@ -60,9 +60,13 @@ ...@@ -60,9 +60,13 @@
_IOWR('#', 0x14, struct video1394_mmap) _IOWR('#', 0x14, struct video1394_mmap)
#define VIDEO1394_IOC_UNTALK_CHANNEL \ #define VIDEO1394_IOC_UNTALK_CHANNEL \
_IOW ('#', 0x15, int) _IOW ('#', 0x15, int)
/*
* This one is broken: it really wanted
* "sizeof (struct video1394_wait) + sizeof (struct video1394_queue_variable)"
* but got just a "size_t"
*/
#define VIDEO1394_IOC_TALK_QUEUE_BUFFER \ #define VIDEO1394_IOC_TALK_QUEUE_BUFFER \
_IOW ('#', 0x16, sizeof (struct video1394_wait) + \ _IOW ('#', 0x16, size_t)
sizeof (struct video1394_queue_variable))
#define VIDEO1394_IOC_TALK_WAIT_BUFFER \ #define VIDEO1394_IOC_TALK_WAIT_BUFFER \
_IOW ('#', 0x17, struct video1394_wait) _IOW ('#', 0x17, struct video1394_wait)
#define VIDEO1394_IOC_LISTEN_POLL_BUFFER \ #define VIDEO1394_IOC_LISTEN_POLL_BUFFER \
......
...@@ -36,7 +36,7 @@ typedef struct capi_register_params { /* CAPI_REGISTER */ ...@@ -36,7 +36,7 @@ typedef struct capi_register_params { /* CAPI_REGISTER */
#define CAPI_MANUFACTURER_LEN 64 #define CAPI_MANUFACTURER_LEN 64
#define CAPI_GET_MANUFACTURER _IOWR('C',0x06,CAPI_MANUFACTURER_LEN) #define CAPI_GET_MANUFACTURER _IOWR('C',0x06,int) /* broken: wanted size 64 (CAPI_MANUFACTURER_LEN) */
/* /*
* CAPI_GET_VERSION * CAPI_GET_VERSION
...@@ -56,7 +56,7 @@ typedef struct capi_version { ...@@ -56,7 +56,7 @@ typedef struct capi_version {
*/ */
#define CAPI_SERIAL_LEN 8 #define CAPI_SERIAL_LEN 8
#define CAPI_GET_SERIAL _IOWR('C',0x08, CAPI_SERIAL_LEN) #define CAPI_GET_SERIAL _IOWR('C',0x08,int) /* broken: wanted size 8 (CAPI_SERIAL_LEN) */
/* /*
* CAPI_GET_PROFILE * CAPI_GET_PROFILE
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
#define I8K_PROC "/proc/i8k" #define I8K_PROC "/proc/i8k"
#define I8K_PROC_FMT "1.0" #define I8K_PROC_FMT "1.0"
#define I8K_BIOS_VERSION _IOR ('i', 0x80, 4) #define I8K_BIOS_VERSION _IOR ('i', 0x80, int) /* broken: meant 4 bytes */
#define I8K_MACHINE_ID _IOR ('i', 0x81, 16) #define I8K_MACHINE_ID _IOR ('i', 0x81, int) /* broken: meant 16 bytes */
#define I8K_POWER_STATUS _IOR ('i', 0x82, size_t) #define I8K_POWER_STATUS _IOR ('i', 0x82, size_t)
#define I8K_FN_STATUS _IOR ('i', 0x83, size_t) #define I8K_FN_STATUS _IOR ('i', 0x83, size_t)
#define I8K_GET_TEMP _IOR ('i', 0x84, size_t) #define I8K_GET_TEMP _IOR ('i', 0x84, size_t)
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define TOSH_PROC "/proc/toshiba" #define TOSH_PROC "/proc/toshiba"
#define TOSH_DEVICE "/dev/toshiba" #define TOSH_DEVICE "/dev/toshiba"
#define TOSH_SMM _IOWR('t', 0x90, 24) #define TOSH_SMM _IOWR('t', 0x90, int) /* broken: meant 24 bytes */
typedef struct { typedef struct {
unsigned int eax; unsigned int eax;
......
...@@ -145,9 +145,16 @@ struct video_info { ...@@ -145,9 +145,16 @@ struct video_info {
/* If changing this, vgatypes.h must also be changed (for X driver) */ /* If changing this, vgatypes.h must also be changed (for X driver) */
/* TW: ioctl for identifying and giving some info (esp. memory heap start) */ /* TW: ioctl for identifying and giving some info (esp. memory heap start) */
#define SISFB_GET_INFO _IOR('n',0xF8,sizeof(__u32))
#define SISFB_GET_VBRSTATUS _IOR('n',0xF9,sizeof(__u32)) /*
* NOTE! The ioctl types used to be "size_t" by mistake, but were
* really meant to be __u32. Changed to "__u32" even though that
* changes the value on 64-bit architectures, because the value
* (with a 4-byte size) is also hardwired in vgatypes.h for user
* space exports. So "__u32" is actually more compatible, duh!
*/
#define SISFB_GET_INFO _IOR('n',0xF8,__u32)
#define SISFB_GET_VBRSTATUS _IOR('n',0xF9,__u32)
/* TW: Structure argument for SISFB_GET_INFO ioctl */ /* TW: Structure argument for SISFB_GET_INFO ioctl */
typedef struct _SISFB_INFO sisfb_info, *psisfb_info; typedef struct _SISFB_INFO sisfb_info, *psisfb_info;
......
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