]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/nilfs2/ioctl.c
nilfs2: use fixed sized types for ioctl structures
[linux-2.6-omap-h63xx.git] / fs / nilfs2 / ioctl.c
index 85a291ccc1bee443400a86b29a5abc86d1760b5a..7fbd9fe1d035e8545086f44c9c852658a27ad5fc 100644 (file)
@@ -41,6 +41,7 @@ static int nilfs_ioctl_wrap_copy(struct the_nilfs *nilfs,
                                                   void *, size_t, size_t))
 {
        void *buf;
+       void __user *base = (void __user *)(unsigned long)argv->v_base;
        size_t maxmembs, total, n;
        ssize_t nr;
        int ret, i;
@@ -64,9 +65,8 @@ static int nilfs_ioctl_wrap_copy(struct the_nilfs *nilfs,
                n = (argv->v_nmembs - i < maxmembs) ?
                        argv->v_nmembs - i : maxmembs;
                if ((dir & _IOC_WRITE) &&
-                   copy_from_user(buf,
-                           (void __user *)argv->v_base + argv->v_size * i,
-                           argv->v_size * n)) {
+                   copy_from_user(buf, base + argv->v_size * i,
+                                  argv->v_size * n)) {
                        ret = -EFAULT;
                        break;
                }
@@ -78,9 +78,8 @@ static int nilfs_ioctl_wrap_copy(struct the_nilfs *nilfs,
                        break;
                }
                if ((dir & _IOC_READ) &&
-                   copy_to_user(
-                           (void __user *)argv->v_base + argv->v_size * i,
-                           buf, argv->v_size * nr)) {
+                   copy_to_user(base + argv->v_size * i, buf,
+                                argv->v_size * nr)) {
                        ret = -EFAULT;
                        break;
                }