diff options
author | Joe Perches <joe@perches.com> | 2010-03-10 18:20:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-12 18:52:29 -0500 |
commit | bb57f0c662faa9879e8f265c9bc1f15bb238d2c7 (patch) | |
tree | b61c28a21cea154e92d903db6b97395d47cce48a /drivers/block | |
parent | 2300f90e31178f44b0e903c12ea311df1297d7fa (diff) |
drivers/block/floppy.c: comment neatening and remove naked ;
Spacing, column alignment and a for loop with
a naked semicolon converted to an assign and while
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')
-rw-r--r-- | drivers/block/floppy.c | 55 |
1 files changed, 30 insertions, 25 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 7c0c7d09e089..48aefd9c5662 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -1262,9 +1262,12 @@ static inline void perpendicular_mode(void) | |||
1262 | default: | 1262 | default: |
1263 | DPRINT("Invalid data rate for perpendicular mode!\n"); | 1263 | DPRINT("Invalid data rate for perpendicular mode!\n"); |
1264 | cont->done(0); | 1264 | cont->done(0); |
1265 | FDCS->reset = 1; /* convenient way to return to | 1265 | FDCS->reset = 1; |
1266 | * redo without to much hassle (deep | 1266 | /* |
1267 | * stack et al. */ | 1267 | * convenient way to return to |
1268 | * redo without too much hassle | ||
1269 | * (deep stack et al.) | ||
1270 | */ | ||
1268 | return; | 1271 | return; |
1269 | } | 1272 | } |
1270 | } else | 1273 | } else |
@@ -1977,8 +1980,8 @@ static void floppy_ready(void) | |||
1977 | #endif | 1980 | #endif |
1978 | if (!(raw_cmd->flags & FD_RAW_NO_MOTOR) && | 1981 | if (!(raw_cmd->flags & FD_RAW_NO_MOTOR) && |
1979 | disk_change(current_drive) && !DP->select_delay) | 1982 | disk_change(current_drive) && !DP->select_delay) |
1980 | twaddle(); /* this clears the dcl on certain drive/controller | 1983 | twaddle(); /* this clears the dcl on certain |
1981 | * combinations */ | 1984 | * drive/controller combinations */ |
1982 | 1985 | ||
1983 | #ifdef fd_chose_dma_mode | 1986 | #ifdef fd_chose_dma_mode |
1984 | if ((raw_cmd->flags & FD_RAW_READ) || (raw_cmd->flags & FD_RAW_WRITE)) { | 1987 | if ((raw_cmd->flags & FD_RAW_READ) || (raw_cmd->flags & FD_RAW_WRITE)) { |
@@ -2806,15 +2809,14 @@ static int make_raw_rw_request(void) | |||
2806 | ((CT(COMMAND) == FD_READ || | 2809 | ((CT(COMMAND) == FD_READ || |
2807 | (!in_sector_offset && blk_rq_sectors(current_req) >= ssize)) && | 2810 | (!in_sector_offset && blk_rq_sectors(current_req) >= ssize)) && |
2808 | max_sector > 2 * max_buffer_sectors + buffer_min && | 2811 | max_sector > 2 * max_buffer_sectors + buffer_min && |
2809 | max_size + fsector_t > 2 * max_buffer_sectors + buffer_min) | 2812 | max_size + fsector_t > 2 * max_buffer_sectors + buffer_min)) { |
2810 | /* not enough space */ | 2813 | /* not enough space */ |
2811 | ) { | ||
2812 | buffer_track = -1; | 2814 | buffer_track = -1; |
2813 | buffer_drive = current_drive; | 2815 | buffer_drive = current_drive; |
2814 | buffer_max = buffer_min = aligned_sector_t; | 2816 | buffer_max = buffer_min = aligned_sector_t; |
2815 | } | 2817 | } |
2816 | raw_cmd->kernel_data = floppy_track_buffer + | 2818 | raw_cmd->kernel_data = floppy_track_buffer + |
2817 | ((aligned_sector_t - buffer_min) << 9); | 2819 | ((aligned_sector_t - buffer_min) << 9); |
2818 | 2820 | ||
2819 | if (CT(COMMAND) == FD_WRITE) { | 2821 | if (CT(COMMAND) == FD_WRITE) { |
2820 | /* copy write buffer to track buffer. | 2822 | /* copy write buffer to track buffer. |
@@ -3171,11 +3173,12 @@ static inline int raw_cmd_copyout(int cmd, char __user *param, | |||
3171 | COPYOUT(*ptr); | 3173 | COPYOUT(*ptr); |
3172 | param += sizeof(struct floppy_raw_cmd); | 3174 | param += sizeof(struct floppy_raw_cmd); |
3173 | if ((ptr->flags & FD_RAW_READ) && ptr->buffer_length) { | 3175 | if ((ptr->flags & FD_RAW_READ) && ptr->buffer_length) { |
3174 | if (ptr->length >= 0 | 3176 | if (ptr->length >= 0 && |
3175 | && ptr->length <= ptr->buffer_length) | 3177 | ptr->length <= ptr->buffer_length) { |
3176 | ECALL(fd_copyout | 3178 | long length = ptr->buffer_length - ptr->length; |
3177 | (ptr->data, ptr->kernel_data, | 3179 | ECALL(fd_copyout(ptr->data, ptr->kernel_data, |
3178 | ptr->buffer_length - ptr->length)); | 3180 | length)); |
3181 | } | ||
3179 | } | 3182 | } |
3180 | ptr = ptr->next; | 3183 | ptr = ptr->next; |
3181 | } | 3184 | } |
@@ -3827,8 +3830,7 @@ static int check_floppy_change(struct gendisk *disk) | |||
3827 | * a disk in the drive, and whether that disk is writable. | 3830 | * a disk in the drive, and whether that disk is writable. |
3828 | */ | 3831 | */ |
3829 | 3832 | ||
3830 | static void floppy_rb0_complete(struct bio *bio, | 3833 | static void floppy_rb0_complete(struct bio *bio, int err) |
3831 | int err) | ||
3832 | { | 3834 | { |
3833 | complete((struct completion *)bio->bi_private); | 3835 | complete((struct completion *)bio->bi_private); |
3834 | } | 3836 | } |
@@ -4120,9 +4122,9 @@ static int __init floppy_setup(char *str) | |||
4120 | else | 4122 | else |
4121 | param = config_params[i].def_param; | 4123 | param = config_params[i].def_param; |
4122 | if (config_params[i].fn) | 4124 | if (config_params[i].fn) |
4123 | config_params[i]. | 4125 | config_params[i].fn(ints, param, |
4124 | fn(ints, param, | 4126 | config_params[i]. |
4125 | config_params[i].param2); | 4127 | param2); |
4126 | if (config_params[i].var) { | 4128 | if (config_params[i].var) { |
4127 | DPRINT("%s=%d\n", str, param); | 4129 | DPRINT("%s=%d\n", str, param); |
4128 | *config_params[i].var = param; | 4130 | *config_params[i].var = param; |
@@ -4180,8 +4182,8 @@ static const struct dev_pm_ops floppy_pm_ops = { | |||
4180 | 4182 | ||
4181 | static struct platform_driver floppy_driver = { | 4183 | static struct platform_driver floppy_driver = { |
4182 | .driver = { | 4184 | .driver = { |
4183 | .name = "floppy", | 4185 | .name = "floppy", |
4184 | .pm = &floppy_pm_ops, | 4186 | .pm = &floppy_pm_ops, |
4185 | }, | 4187 | }, |
4186 | }; | 4188 | }; |
4187 | 4189 | ||
@@ -4429,8 +4431,10 @@ static int floppy_request_regions(int fdc) | |||
4429 | const struct io_region *p; | 4431 | const struct io_region *p; |
4430 | 4432 | ||
4431 | for (p = io_regions; p < ARRAY_END(io_regions); p++) { | 4433 | for (p = io_regions; p < ARRAY_END(io_regions); p++) { |
4432 | if (!request_region(FDCS->address + p->offset, p->size, "floppy")) { | 4434 | if (!request_region(FDCS->address + p->offset, |
4433 | DPRINT("Floppy io-port 0x%04lx in use\n", FDCS->address + p->offset); | 4435 | p->size, "floppy")) { |
4436 | DPRINT("Floppy io-port 0x%04lx in use\n", | ||
4437 | FDCS->address + p->offset); | ||
4434 | floppy_release_allocated_regions(fdc, p); | 4438 | floppy_release_allocated_regions(fdc, p); |
4435 | return -EBUSY; | 4439 | return -EBUSY; |
4436 | } | 4440 | } |
@@ -4586,8 +4590,9 @@ static void __init parse_floppy_cfg_string(char *cfg) | |||
4586 | char *ptr; | 4590 | char *ptr; |
4587 | 4591 | ||
4588 | while (*cfg) { | 4592 | while (*cfg) { |
4589 | for (ptr = cfg; *cfg && *cfg != ' ' && *cfg != '\t'; cfg++) | 4593 | ptr = cfg; |
4590 | ; | 4594 | while (*cfg && *cfg != ' ' && *cfg != '\t') |
4595 | cfg++; | ||
4591 | if (*cfg) { | 4596 | if (*cfg) { |
4592 | *cfg = '\0'; | 4597 | *cfg = '\0'; |
4593 | cfg++; | 4598 | cfg++; |