[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 16/16] block/cloop: use PRIu32 format specifier for u
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 16/16] block/cloop: use PRIu32 format specifier for uint32_t |
Date: |
Wed, 23 Apr 2014 12:04:51 +0200 |
From: Stefan Hajnoczi <address@hidden>
PRIu32 is the format string specifier for uint32_t, let's use it.
Variables ->block_size, ->n_blocks, and i are all uint32_t.
Suggested-by: Max Reitz <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/cloop.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/block/cloop.c b/block/cloop.c
index b6ad50f..8457737 100644
--- a/block/cloop.c
+++ b/block/cloop.c
@@ -72,7 +72,7 @@ static int cloop_open(BlockDriverState *bs, QDict *options,
int flags,
}
s->block_size = be32_to_cpu(s->block_size);
if (s->block_size % 512) {
- error_setg(errp, "block_size %u must be a multiple of 512",
+ error_setg(errp, "block_size %" PRIu32 " must be a multiple of 512",
s->block_size);
return -EINVAL;
}
@@ -86,7 +86,7 @@ static int cloop_open(BlockDriverState *bs, QDict *options,
int flags,
* need a buffer this big.
*/
if (s->block_size > MAX_BLOCK_SIZE) {
- error_setg(errp, "block_size %u must be %u MB or less",
+ error_setg(errp, "block_size %" PRIu32 " must be %u MB or less",
s->block_size,
MAX_BLOCK_SIZE / (1024 * 1024));
return -EINVAL;
@@ -101,7 +101,7 @@ static int cloop_open(BlockDriverState *bs, QDict *options,
int flags,
/* read offsets */
if (s->n_blocks > (UINT32_MAX - 1) / sizeof(uint64_t)) {
/* Prevent integer overflow */
- error_setg(errp, "n_blocks %u must be %zu or less",
+ error_setg(errp, "n_blocks %" PRIu32 " must be %zu or less",
s->n_blocks,
(UINT32_MAX - 1) / sizeof(uint64_t));
return -EINVAL;
@@ -133,7 +133,7 @@ static int cloop_open(BlockDriverState *bs, QDict *options,
int flags,
if (s->offsets[i] < s->offsets[i - 1]) {
error_setg(errp, "offsets not monotonically increasing at "
- "index %u, image file is corrupt", i);
+ "index %" PRIu32 ", image file is corrupt", i);
ret = -EINVAL;
goto fail;
}
@@ -146,8 +146,8 @@ static int cloop_open(BlockDriverState *bs, QDict *options,
int flags,
* ridiculous s->compressed_block allocation.
*/
if (size > 2 * MAX_BLOCK_SIZE) {
- error_setg(errp, "invalid compressed block size at index %u, "
- "image file is corrupt", i);
+ error_setg(errp, "invalid compressed block size at index %" PRIu32
+ ", image file is corrupt", i);
ret = -EINVAL;
goto fail;
}
--
1.8.3.1
- [Qemu-devel] [PULL 01/16] block: Fix nb_sectors check in bdrv_check_byte_request(), (continued)
- [Qemu-devel] [PULL 01/16] block: Fix nb_sectors check in bdrv_check_byte_request(), Kevin Wolf, 2014/04/23
- [Qemu-devel] [PULL 07/16] curl: Replaced old error handling with error reporting API., Kevin Wolf, 2014/04/23
- [Qemu-devel] [PULL 11/16] qemu-img: Avoid duplicate block device IDs, Kevin Wolf, 2014/04/23
- [Qemu-devel] [PULL 13/16] qemu-iotests: Check common namespace for id and node-name, Kevin Wolf, 2014/04/23
- [Qemu-devel] [PULL 10/16] block: Add errp to bdrv_new(), Kevin Wolf, 2014/04/23
- [Qemu-devel] [PULL 12/16] block: Catch duplicate IDs in bdrv_new(), Kevin Wolf, 2014/04/23
- [Qemu-devel] [PULL 14/16] qemu-img: Improve error messages, Kevin Wolf, 2014/04/23
- [Qemu-devel] [PULL 09/16] convert fprintf() calls to error_setg() in block/qed.c:bdrv_qed_create(), Kevin Wolf, 2014/04/23
- [Qemu-devel] [PULL 08/16] block: Remove -errno return value from bdrv_assign_node_name, Kevin Wolf, 2014/04/23
- [Qemu-devel] [PULL 15/16] vmdk: Fix "%x" to PRIx32 in format strings for cid, Kevin Wolf, 2014/04/23
- [Qemu-devel] [PULL 16/16] block/cloop: use PRIu32 format specifier for uint32_t,
Kevin Wolf <=
- [Qemu-devel] [PULL 06/16] block: Handle error of bdrv_getlength in bdrv_create_dirty_bitmap, Kevin Wolf, 2014/04/23
- Re: [Qemu-devel] [PULL 00/16] Block patches, Peter Maydell, 2014/04/25