diff options
author | Thanos Makatos <thanos.makatos@nutanix.com> | 2019-09-05 09:51:16 -0400 |
---|---|---|
committer | Felipe Franciosi <felipe@nutanix.com> | 2019-09-05 16:45:35 +0100 |
commit | 87fb9ed200f49db51f2ced578647a3529c1105dc (patch) | |
tree | a4874bde500171ed5badbc5d0296e35f1ef27509 /lib/libmuser_pci.c | |
parent | 85f4828c74c01ae8ff17f56614f5f46563d88b1c (diff) | |
download | libvfio-user-87fb9ed200f49db51f2ced578647a3529c1105dc.zip libvfio-user-87fb9ed200f49db51f2ced578647a3529c1105dc.tar.gz libvfio-user-87fb9ed200f49db51f2ced578647a3529c1105dc.tar.bz2 |
remove unnecessary loop for retrieving region
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib/libmuser_pci.c')
-rw-r--r-- | lib/libmuser_pci.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; } |