[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 02/16] block: Remove unused masks
From: |
Max Reitz |
Subject: |
[Qemu-block] [PULL 02/16] block: Remove unused masks |
Date: |
Mon, 16 Sep 2019 16:22:32 +0200 |
From: Nir Soffer <address@hidden>
Replace confusing usage:
~BDRV_SECTOR_MASK
With more clear:
(BDRV_SECTOR_SIZE - 1)
Remove BDRV_SECTOR_MASK and the unused BDRV_BLOCK_OFFSET_MASK which was
it's last user.
Signed-off-by: Nir Soffer <address@hidden>
Message-id: address@hidden
Reviewed-by: Juan Quintela <address@hidden>
Reviewed-by: John Snow <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
include/block/block.h | 2 --
migration/block.c | 2 +-
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/block/block.h b/include/block/block.h
index 124ad40809..37c9de7446 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -143,7 +143,6 @@ typedef struct HDGeometry {
#define BDRV_SECTOR_BITS 9
#define BDRV_SECTOR_SIZE (1ULL << BDRV_SECTOR_BITS)
-#define BDRV_SECTOR_MASK ~(BDRV_SECTOR_SIZE - 1)
#define BDRV_REQUEST_MAX_SECTORS MIN(SIZE_MAX >> BDRV_SECTOR_BITS, \
INT_MAX >> BDRV_SECTOR_BITS)
@@ -195,7 +194,6 @@ typedef struct HDGeometry {
#define BDRV_BLOCK_ALLOCATED 0x10
#define BDRV_BLOCK_EOF 0x20
#define BDRV_BLOCK_RECURSE 0x40
-#define BDRV_BLOCK_OFFSET_MASK BDRV_SECTOR_MASK
typedef QSIMPLEQ_HEAD(BlockReopenQueue, BlockReopenQueueEntry)
BlockReopenQueue;
diff --git a/migration/block.c b/migration/block.c
index 0de9d84198..8e49382070 100644
--- a/migration/block.c
+++ b/migration/block.c
@@ -906,7 +906,7 @@ static int block_load(QEMUFile *f, void *opaque, int
version_id)
do {
addr = qemu_get_be64(f);
- flags = addr & ~BDRV_SECTOR_MASK;
+ flags = addr & (BDRV_SECTOR_SIZE - 1);
addr >>= BDRV_SECTOR_BITS;
if (flags & BLK_MIG_FLAG_DEVICE_BLOCK) {
--
2.21.0
- [Qemu-block] [PULL 00/16] Block patches, Max Reitz, 2019/09/16
- [Qemu-block] [PULL 01/16] block: Use QEMU_IS_ALIGNED, Max Reitz, 2019/09/16
- [Qemu-block] [PULL 02/16] block: Remove unused masks,
Max Reitz <=
- [Qemu-block] [PULL 03/16] tests/qemu-iotests/check: Replace "tests" with "iotests" in final status text, Max Reitz, 2019/09/16
- [Qemu-block] [PULL 04/16] tests/Makefile: Do not print the name of the check-block.sh shell script, Max Reitz, 2019/09/16
- [Qemu-block] [PULL 06/16] curl: Keep pointer to the CURLState in CURLSocket, Max Reitz, 2019/09/16
- [Qemu-block] [PULL 05/16] tests/qemu-iotests: Fix qemu-io related output in 026.out.nocache, Max Reitz, 2019/09/16
- [Qemu-block] [PULL 07/16] curl: Keep *socket until the end of curl_sock_cb(), Max Reitz, 2019/09/16
- [Qemu-block] [PULL 08/16] curl: Check completion in curl_multi_do(), Max Reitz, 2019/09/16
- [Qemu-block] [PULL 09/16] curl: Pass CURLSocket to curl_multi_do(), Max Reitz, 2019/09/16
- [Qemu-block] [PULL 10/16] curl: Report only ready sockets, Max Reitz, 2019/09/16
- [Qemu-block] [PULL 11/16] curl: Handle success in multi_check_completion, Max Reitz, 2019/09/16
- [Qemu-block] [PULL 12/16] curl: Check curl_multi_add_handle()'s return code, Max Reitz, 2019/09/16