Commit 1591fba0 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] i2o_config __user annotations

Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a2ea8116
...@@ -624,15 +624,15 @@ static int i2o_cfg_evt_get(unsigned long arg, struct file *fp) ...@@ -624,15 +624,15 @@ static int i2o_cfg_evt_get(unsigned long arg, struct file *fp)
return 0; return 0;
} }
#if BITS_PER_LONG == 64 #ifdef CONFIG_COMPAT
static int i2o_cfg_passthru32(unsigned fd, unsigned cmnd, unsigned long arg, static int i2o_cfg_passthru32(unsigned fd, unsigned cmnd, unsigned long arg,
struct file *file) struct file *file)
{ {
struct i2o_cmd_passthru32 __user *cmd; struct i2o_cmd_passthru32 __user *cmd;
struct i2o_controller *c; struct i2o_controller *c;
u32 *user_msg; u32 __user *user_msg;
u32 *reply = NULL; u32 *reply = NULL;
u32 *user_reply = NULL; u32 __user *user_reply = NULL;
u32 size = 0; u32 size = 0;
u32 reply_size = 0; u32 reply_size = 0;
u32 rcode = 0; u32 rcode = 0;
...@@ -752,7 +752,7 @@ static int i2o_cfg_passthru32(unsigned fd, unsigned cmnd, unsigned long arg, ...@@ -752,7 +752,7 @@ static int i2o_cfg_passthru32(unsigned fd, unsigned cmnd, unsigned long arg,
flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) { flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) {
// TODO 64bit fix // TODO 64bit fix
if (copy_from_user if (copy_from_user
(p->virt, (void *)(u64) sg[i].addr_bus, (p->virt, (void __user *)(unsigned long)sg[i].addr_bus,
sg_size)) { sg_size)) {
printk(KERN_DEBUG printk(KERN_DEBUG
"%s: Could not copy SG buf %d FROM user\n", "%s: Could not copy SG buf %d FROM user\n",
...@@ -1105,7 +1105,7 @@ static int i2o_cfg_ioctl(struct inode *inode, struct file *fp, unsigned int cmd, ...@@ -1105,7 +1105,7 @@ static int i2o_cfg_ioctl(struct inode *inode, struct file *fp, unsigned int cmd,
ret = i2o_cfg_evt_get(arg, fp); ret = i2o_cfg_evt_get(arg, fp);
break; break;
#if BITS_PER_LONG != 64 #ifndef CONFIG_COMPAT
case I2OPASSTHRU: case I2OPASSTHRU:
ret = i2o_cfg_passthru(arg); ret = i2o_cfg_passthru(arg);
break; break;
...@@ -1225,7 +1225,7 @@ static int __init i2o_config_init(void) ...@@ -1225,7 +1225,7 @@ static int __init i2o_config_init(void)
misc_deregister(&i2o_miscdev); misc_deregister(&i2o_miscdev);
return -EBUSY; return -EBUSY;
} }
#if BITS_PER_LONG ==64 #ifdef CONFIG_COMPAT
register_ioctl32_conversion(I2OPASSTHRU32, i2o_cfg_passthru32); register_ioctl32_conversion(I2OPASSTHRU32, i2o_cfg_passthru32);
register_ioctl32_conversion(I2OGETIOPS, (void *)sys_ioctl); register_ioctl32_conversion(I2OGETIOPS, (void *)sys_ioctl);
#endif #endif
...@@ -1234,7 +1234,7 @@ static int __init i2o_config_init(void) ...@@ -1234,7 +1234,7 @@ static int __init i2o_config_init(void)
static void i2o_config_exit(void) static void i2o_config_exit(void)
{ {
#if BITS_PER_LONG ==64 #ifdef CONFIG_COMPAT
unregister_ioctl32_conversion(I2OPASSTHRU32); unregister_ioctl32_conversion(I2OPASSTHRU32);
unregister_ioctl32_conversion(I2OGETIOPS); unregister_ioctl32_conversion(I2OGETIOPS);
#endif #endif
......
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