[PATCH 26/41] m68k: amiflop __user annotations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Al Viro <[email protected]>
Date: 1135011656 -0500

Signed-off-by: Al Viro <[email protected]>

---

 drivers/block/amiflop.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

acedeac10e60b9db8e3e4be4c84ec3d06f61077a
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c
index 8c69533..ac58521 100644
--- a/drivers/block/amiflop.c
+++ b/drivers/block/amiflop.c
@@ -1431,6 +1431,7 @@ static int fd_ioctl(struct inode *inode,
 {
 	int drive = iminor(inode) & 3;
 	static struct floppy_struct getprm;
+	void __user *argp = (void __user *)param;
 
 	switch(cmd){
 	case HDIO_GETGEO:
@@ -1440,8 +1441,7 @@ static int fd_ioctl(struct inode *inode,
 		loc.sectors = unit[drive].dtype->sects * unit[drive].type->sect_mult;
 		loc.cylinders = unit[drive].type->tracks;
 		loc.start = 0;
-		if (copy_to_user((void *)param, (void *)&loc,
-				 sizeof(struct hd_geometry)))
+		if (copy_to_user(argp, &loc, sizeof(struct hd_geometry)))
 			return -EFAULT;
 		break;
 	}
@@ -1488,9 +1488,7 @@ static int fd_ioctl(struct inode *inode,
 		getprm.head=unit[drive].type->heads;
 		getprm.sect=unit[drive].dtype->sects * unit[drive].type->sect_mult;
 		getprm.size=unit[drive].blocks;
-		if (copy_to_user((void *)param,
-				 (void *)&getprm,
-				 sizeof(struct floppy_struct)))
+		if (copy_to_user(argp, &getprm, sizeof(struct floppy_struct)))
 			return -EFAULT;
 		break;
 	case FDSETPRM:
@@ -1502,8 +1500,7 @@ static int fd_ioctl(struct inode *inode,
 		break;
 #ifdef RAW_IOCTL
 	case IOCTL_RAW_TRACK:
-		if (copy_to_user((void *)param, raw_buf,
-				 unit[drive].type->read_size))
+		if (copy_to_user(argp, raw_buf, unit[drive].type->read_size))
 			return -EFAULT;
 		else
 			return unit[drive].type->read_size;
-- 
0.99.9.GIT

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux