aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/floppy.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-03-10 18:20:57 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-12 18:52:30 -0500
commit55eee80c6233c67217a6238dd94f1fc765c723d1 (patch)
tree6dd9c899bd434673577589e86867fa45c1056522 /drivers/block/floppy.c
parent86b12b48a29f4795e2e550f510d39931576bdf75 (diff)
drivers/block/floppy.c: remove macros CALL, WAIT and IWAIT
Obfuscating macros with embedded returns are not nice Signed-off-by: Joe Perches <joe@perches.com> Cc: Stephen Hemminger <shemminger@vyatta.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Marcin Slusarz <marcin.slusarz@gmail.com> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block/floppy.c')
-rw-r--r--drivers/block/floppy.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 665b32f598cb..4d0ac121b56f 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -519,10 +519,6 @@ static DECLARE_WAIT_QUEUE_HEAD(fdc_wait);
519static DECLARE_WAIT_QUEUE_HEAD(command_done); 519static DECLARE_WAIT_QUEUE_HEAD(command_done);
520 520
521#define NO_SIGNAL (!interruptible || !signal_pending(current)) 521#define NO_SIGNAL (!interruptible || !signal_pending(current))
522#define CALL(x) if ((x) == -EINTR) return -EINTR
523#define _WAIT(x,i) CALL(ret=wait_til_done((x),i))
524#define WAIT(x) _WAIT((x),interruptible)
525#define IWAIT(x) _WAIT((x),1)
526 522
527/* Errors during formatting are counted here. */ 523/* Errors during formatting are counted here. */
528static int format_errors; 524static int format_errors;
@@ -2268,7 +2264,9 @@ static int do_format(int drive, struct format_descr *tmp_format_req)
2268 format_errors = 0; 2264 format_errors = 0;
2269 cont = &format_cont; 2265 cont = &format_cont;
2270 errors = &format_errors; 2266 errors = &format_errors;
2271 IWAIT(redo_format); 2267 ret = wait_til_done(redo_format, 1);
2268 if (ret == -EINTR)
2269 return -EINTR;
2272 process_fd_request(); 2270 process_fd_request();
2273 return ret; 2271 return ret;
2274} 2272}
@@ -2996,8 +2994,6 @@ static struct cont_t poll_cont = {
2996 2994
2997static int poll_drive(int interruptible, int flag) 2995static int poll_drive(int interruptible, int flag)
2998{ 2996{
2999 int ret;
3000
3001 /* no auto-sense, just clear dcl */ 2997 /* no auto-sense, just clear dcl */
3002 raw_cmd = &default_raw_cmd; 2998 raw_cmd = &default_raw_cmd;
3003 raw_cmd->flags = flag; 2999 raw_cmd->flags = flag;
@@ -3006,8 +3002,8 @@ static int poll_drive(int interruptible, int flag)
3006 cont = &poll_cont; 3002 cont = &poll_cont;
3007 debug_dcl(DP->flags, "setting NEWCHANGE in poll_drive\n"); 3003 debug_dcl(DP->flags, "setting NEWCHANGE in poll_drive\n");
3008 set_bit(FD_DISK_NEWCHANGE_BIT, &DRS->flags); 3004 set_bit(FD_DISK_NEWCHANGE_BIT, &DRS->flags);
3009 WAIT(floppy_ready); 3005
3010 return ret; 3006 return wait_til_done(floppy_ready, interruptible);
3011} 3007}
3012 3008
3013/* 3009/*
@@ -3038,7 +3034,9 @@ static int user_reset_fdc(int drive, int arg, int interruptible)
3038 FDCS->reset = 1; 3034 FDCS->reset = 1;
3039 if (FDCS->reset) { 3035 if (FDCS->reset) {
3040 cont = &reset_cont; 3036 cont = &reset_cont;
3041 WAIT(reset_fdc); 3037 ret = wait_til_done(reset_fdc, interruptible);
3038 if (ret == -EINTR)
3039 return -EINTR;
3042 } 3040 }
3043 process_fd_request(); 3041 process_fd_request();
3044 return 0; 3042 return 0;