[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH 4/7] qemu-img: delete not used variable and an unece
From: |
Reda Sallahi |
Subject: |
[Qemu-block] [PATCH 4/7] qemu-img: delete not used variable and an unecessary check |
Date: |
Mon, 22 Aug 2016 09:55:14 +0200 |
block_count is not used in img_dd() and the C_SKIP check is unecessary so
this patch removes both of them.
Signed-off-by: Reda Sallahi <address@hidden>
---
qemu-img.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index ae3828e..cf78dfe 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -4093,7 +4093,7 @@ static int img_dd(int argc, char **argv)
const char *out_fmt = "raw";
const char *fmt = NULL;
int64_t size = 0, out_size = 0;
- int64_t block_count = 0, out_pos, in_pos, sparse_count = 0;
+ int64_t out_pos, in_pos, sparse_count = 0;
bool writethrough = false;
int flags = 0;
int ibsz = 0, obsz = 0, bsz;
@@ -4373,8 +4373,7 @@ static int img_dd(int argc, char **argv)
}
}
- if (dd.flags & C_SKIP && (in.offset > INT64_MAX / ibsz ||
- size < in.offset * ibsz)) {
+ if (in.offset > INT64_MAX / ibsz || size < in.offset * ibsz) {
/* We give a warning if the skip option is bigger than the input
* size and create an empty output disk image (i.e. like dd(1)).
*/
@@ -4386,7 +4385,7 @@ static int img_dd(int argc, char **argv)
in.buf = g_new(uint8_t, in.bsz);
- for (out_pos = out.offset * obsz; in_pos < size; block_count++) {
+ for (out_pos = out.offset * obsz; in_pos < size;) {
int in_ret, out_ret;
bsz = in.bsz;
--
2.9.3
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/7] qemu-img: add more conv= conversions to dd, (continued)
[Qemu-block] [PATCH 7/7] qemu-img: add a test suite for the count option, Reda Sallahi, 2016/08/22
[Qemu-block] [PATCH 6/7] qemu-img: clean up dd documentation, Reda Sallahi, 2016/08/22
[Qemu-block] [PATCH 5/7] qemu-img: add status option to dd, Reda Sallahi, 2016/08/22
[Qemu-block] [PATCH 4/7] qemu-img: delete not used variable and an unecessary check,
Reda Sallahi <=