From: Al Viro <viro@ftp.linux.org.uk>
To: linux-m68k@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 27/36] m68k: amiflop __user annotations
Date: Thu, 22 Dec 2005 04:51:19 +0000 [thread overview]
Message-ID: <E1EpIQB-0004tA-My@ZenIV.linux.org.uk> (raw)
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
reply other threads:[~2005-12-22 4:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1EpIQB-0004tA-My@ZenIV.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).