From: Joe Perches <joe@perches.com>
To: linux-kernel@vger.kernel.org
Cc: Marcin Slusarz <marcin.slusarz@gmail.com>,
Stephen Hemminger <shemminger@vyatta.com>,
Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 16/24] drivers/block/floppy.c: Remove most uses of CALL and ECALL macros
Date: Thu, 21 Jan 2010 20:52:46 -0800 [thread overview]
Message-ID: <73fcb1ec1d221fc17d386629a490b17efd3e16b2.1264133863.git.joe@perches.com> (raw)
In-Reply-To: <cover.1264133863.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/block/floppy.c | 51 ++++++++++++++++++++++++++++++++---------------
1 files changed, 35 insertions(+), 16 deletions(-)
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index b1c2bc6..822e4ee 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -3151,8 +3151,10 @@ static inline int raw_cmd_copyout(int cmd, char __user *param,
if (ptr->length >= 0 &&
ptr->length <= ptr->buffer_length) {
long length = ptr->buffer_length - ptr->length;
- ECALL(fd_copyout(ptr->data, ptr->kernel_data,
- length));
+ ret = fd_copyout(ptr->data, ptr->kernel_data,
+ length);
+ if (ret)
+ return ret;
}
}
ptr = ptr->next;
@@ -3223,9 +3225,12 @@ static inline int raw_cmd_copyin(int cmd, char __user *param,
return -ENOMEM;
ptr->buffer_length = ptr->length;
}
- if (ptr->flags & FD_RAW_WRITE)
- ECALL(fd_copyin(ptr->data, ptr->kernel_data,
- ptr->length));
+ if (ptr->flags & FD_RAW_WRITE) {
+ ret = fd_copyin(ptr->data, ptr->kernel_data,
+ ptr->length);
+ if (ret)
+ return ret;
+ }
rcmd = &(ptr->next);
if (!(ptr->flags & FD_RAW_MORE))
return 0;
@@ -3329,10 +3334,12 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
if (lock_fdc(drive, 1))
return -EINTR;
- if (cmd != FDDEFPRM)
+ if (cmd != FDDEFPRM) {
/* notice a disk change immediately, else
* we lose our settings immediately*/
- CALL(poll_drive(1, FD_RAW_NEED_DISK));
+ if (poll_drive(1, FD_RAW_NEED_DISK) == -EINTR)
+ return -EINTR;
+ }
oldStretch = g->stretch;
user_params[drive] = *g;
if (buffer_drive == drive)
@@ -3413,7 +3420,8 @@ static int get_floppy_geometry(int drive, int type, struct floppy_struct **g)
else {
if (lock_fdc(drive, 0))
return -EINTR;
- CALL(poll_drive(0, 0));
+ if (poll_drive(0, 0) == -EINTR)
+ return -EINTR;
process_fd_request();
*g = current_type[drive];
}
@@ -3471,7 +3479,9 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
return -EINVAL;
/* convert the old style command into a new style command */
- ECALL(normalize_ioctl(&cmd, &size));
+ ret = normalize_ioctl(&cmd, &size);
+ if (ret)
+ return ret;
/* permission checks */
if (((cmd & 0x40) && !FD_IOCTL_ALLOWED) ||
@@ -3483,8 +3493,11 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
/* copyin */
memset(&inparam, 0, sizeof(inparam));
- if (_IOC_DIR(cmd) & _IOC_WRITE)
- ECALL(fd_copyin((void __user *)param, &inparam, size));
+ if (_IOC_DIR(cmd) & _IOC_WRITE) {
+ ret = fd_copyin((void __user *)param, &inparam, size);
+ if (ret)
+ return ret;
+ }
switch (cmd) {
case FDEJECT:
@@ -3513,9 +3526,11 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
case FDDEFPRM:
return set_geometry(cmd, &inparam.g, drive, type, bdev);
case FDGETPRM:
- ECALL(get_floppy_geometry(drive, type,
+ ret = get_floppy_geometry(drive, type,
(struct floppy_struct **)
- &outparam));
+ &outparam);
+ if (ret)
+ return ret;
break;
case FDMSGON:
UDP->flags |= FTD_MSG;
@@ -3526,7 +3541,8 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
case FDFMTBEG:
if (lock_fdc(drive, 1))
return -EINTR;
- CALL(poll_drive(1, FD_RAW_NEED_DISK));
+ if (poll_drive(1, FD_RAW_NEED_DISK) == -EINTR)
+ return -EINTR;
ret = UDRS->flags;
process_fd_request();
if (ret & FD_VERIFY)
@@ -3565,7 +3581,8 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
case FDPOLLDRVSTAT:
if (lock_fdc(drive, 1))
return -EINTR;
- CALL(poll_drive(1, FD_RAW_NEED_DISK));
+ if (poll_drive(1, FD_RAW_NEED_DISK) == -EINTR)
+ return -EINTR;
process_fd_request();
/* fall through */
case FDGETDRVSTAT:
@@ -3588,7 +3605,9 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
if (lock_fdc(drive, 1))
return -EINTR;
set_floppy(drive);
- CALL(i = raw_cmd_ioctl(cmd, (void __user *)param));
+ i = raw_cmd_ioctl(cmd, (void __user *)param);
+ if (i == -EINTR)
+ return -EINTR;
process_fd_request();
return i;
case FDTWADDLE:
--
1.6.6.rc0.57.gad7a
next prev parent reply other threads:[~2010-01-22 4:54 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-22 4:52 [PATCH 00/24] drivers/block/floppy.c cleanups Joe Perches
2010-01-22 4:52 ` [PATCH 01/24] drivers/block/floppy.c: Convert some #include <asm/ to #include <linux/ Joe Perches
2010-01-22 4:52 ` [PATCH 02/24] drivers/block/floppy.c: #define space and column neatening Joe Perches
2010-01-22 4:52 ` [PATCH 03/24] drivers/block/floppy.c: Use pr_<level> Joe Perches
2010-01-22 4:52 ` [PATCH 04/24] drivers/block/floppy.c: Remove unnecessary braces Joe Perches
2010-01-22 4:52 ` [PATCH 05/24] drivers/block/floppy.c: Remove used once CHECK_READY macro Joe Perches
2010-01-22 4:52 ` [PATCH 06/24] drivers/block/floppy.c: Hoist assigns from if()s, neatening Joe Perches
2010-01-22 4:52 ` [PATCH 07/24] drivers/block/floppy.c: Remove LAST_OUT macro Joe Perches
2010-01-22 4:52 ` [PATCH 08/24] drivers/block/floppy.c: Comment neatening and remove naked ; Joe Perches
2010-01-22 4:52 ` [PATCH 09/24] drivers/block/floppy.c: Remove CLEARSTRUCT macro, use memset Joe Perches
2010-01-22 4:52 ` [PATCH 10/24] drivers/block/floppy.c: Indent a comment Joe Perches
2010-01-22 4:52 ` [PATCH 11/24] drivers/block/floppy.c: Remove IN/OUT macros, indent switch/case Joe Perches
2010-01-22 4:52 ` [PATCH 12/24] drivers/block/floppy.c: Remove a few spaces from function casts Joe Perches
2010-01-22 4:52 ` [PATCH 13/24] drivers/block/floppy.c: Remove macro LOCK_FDC Joe Perches
2010-01-22 4:52 ` [PATCH 14/24] drivers/block/floppy.c: Add debug_dcl(...) macro Joe Perches
2010-01-22 4:52 ` [PATCH 15/24] drivers/block/floppy.c: Remove [U]CLEARF, [U]SETF, and [U]TESTF macros Joe Perches
2010-01-22 4:52 ` Joe Perches [this message]
2010-01-22 4:52 ` [PATCH 17/24] drivers/block/floppy.c: remove [_]COPYIN [_]COPYOUT and ECALL macros Joe Perches
2010-01-22 4:52 ` [PATCH 18/24] drivers/block/floppy.c: remove macros CALL, WAIT and IWAIT Joe Perches
2010-01-22 4:52 ` [PATCH 19/24] drivers/block/floppy.c: convert int 1/0 to bool true/false Joe Perches
2010-01-22 4:52 ` [PATCH 20/24] drivers/block/floppy.c: Move leading && and || to preceding line Joe Perches
2010-01-22 4:52 ` [PATCH 21/24] drivers/block/floppy.c: remove #define DEVICE_NAME "floppy" Joe Perches
2010-01-22 4:52 ` [PATCH 22/24] drivers/block/floppy.c: Convert int initialising to bool initialized Joe Perches
2010-01-22 4:52 ` [PATCH 23/24] drivers/block/floppy.c: Add function is_ready_state Joe Perches
2010-01-22 4:52 ` [PATCH 24/24] drivers/block/floppy.c: Remove unnecessary return and braces Joe Perches
2010-01-22 10:47 ` [PATCH 00/24] drivers/block/floppy.c cleanups Andi Kleen
2010-01-22 11:46 ` Alan Cox
2010-01-22 17:04 ` Stephen Hemminger
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=73fcb1ec1d221fc17d386629a490b17efd3e16b2.1264133863.git.joe@perches.com \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=bzolnier@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcin.slusarz@gmail.com \
--cc=shemminger@vyatta.com \
/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
all inboxes | Powered by JetHome®