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>
This commit is contained in:
Joe Perches 2010-03-10 15:20:50 -08:00 committed by Linus Torvalds
parent 2300f90e31
commit bb57f0c662
1 changed files with 30 additions and 25 deletions

View File

@ -1262,9 +1262,12 @@ static inline void perpendicular_mode(void)
default: default:
DPRINT("Invalid data rate for perpendicular mode!\n"); DPRINT("Invalid data rate for perpendicular mode!\n");
cont->done(0); cont->done(0);
FDCS->reset = 1; /* convenient way to return to FDCS->reset = 1;
* redo without to much hassle (deep /*
* stack et al. */ * convenient way to return to
* redo without too much hassle
* (deep stack et al.)
*/
return; return;
} }
} else } else
@ -1977,8 +1980,8 @@ static void floppy_ready(void)
#endif #endif
if (!(raw_cmd->flags & FD_RAW_NO_MOTOR) && if (!(raw_cmd->flags & FD_RAW_NO_MOTOR) &&
disk_change(current_drive) && !DP->select_delay) disk_change(current_drive) && !DP->select_delay)
twaddle(); /* this clears the dcl on certain drive/controller twaddle(); /* this clears the dcl on certain
* combinations */ * drive/controller combinations */
#ifdef fd_chose_dma_mode #ifdef fd_chose_dma_mode
if ((raw_cmd->flags & FD_RAW_READ) || (raw_cmd->flags & FD_RAW_WRITE)) { if ((raw_cmd->flags & FD_RAW_READ) || (raw_cmd->flags & FD_RAW_WRITE)) {
@ -2806,15 +2809,14 @@ static int make_raw_rw_request(void)
((CT(COMMAND) == FD_READ || ((CT(COMMAND) == FD_READ ||
(!in_sector_offset && blk_rq_sectors(current_req) >= ssize)) && (!in_sector_offset && blk_rq_sectors(current_req) >= ssize)) &&
max_sector > 2 * max_buffer_sectors + buffer_min && max_sector > 2 * max_buffer_sectors + buffer_min &&
max_size + fsector_t > 2 * max_buffer_sectors + buffer_min) max_size + fsector_t > 2 * max_buffer_sectors + buffer_min)) {
/* not enough space */ /* not enough space */
) {
buffer_track = -1; buffer_track = -1;
buffer_drive = current_drive; buffer_drive = current_drive;
buffer_max = buffer_min = aligned_sector_t; buffer_max = buffer_min = aligned_sector_t;
} }
raw_cmd->kernel_data = floppy_track_buffer + raw_cmd->kernel_data = floppy_track_buffer +
((aligned_sector_t - buffer_min) << 9); ((aligned_sector_t - buffer_min) << 9);
if (CT(COMMAND) == FD_WRITE) { if (CT(COMMAND) == FD_WRITE) {
/* copy write buffer to track buffer. /* copy write buffer to track buffer.
@ -3171,11 +3173,12 @@ static inline int raw_cmd_copyout(int cmd, char __user *param,
COPYOUT(*ptr); COPYOUT(*ptr);
param += sizeof(struct floppy_raw_cmd); param += sizeof(struct floppy_raw_cmd);
if ((ptr->flags & FD_RAW_READ) && ptr->buffer_length) { if ((ptr->flags & FD_RAW_READ) && ptr->buffer_length) {
if (ptr->length >= 0 if (ptr->length >= 0 &&
&& ptr->length <= ptr->buffer_length) ptr->length <= ptr->buffer_length) {
ECALL(fd_copyout long length = ptr->buffer_length - ptr->length;
(ptr->data, ptr->kernel_data, ECALL(fd_copyout(ptr->data, ptr->kernel_data,
ptr->buffer_length - ptr->length)); length));
}
} }
ptr = ptr->next; ptr = ptr->next;
} }
@ -3827,8 +3830,7 @@ static int check_floppy_change(struct gendisk *disk)
* a disk in the drive, and whether that disk is writable. * a disk in the drive, and whether that disk is writable.
*/ */
static void floppy_rb0_complete(struct bio *bio, static void floppy_rb0_complete(struct bio *bio, int err)
int err)
{ {
complete((struct completion *)bio->bi_private); complete((struct completion *)bio->bi_private);
} }
@ -4120,9 +4122,9 @@ static int __init floppy_setup(char *str)
else else
param = config_params[i].def_param; param = config_params[i].def_param;
if (config_params[i].fn) if (config_params[i].fn)
config_params[i]. config_params[i].fn(ints, param,
fn(ints, param, config_params[i].
config_params[i].param2); param2);
if (config_params[i].var) { if (config_params[i].var) {
DPRINT("%s=%d\n", str, param); DPRINT("%s=%d\n", str, param);
*config_params[i].var = param; *config_params[i].var = param;
@ -4180,8 +4182,8 @@ static const struct dev_pm_ops floppy_pm_ops = {
static struct platform_driver floppy_driver = { static struct platform_driver floppy_driver = {
.driver = { .driver = {
.name = "floppy", .name = "floppy",
.pm = &floppy_pm_ops, .pm = &floppy_pm_ops,
}, },
}; };
@ -4429,8 +4431,10 @@ static int floppy_request_regions(int fdc)
const struct io_region *p; const struct io_region *p;
for (p = io_regions; p < ARRAY_END(io_regions); p++) { for (p = io_regions; p < ARRAY_END(io_regions); p++) {
if (!request_region(FDCS->address + p->offset, p->size, "floppy")) { if (!request_region(FDCS->address + p->offset,
DPRINT("Floppy io-port 0x%04lx in use\n", FDCS->address + p->offset); p->size, "floppy")) {
DPRINT("Floppy io-port 0x%04lx in use\n",
FDCS->address + p->offset);
floppy_release_allocated_regions(fdc, p); floppy_release_allocated_regions(fdc, p);
return -EBUSY; return -EBUSY;
} }
@ -4586,8 +4590,9 @@ static void __init parse_floppy_cfg_string(char *cfg)
char *ptr; char *ptr;
while (*cfg) { while (*cfg) {
for (ptr = cfg; *cfg && *cfg != ' ' && *cfg != '\t'; cfg++) ptr = cfg;
; while (*cfg && *cfg != ' ' && *cfg != '\t')
cfg++;
if (*cfg) { if (*cfg) {
*cfg = '\0'; *cfg = '\0';
cfg++; cfg++;