Commit 0da3132f authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

drivers/block/floppy.c: unclutter redo_fd_request logic

Change for(;;) with continue; to label: goto label
Reduces indentation and adds a bit of clarity.
Signed-off-by: default avatarJoe 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 416d8d28
...@@ -2892,7 +2892,7 @@ static void redo_fd_request(void) ...@@ -2892,7 +2892,7 @@ static void redo_fd_request(void)
if (current_drive < N_DRIVE) if (current_drive < N_DRIVE)
floppy_off(current_drive); floppy_off(current_drive);
for (;;) { do_request:
if (!current_req) { if (!current_req) {
struct request *req; struct request *req;
...@@ -2915,12 +2915,13 @@ static void redo_fd_request(void) ...@@ -2915,12 +2915,13 @@ static void redo_fd_request(void)
raw_cmd->flags = 0; raw_cmd->flags = 0;
if (start_motor(redo_fd_request)) if (start_motor(redo_fd_request))
return; return;
disk_change(current_drive); disk_change(current_drive);
if (test_bit(current_drive, &fake_change) || if (test_bit(current_drive, &fake_change) ||
test_bit(FD_DISK_CHANGED_BIT, &DRS->flags)) { test_bit(FD_DISK_CHANGED_BIT, &DRS->flags)) {
DPRINT("disk absent or changed during operation\n"); DPRINT("disk absent or changed during operation\n");
request_done(0); request_done(0);
continue; goto do_request;
} }
if (!_floppy) { /* Autodetection */ if (!_floppy) { /* Autodetection */
if (!probing) { if (!probing) {
...@@ -2929,19 +2930,18 @@ static void redo_fd_request(void) ...@@ -2929,19 +2930,18 @@ static void redo_fd_request(void)
DPRINT("no autodetectable formats\n"); DPRINT("no autodetectable formats\n");
_floppy = NULL; _floppy = NULL;
request_done(0); request_done(0);
continue; goto do_request;
} }
} }
probing = 1; probing = 1;
_floppy = _floppy = floppy_type + DP->autodetect[DRS->probed_format];
floppy_type + DP->autodetect[DRS->probed_format];
} else } else
probing = 0; probing = 0;
errors = &(current_req->errors); errors = &(current_req->errors);
tmp = make_raw_rw_request(); tmp = make_raw_rw_request();
if (tmp < 2) { if (tmp < 2) {
request_done(tmp); request_done(tmp);
continue; goto do_request;
} }
if (test_bit(FD_NEED_TWADDLE_BIT, &DRS->flags)) if (test_bit(FD_NEED_TWADDLE_BIT, &DRS->flags))
...@@ -2949,7 +2949,6 @@ static void redo_fd_request(void) ...@@ -2949,7 +2949,6 @@ static void redo_fd_request(void)
schedule_bh(floppy_start); schedule_bh(floppy_start);
debugt("queue fd request"); debugt("queue fd request");
return; return;
}
} }
static struct cont_t rw_cont = { static struct cont_t rw_cont = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment