diff options
author | Thanos Makatos <thanos.makatos@nutanix.com> | 2019-09-05 07:30:09 -0400 |
---|---|---|
committer | Felipe Franciosi <felipe@nutanix.com> | 2019-09-05 16:45:35 +0100 |
commit | 9a3cd486d285f507bf8d151db3218af234889d6d (patch) | |
tree | 9bec12f54c246d4b02be0953671ceca3e97bd637 /lib/libmuser.c | |
parent | ab6e09fb512a60a422b2f6dcb54566d5a92bd157 (diff) | |
download | libvfio-user-9a3cd486d285f507bf8d151db3218af234889d6d.zip libvfio-user-9a3cd486d285f507bf8d151db3218af234889d6d.tar.gz libvfio-user-9a3cd486d285f507bf8d151db3218af234889d6d.tar.bz2 |
don't hardcode region shift
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib/libmuser.c')
-rw-r--r-- | lib/libmuser.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libmuser.c b/lib/libmuser.c index f04ece5..c10348c 100644 --- a/lib/libmuser.c +++ b/lib/libmuser.c @@ -417,10 +417,12 @@ dev_get_sparse_mmap_cap(lm_ctx_t *lm_ctx, lm_reg_info_t *lm_reg, return 0; } +#define LM_REGION_SHIFT 40 + uint64_t region_offset(const uint32_t region) { - return (uint64_t)region << 40; + return (uint64_t)region << LM_REGION_SHIFT; } static long |