diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-05-12 16:19:23 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-05-12 17:55:47 -0400 |
commit | 03e0edf946a08f498788bb6e8ab58453d98f25b9 (patch) | |
tree | c2e849aa122c4428be3b4faaeb416dafb9376e11 /drivers/block/xen-blkback | |
parent | 41ca4d388560d2048c7b64ff5ca7dc3bac0d0812 (diff) |
xen/blkback: Checkpatch.pl recommend against multiple assigments.
CHECK: multiple assignments should be avoided
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/block/xen-blkback')
-rw-r--r-- | drivers/block/xen-blkback/blkback.c | 9 | ||||
-rw-r--r-- | drivers/block/xen-blkback/xenbus.c | 6 |
2 files changed, 10 insertions, 5 deletions
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index 453b51ac737f..362fbf6f656d 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c | |||
@@ -620,10 +620,11 @@ static int dispatch_rw_block_io(struct blkif_st *blkif, | |||
620 | seg[i].nsec << 9, | 620 | seg[i].nsec << 9, |
621 | seg[i].buf & ~PAGE_MASK) == 0)) { | 621 | seg[i].buf & ~PAGE_MASK) == 0)) { |
622 | 622 | ||
623 | bio = biolist[nbio++] = bio_alloc(GFP_KERNEL, nseg-i); | 623 | bio = bio_alloc(GFP_KERNEL, nseg-i); |
624 | if (unlikely(bio == NULL)) | 624 | if (unlikely(bio == NULL)) |
625 | goto fail_put_bio; | 625 | goto fail_put_bio; |
626 | 626 | ||
627 | biolist[nbio++] = bio; | ||
627 | bio->bi_bdev = preq.bdev; | 628 | bio->bi_bdev = preq.bdev; |
628 | bio->bi_private = pending_req; | 629 | bio->bi_private = pending_req; |
629 | bio->bi_end_io = end_block_io_op; | 630 | bio->bi_end_io = end_block_io_op; |
@@ -636,10 +637,12 @@ static int dispatch_rw_block_io(struct blkif_st *blkif, | |||
636 | /* This will be hit if the operation was a flush. */ | 637 | /* This will be hit if the operation was a flush. */ |
637 | if (!bio) { | 638 | if (!bio) { |
638 | BUG_ON(operation != WRITE_FLUSH); | 639 | BUG_ON(operation != WRITE_FLUSH); |
639 | bio = biolist[nbio++] = bio_alloc(GFP_KERNEL, 0); | 640 | |
641 | bio = bio_alloc(GFP_KERNEL, 0); | ||
640 | if (unlikely(bio == NULL)) | 642 | if (unlikely(bio == NULL)) |
641 | goto fail_put_bio; | 643 | goto fail_put_bio; |
642 | 644 | ||
645 | biolist[nbio++] = bio; | ||
643 | bio->bi_bdev = preq.bdev; | 646 | bio->bi_bdev = preq.bdev; |
644 | bio->bi_private = pending_req; | 647 | bio->bi_private = pending_req; |
645 | bio->bi_end_io = end_block_io_op; | 648 | bio->bi_end_io = end_block_io_op; |
@@ -677,7 +680,7 @@ static int dispatch_rw_block_io(struct blkif_st *blkif, | |||
677 | return -EIO; | 680 | return -EIO; |
678 | 681 | ||
679 | fail_put_bio: | 682 | fail_put_bio: |
680 | for (i = 0; i < (nbio-1); i++) | 683 | for (i = 0; i < nbio; i++) |
681 | bio_put(biolist[i]); | 684 | bio_put(biolist[i]); |
682 | __end_block_io_op(pending_req, -EINVAL); | 685 | __end_block_io_op(pending_req, -EINVAL); |
683 | msleep(1); /* back off a bit */ | 686 | msleep(1); /* back off a bit */ |
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c index 5d2bbf6240c8..ba8d30662d19 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c | |||
@@ -538,7 +538,8 @@ static void backend_changed(struct xenbus_watch *watch, | |||
538 | err = vbd_create(be->blkif, handle, major, minor, | 538 | err = vbd_create(be->blkif, handle, major, minor, |
539 | (NULL == strchr(be->mode, 'w')), cdrom); | 539 | (NULL == strchr(be->mode, 'w')), cdrom); |
540 | if (err) { | 540 | if (err) { |
541 | be->major = be->minor = 0; | 541 | be->major = 0; |
542 | be->minor = 0; | ||
542 | xenbus_dev_fatal(dev, err, "creating vbd structure"); | 543 | xenbus_dev_fatal(dev, err, "creating vbd structure"); |
543 | return; | 544 | return; |
544 | } | 545 | } |
@@ -546,7 +547,8 @@ static void backend_changed(struct xenbus_watch *watch, | |||
546 | err = xenvbd_sysfs_addif(dev); | 547 | err = xenvbd_sysfs_addif(dev); |
547 | if (err) { | 548 | if (err) { |
548 | vbd_free(&be->blkif->vbd); | 549 | vbd_free(&be->blkif->vbd); |
549 | be->major = be->minor = 0; | 550 | be->major = 0; |
551 | be->minor = 0; | ||
550 | xenbus_dev_fatal(dev, err, "creating sysfs entries"); | 552 | xenbus_dev_fatal(dev, err, "creating sysfs entries"); |
551 | return; | 553 | return; |
552 | } | 554 | } |