From 87fb9ed200f49db51f2ced578647a3529c1105dc Mon Sep 17 00:00:00 2001 From: Thanos Makatos Date: Thu, 5 Sep 2019 09:51:16 -0400 Subject: remove unnecessary loop for retrieving region Signed-off-by: Thanos Makatos --- lib/libmuser_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libmuser_pci.c') diff --git a/lib/libmuser_pci.c b/lib/libmuser_pci.c index 7131e94..488167d 100644 --- a/lib/libmuser_pci.c +++ b/lib/libmuser_pci.c @@ -275,7 +275,7 @@ muser_do_pci_hdr_access(lm_ctx_t * const lm_ctx, size_t * const count, assert(pos); assert(buf); - _pos = *pos - region_offset(LM_DEV_CFG_REG_IDX); + _pos = *pos - region_to_offset(LM_DEV_CFG_REG_IDX); _count = MIN(*count, PCI_STD_HEADER_SIZEOF - _pos); if (is_write) { @@ -291,7 +291,7 @@ muser_do_pci_hdr_access(lm_ctx_t * const lm_ctx, size_t * const count, static inline bool muser_is_pci_hdr_access(const lm_reg_info_t * const reg_info, const loff_t pos) { - const off_t off = (loff_t) region_offset(LM_DEV_CFG_REG_IDX); + const off_t off = (loff_t) region_to_offset(LM_DEV_CFG_REG_IDX); return pos - off >= 0 && pos - off < PCI_STD_HEADER_SIZEOF; } -- cgit v1.1