Commit 03e0edf9 authored by Konrad Rzeszutek Wilk's avatar Konrad Rzeszutek Wilk

xen/blkback: Checkpatch.pl recommend against multiple assigments.

CHECK: multiple assignments should be avoided
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent 41ca4d38
...@@ -620,10 +620,11 @@ static int dispatch_rw_block_io(struct blkif_st *blkif, ...@@ -620,10 +620,11 @@ static int dispatch_rw_block_io(struct blkif_st *blkif,
seg[i].nsec << 9, seg[i].nsec << 9,
seg[i].buf & ~PAGE_MASK) == 0)) { seg[i].buf & ~PAGE_MASK) == 0)) {
bio = biolist[nbio++] = bio_alloc(GFP_KERNEL, nseg-i); bio = bio_alloc(GFP_KERNEL, nseg-i);
if (unlikely(bio == NULL)) if (unlikely(bio == NULL))
goto fail_put_bio; goto fail_put_bio;
biolist[nbio++] = bio;
bio->bi_bdev = preq.bdev; bio->bi_bdev = preq.bdev;
bio->bi_private = pending_req; bio->bi_private = pending_req;
bio->bi_end_io = end_block_io_op; bio->bi_end_io = end_block_io_op;
...@@ -636,10 +637,12 @@ static int dispatch_rw_block_io(struct blkif_st *blkif, ...@@ -636,10 +637,12 @@ static int dispatch_rw_block_io(struct blkif_st *blkif,
/* This will be hit if the operation was a flush. */ /* This will be hit if the operation was a flush. */
if (!bio) { if (!bio) {
BUG_ON(operation != WRITE_FLUSH); BUG_ON(operation != WRITE_FLUSH);
bio = biolist[nbio++] = bio_alloc(GFP_KERNEL, 0);
bio = bio_alloc(GFP_KERNEL, 0);
if (unlikely(bio == NULL)) if (unlikely(bio == NULL))
goto fail_put_bio; goto fail_put_bio;
biolist[nbio++] = bio;
bio->bi_bdev = preq.bdev; bio->bi_bdev = preq.bdev;
bio->bi_private = pending_req; bio->bi_private = pending_req;
bio->bi_end_io = end_block_io_op; bio->bi_end_io = end_block_io_op;
...@@ -677,7 +680,7 @@ static int dispatch_rw_block_io(struct blkif_st *blkif, ...@@ -677,7 +680,7 @@ static int dispatch_rw_block_io(struct blkif_st *blkif,
return -EIO; return -EIO;
fail_put_bio: fail_put_bio:
for (i = 0; i < (nbio-1); i++) for (i = 0; i < nbio; i++)
bio_put(biolist[i]); bio_put(biolist[i]);
__end_block_io_op(pending_req, -EINVAL); __end_block_io_op(pending_req, -EINVAL);
msleep(1); /* back off a bit */ msleep(1); /* back off a bit */
......
...@@ -538,7 +538,8 @@ static void backend_changed(struct xenbus_watch *watch, ...@@ -538,7 +538,8 @@ static void backend_changed(struct xenbus_watch *watch,
err = vbd_create(be->blkif, handle, major, minor, err = vbd_create(be->blkif, handle, major, minor,
(NULL == strchr(be->mode, 'w')), cdrom); (NULL == strchr(be->mode, 'w')), cdrom);
if (err) { if (err) {
be->major = be->minor = 0; be->major = 0;
be->minor = 0;
xenbus_dev_fatal(dev, err, "creating vbd structure"); xenbus_dev_fatal(dev, err, "creating vbd structure");
return; return;
} }
...@@ -546,7 +547,8 @@ static void backend_changed(struct xenbus_watch *watch, ...@@ -546,7 +547,8 @@ static void backend_changed(struct xenbus_watch *watch,
err = xenvbd_sysfs_addif(dev); err = xenvbd_sysfs_addif(dev);
if (err) { if (err) {
vbd_free(&be->blkif->vbd); vbd_free(&be->blkif->vbd);
be->major = be->minor = 0; be->major = 0;
be->minor = 0;
xenbus_dev_fatal(dev, err, "creating sysfs entries"); xenbus_dev_fatal(dev, err, "creating sysfs entries");
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment