Patchwork [08/14] block.h: Make BDRV_SECTOR_SIZE 64 bit safe

login
register
mail settings
Submitter Kevin Wolf
Date May 28, 2010, 4:46 p.m.
Message ID <1275065173-24045-9-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/53918/
State New
Headers show

Comments

Kevin Wolf - May 28, 2010, 4:46 p.m.
From: Jes Sorensen <Jes.Sorensen@redhat.com>

C defaults to int, so make definition of BDRV_SECTOR_SIZE 64 bit
safe as it and BDRV_SECTOR_MASK may be used against 64 bit addresses.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/block.h b/block.h
index 9034ebb..756670d 100644
--- a/block.h
+++ b/block.h
@@ -38,7 +38,7 @@  typedef struct QEMUSnapshotInfo {
 #define BDRV_O_CACHE_MASK  (BDRV_O_NOCACHE | BDRV_O_CACHE_WB)
 
 #define BDRV_SECTOR_BITS   9
-#define BDRV_SECTOR_SIZE   (1 << BDRV_SECTOR_BITS)
+#define BDRV_SECTOR_SIZE   (1ULL << BDRV_SECTOR_BITS)
 #define BDRV_SECTOR_MASK   ~(BDRV_SECTOR_SIZE - 1)
 
 typedef enum {