Skip to contentSkip to conversation

md: style/readability cleanups

PATCH New Calvin Owens 1 participant 1 message Jul 22, 2011 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 md: style/readability cleanups

This patch fixes some lingering CodingStyle issues in the md subsystem.

---
 drivers/md/raid0.c  |   30 +++++------
 drivers/md/raid1.c  |   96 +++++++++++++++++------------------
 drivers/md/raid10.c |  108 +++++++++++++++++++-------------------
 drivers/md/raid5.c  |  142 +++++++++++++++++++++++++++------------------------
 4 files changed, 190 insertions(+), 186 deletions(-)
drivers/md/raid0.c +14 -16
index e86bf36..9d2fbc9 100644
@@ -103,10 +103,10 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf)
 		list_for_each_entry(rdev2, &mddev->disks, same_set) {
 			printk(KERN_INFO "md/raid0:%s:   comparing %s(%llu)",
 			       mdname(mddev),
-			       bdevname(rdev1->bdev,b),
+			       bdevname(rdev1->bdev, b),
 			       (unsigned long long)rdev1->sectors);
 			printk(KERN_CONT " with %s(%llu)\n",
-			       bdevname(rdev2->bdev,b),
+			       bdevname(rdev2->bdev, b),
 			       (unsigned long long)rdev2->sectors);
 			if (rdev2 == rdev1) {
 				printk(KERN_INFO "md/raid0:%s:   END\n",
@@ -137,12 +137,11 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf)
 	printk(KERN_INFO "md/raid0:%s: FINAL %d zones\n",
 	       mdname(mddev), conf->nr_strip_zones);
 	err = -ENOMEM;
-	conf->strip_zone = kzalloc(sizeof(struct strip_zone)*
-				conf->nr_strip_zones, GFP_KERNEL);
+	conf->strip_zone = kzalloc(sizeof(struct strip_zone) * conf->nr_strip_zones,
+				GFP_KERNEL);
 	if (!conf->strip_zone)
 		goto abort;
-	conf->devlist = kzalloc(sizeof(mdk_rdev_t*)*
-				conf->nr_strip_zones*mddev->raid_disks,
+	conf->devlist = kzalloc(sizeof(mdk_rdev_t *) * conf->nr_strip_zones * mddev->raid_disks,
 				GFP_KERNEL);
 	if (!conf->devlist)
 		goto abort;
@@ -224,7 +223,7 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf)
 		smallest = NULL;
 		c = 0;
 
-		for (j=0; j<cnt; j++) {
+		for (j = 0; j < cnt; j++) {
 			rdev = conf->devlist[j];
 			printk(KERN_INFO "md/raid0:%s: checking %s ...",
 			       mdname(mddev),
@@ -311,10 +310,11 @@ static int raid0_mergeable_bvec(struct request_queue *q,
 	else
 		max =  (chunk_sectors - (sector_div(sector, chunk_sectors)
 						+ bio_sectors)) << 9;
-	if (max < 0) max = 0; /* bio_add cannot handle a negative return */
+	if (max < 0)
+		max = 0; /* bio_add cannot handle a negative return */
 	if (max <= biovec->bv_len && bio_sectors == 0)
 		return biovec->bv_len;
-	else 
+	else
 		return max;
 }
 
@@ -371,10 +371,9 @@ static int raid0_run(mddev_t *mddev)
 	 * chunksize should be used in that case.
 	 */
 	{
-		int stripe = mddev->raid_disks *
-			(mddev->chunk_sectors << 9) / PAGE_SIZE;
-		if (mddev->queue->backing_dev_info.ra_pages < 2* stripe)
-			mddev->queue->backing_dev_info.ra_pages = 2* stripe;
+		int stripe = mddev->raid_disks * (mddev->chunk_sectors << 9) / PAGE_SIZE;
+		if (mddev->queue->backing_dev_info.ra_pages < 2 * stripe)
+			mddev->queue->backing_dev_info.ra_pages = 2 * stripe;
 	}
 
 	blk_queue_merge_bvec(mddev->queue, raid0_mergeable_bvec);
@@ -624,7 +623,7 @@ static void *raid0_takeover_raid10(mddev_t *mddev)
 	mddev->new_level = 0;
 	mddev->new_layout = 0;
 	mddev->new_chunk_sectors = mddev->chunk_sectors;
-	mddev->delta_disks = - mddev->raid_disks / 2;
+	mddev->delta_disks = -mddev->raid_disks / 2;
 	mddev->raid_disks += mddev->delta_disks;
 	mddev->degraded = 0;
 	/* make sure it will be not marked as dirty */
@@ -695,8 +694,7 @@ static void raid0_quiesce(mddev_t *mddev, int state)
 {
 }
 
-static struct mdk_personality raid0_personality=
-{
+static struct mdk_personality raid0_personality = {
 	.name		= "raid0",
 	.level		= 0,
 	.owner		= THIS_MODULE,
drivers/md/raid1.c +47 -49

340 lines not on this page · raw message

drivers/md/raid10.c +54 -54

386 lines not on this page · raw message

drivers/md/raid5.c +75 -67

462 lines not on this page · raw message

Signature · 1 line
1.7.4.1