From 2aa37cedf09e21848e175c6ac381c0bc623f2de3 Mon Sep 17 00:00:00 2001 From: Krzysztof Mazur Date: Sat, 4 Feb 2012 09:39:54 +0100 Subject: [PATCH 60/84] lsbs: cleanup braces Signed-off-by: Krzysztof Mazur --- drivers/block/lsbd.c | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/drivers/block/lsbd.c b/drivers/block/lsbd.c index 09dd175..1b65007 100644 --- a/drivers/block/lsbd.c +++ b/drivers/block/lsbd.c @@ -1456,11 +1456,9 @@ static int lsbd_ioctl(struct inode *inode, struct file *file, { struct lsbd_part_info part; - if (copy_from_user(&part, (void *) arg, sizeof(part))) { - err = -EFAULT; - } else { + err = -EFAULT; + if (!copy_from_user(&part, (void *) arg, sizeof(part))) err = lsbd_partition(p, &part); - } break; } case BLKGETSIZE: @@ -1769,11 +1767,10 @@ static int lsbd_make_write(struct lsbd *p, struct buffer_head *bh) if (current->rt_priority) queue = LSBD_QUEUE_HIGH; - if (lsbd_queue_bh(p, bh, lsector, queue)) { + if (lsbd_queue_bh(p, bh, lsector, queue)) buffer_IO_error(bh); - } else { + else p->sectors_written++; - } return 0; } @@ -2253,9 +2250,8 @@ static int lsbd_write_block(struct lsbd *p) if (wbh[i] != NULL) wbh[i]->b_end_io(wbh[i], 1); - if (!ok) { + if (!ok) p->write_errors++; - } } lsbd_debug(p, "done\n"); kfree(wbh); @@ -2388,17 +2384,15 @@ static void *lsbd_seq_start(struct seq_file *seq, loff_t *pos) return NULL; if (!l--) - /* header */ - return (void *)1; + return (void *) 1; /* header */ for (i = 0; i < LSBD_MAX; i++) { - if (!l--) { + if (!l--) return &lsbd_dev[i]; - } } if (!l--) - return (void *)2;/* tail */ + return (void *) 2; /* tail */ return NULL; } @@ -2409,18 +2403,18 @@ static void *lsbd_seq_next(struct seq_file *seq, void *v, loff_t *pos) void *next; ++*pos; - if (v == (void *)2) + if (v == (void *) 2) return NULL; - if (v == (void *)1) + if (v == (void *) 1) tmp = &lsbd_dev[0]; else tmp = p + 1; - if (tmp != &lsbd_dev[LSBD_MAX]) + if (tmp != &lsbd_dev[LSBD_MAX]) { next = tmp; - else { - next = (void *)2; + } else { + next = (void *) 2; *pos = 0x10000; } @@ -2435,13 +2429,12 @@ static int lsbd_seq_show(struct seq_file *seq, void *v) { struct lsbd *p = v; - if (v == (void *)1) { + if (v == (void *) 1) { seq_printf(seq, "LSBD 0.0\n\n"); return 0; } - if (v == (void *)2) { + if (v == (void *) 2) return 0; - } if (p->tsk == NULL) return 0; -- 1.8.4.652.g0d6e0ce