From 7f4d5e374cbbc594d76c75b23a7694a267062ea5 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Wed, 10 Mar 2010 15:20:50 -0800 Subject: [PATCH] --- yaml --- r: 187127 b: refs/heads/master c: bb57f0c662faa9879e8f265c9bc1f15bb238d2c7 h: refs/heads/master i: 187125: fcd0de3425f5876b79df06b9521e455f284a6cc3 187123: 46151504545492a61dc8fab0ce2905da0f2fe017 187119: 5bac354647a53812c5ebb7e78a3f43e191ebcac1 v: v3 --- [refs] | 2 +- trunk/drivers/block/floppy.c | 55 ++++++++++++++++++++---------------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/[refs] b/[refs] index eb003d021bfe..9b160e8ddb71 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2300f90e31178f44b0e903c12ea311df1297d7fa +refs/heads/master: bb57f0c662faa9879e8f265c9bc1f15bb238d2c7 diff --git a/trunk/drivers/block/floppy.c b/trunk/drivers/block/floppy.c index 7c0c7d09e089..48aefd9c5662 100644 --- a/trunk/drivers/block/floppy.c +++ b/trunk/drivers/block/floppy.c @@ -1262,9 +1262,12 @@ static inline void perpendicular_mode(void) default: DPRINT("Invalid data rate for perpendicular mode!\n"); cont->done(0); - FDCS->reset = 1; /* convenient way to return to - * redo without to much hassle (deep - * stack et al. */ + FDCS->reset = 1; + /* + * convenient way to return to + * redo without too much hassle + * (deep stack et al.) + */ return; } } else @@ -1977,8 +1980,8 @@ static void floppy_ready(void) #endif if (!(raw_cmd->flags & FD_RAW_NO_MOTOR) && disk_change(current_drive) && !DP->select_delay) - twaddle(); /* this clears the dcl on certain drive/controller - * combinations */ + twaddle(); /* this clears the dcl on certain + * drive/controller combinations */ #ifdef fd_chose_dma_mode 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 || (!in_sector_offset && blk_rq_sectors(current_req) >= ssize)) && max_sector > 2 * max_buffer_sectors + buffer_min && - max_size + fsector_t > 2 * max_buffer_sectors + buffer_min) - /* not enough space */ - ) { + max_size + fsector_t > 2 * max_buffer_sectors + buffer_min)) { + /* not enough space */ buffer_track = -1; buffer_drive = current_drive; buffer_max = buffer_min = aligned_sector_t; } raw_cmd->kernel_data = floppy_track_buffer + - ((aligned_sector_t - buffer_min) << 9); + ((aligned_sector_t - buffer_min) << 9); if (CT(COMMAND) == FD_WRITE) { /* copy write buffer to track buffer. @@ -3171,11 +3173,12 @@ static inline int raw_cmd_copyout(int cmd, char __user *param, COPYOUT(*ptr); param += sizeof(struct floppy_raw_cmd); if ((ptr->flags & FD_RAW_READ) && ptr->buffer_length) { - if (ptr->length >= 0 - && ptr->length <= ptr->buffer_length) - ECALL(fd_copyout - (ptr->data, ptr->kernel_data, - ptr->buffer_length - ptr->length)); + if (ptr->length >= 0 && + ptr->length <= ptr->buffer_length) { + long length = ptr->buffer_length - ptr->length; + ECALL(fd_copyout(ptr->data, ptr->kernel_data, + length)); + } } 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. */ -static void floppy_rb0_complete(struct bio *bio, - int err) +static void floppy_rb0_complete(struct bio *bio, int err) { complete((struct completion *)bio->bi_private); } @@ -4120,9 +4122,9 @@ static int __init floppy_setup(char *str) else param = config_params[i].def_param; if (config_params[i].fn) - config_params[i]. - fn(ints, param, - config_params[i].param2); + config_params[i].fn(ints, param, + config_params[i]. + param2); if (config_params[i].var) { DPRINT("%s=%d\n", str, 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 = { .driver = { - .name = "floppy", - .pm = &floppy_pm_ops, + .name = "floppy", + .pm = &floppy_pm_ops, }, }; @@ -4429,8 +4431,10 @@ static int floppy_request_regions(int fdc) const struct io_region *p; for (p = io_regions; p < ARRAY_END(io_regions); p++) { - if (!request_region(FDCS->address + p->offset, p->size, "floppy")) { - DPRINT("Floppy io-port 0x%04lx in use\n", FDCS->address + p->offset); + if (!request_region(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); return -EBUSY; } @@ -4586,8 +4590,9 @@ static void __init parse_floppy_cfg_string(char *cfg) char *ptr; while (*cfg) { - for (ptr = cfg; *cfg && *cfg != ' ' && *cfg != '\t'; cfg++) - ; + ptr = cfg; + while (*cfg && *cfg != ' ' && *cfg != '\t') + cfg++; if (*cfg) { *cfg = '\0'; cfg++;