diff options
author | Joe Perches <joe@perches.com> | 2010-03-10 18:21:03 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-12 18:52:31 -0500 |
commit | 0da3132f90c01f532dd85c537b5c78a196a11e24 (patch) | |
tree | 683fa2b54c243c5b828e09cc1385e6b314cf4ab5 | |
parent | 416d8d2888db392c562fb8afaf9136730ef0da9e (diff) |
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: 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>
-rw-r--r-- | drivers/block/floppy.c | 105 |
1 files changed, 52 insertions, 53 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 5d8f5510ebc5..8e24aa3a4e24 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -2892,64 +2892,63 @@ static void redo_fd_request(void) | |||
2892 | if (current_drive < N_DRIVE) | 2892 | if (current_drive < N_DRIVE) |
2893 | floppy_off(current_drive); | 2893 | floppy_off(current_drive); |
2894 | 2894 | ||
2895 | for (;;) { | 2895 | do_request: |
2896 | if (!current_req) { | 2896 | if (!current_req) { |
2897 | struct request *req; | 2897 | struct request *req; |
2898 | 2898 | ||
2899 | spin_lock_irq(floppy_queue->queue_lock); | 2899 | spin_lock_irq(floppy_queue->queue_lock); |
2900 | req = blk_fetch_request(floppy_queue); | 2900 | req = blk_fetch_request(floppy_queue); |
2901 | spin_unlock_irq(floppy_queue->queue_lock); | 2901 | spin_unlock_irq(floppy_queue->queue_lock); |
2902 | if (!req) { | 2902 | if (!req) { |
2903 | do_floppy = NULL; | 2903 | do_floppy = NULL; |
2904 | unlock_fdc(); | 2904 | unlock_fdc(); |
2905 | return; | ||
2906 | } | ||
2907 | current_req = req; | ||
2908 | } | ||
2909 | drive = (long)current_req->rq_disk->private_data; | ||
2910 | set_fdc(drive); | ||
2911 | reschedule_timeout(current_reqD, "redo fd request", 0); | ||
2912 | |||
2913 | set_floppy(drive); | ||
2914 | raw_cmd = &default_raw_cmd; | ||
2915 | raw_cmd->flags = 0; | ||
2916 | if (start_motor(redo_fd_request)) | ||
2917 | return; | 2905 | return; |
2918 | disk_change(current_drive); | ||
2919 | if (test_bit(current_drive, &fake_change) || | ||
2920 | test_bit(FD_DISK_CHANGED_BIT, &DRS->flags)) { | ||
2921 | DPRINT("disk absent or changed during operation\n"); | ||
2922 | request_done(0); | ||
2923 | continue; | ||
2924 | } | ||
2925 | if (!_floppy) { /* Autodetection */ | ||
2926 | if (!probing) { | ||
2927 | DRS->probed_format = 0; | ||
2928 | if (next_valid_format()) { | ||
2929 | DPRINT("no autodetectable formats\n"); | ||
2930 | _floppy = NULL; | ||
2931 | request_done(0); | ||
2932 | continue; | ||
2933 | } | ||
2934 | } | ||
2935 | probing = 1; | ||
2936 | _floppy = | ||
2937 | floppy_type + DP->autodetect[DRS->probed_format]; | ||
2938 | } else | ||
2939 | probing = 0; | ||
2940 | errors = &(current_req->errors); | ||
2941 | tmp = make_raw_rw_request(); | ||
2942 | if (tmp < 2) { | ||
2943 | request_done(tmp); | ||
2944 | continue; | ||
2945 | } | 2906 | } |
2907 | current_req = req; | ||
2908 | } | ||
2909 | drive = (long)current_req->rq_disk->private_data; | ||
2910 | set_fdc(drive); | ||
2911 | reschedule_timeout(current_reqD, "redo fd request", 0); | ||
2946 | 2912 | ||
2947 | if (test_bit(FD_NEED_TWADDLE_BIT, &DRS->flags)) | 2913 | set_floppy(drive); |
2948 | twaddle(); | 2914 | raw_cmd = &default_raw_cmd; |
2949 | schedule_bh(floppy_start); | 2915 | raw_cmd->flags = 0; |
2950 | debugt("queue fd request"); | 2916 | if (start_motor(redo_fd_request)) |
2951 | return; | 2917 | return; |
2918 | |||
2919 | disk_change(current_drive); | ||
2920 | if (test_bit(current_drive, &fake_change) || | ||
2921 | test_bit(FD_DISK_CHANGED_BIT, &DRS->flags)) { | ||
2922 | DPRINT("disk absent or changed during operation\n"); | ||
2923 | request_done(0); | ||
2924 | goto do_request; | ||
2952 | } | 2925 | } |
2926 | if (!_floppy) { /* Autodetection */ | ||
2927 | if (!probing) { | ||
2928 | DRS->probed_format = 0; | ||
2929 | if (next_valid_format()) { | ||
2930 | DPRINT("no autodetectable formats\n"); | ||
2931 | _floppy = NULL; | ||
2932 | request_done(0); | ||
2933 | goto do_request; | ||
2934 | } | ||
2935 | } | ||
2936 | probing = 1; | ||
2937 | _floppy = floppy_type + DP->autodetect[DRS->probed_format]; | ||
2938 | } else | ||
2939 | probing = 0; | ||
2940 | errors = &(current_req->errors); | ||
2941 | tmp = make_raw_rw_request(); | ||
2942 | if (tmp < 2) { | ||
2943 | request_done(tmp); | ||
2944 | goto do_request; | ||
2945 | } | ||
2946 | |||
2947 | if (test_bit(FD_NEED_TWADDLE_BIT, &DRS->flags)) | ||
2948 | twaddle(); | ||
2949 | schedule_bh(floppy_start); | ||
2950 | debugt("queue fd request"); | ||
2951 | return; | ||
2953 | } | 2952 | } |
2954 | 2953 | ||
2955 | static struct cont_t rw_cont = { | 2954 | static struct cont_t rw_cont = { |