linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 27/36] m68k: amiflop __user annotations
@ 2005-12-22  4:51 Al Viro
  0 siblings, 0 replies; only message in thread
From: Al Viro @ 2005-12-22  4:51 UTC (permalink / raw)
  To: linux-m68k; +Cc: linux-kernel

From: Al Viro <viro@zeniv.linux.org.uk>
Date: 1135011656 -0500

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

---

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

442bc9893a32b018bc451c700c588596d52aeb6d
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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2005-12-22  4:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-22  4:51 [PATCH 27/36] m68k: amiflop __user annotations Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).