aboutsummaryrefslogtreecommitdiff
path: root/lib/dma.c
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2021-03-23 15:30:25 +0000
committerGitHub <noreply@github.com>2021-03-23 15:30:25 +0000
commit9ed4c9e8c86ec04cbae067db18e1d31dd5f2ca79 (patch)
tree3179a0a18319c3e863bd01c334de8a8fc7c68ab2 /lib/dma.c
parent8ba55dfb9bb54b773513e78d87d9ebe078384573 (diff)
downloadlibvfio-user-9ed4c9e8c86ec04cbae067db18e1d31dd5f2ca79.zip
libvfio-user-9ed4c9e8c86ec04cbae067db18e1d31dd5f2ca79.tar.gz
libvfio-user-9ed4c9e8c86ec04cbae067db18e1d31dd5f2ca79.tar.bz2
add -Wmissing-declarations (#399)
This is used by SPDK, and it's generally useful. This also uncovered some issues in the test mocking. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Diffstat (limited to 'lib/dma.c')
-rw-r--r--lib/dma.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/dma.c b/lib/dma.c
index 38d4c71..f5b5540 100644
--- a/lib/dma.c
+++ b/lib/dma.c
@@ -42,6 +42,7 @@
#include <errno.h>
#include "dma.h"
+#include "private.h"
static inline ssize_t
fd_get_blocksize(int fd)
@@ -113,7 +114,6 @@ _dma_controller_do_remove_region(dma_controller_t *dma,
}
}
UNIT_TEST_SYMBOL(_dma_controller_do_remove_region);
-
/*
* FIXME super ugly, but without this functions within the same compilation
* unit don't call the wrapped version, making unit testing impossible.
@@ -418,7 +418,8 @@ out:
return cnt;
}
-ssize_t _get_bitmap_size(size_t region_size, size_t pgsize)
+static ssize_t
+get_bitmap_size(size_t region_size, size_t pgsize)
{
if (pgsize == 0) {
return -EINVAL;
@@ -449,7 +450,7 @@ int dma_controller_dirty_page_logging_start(dma_controller_t *dma, size_t pgsize
for (i = 0; i < dma->nregions; i++) {
dma_memory_region_t *region = &dma->regions[i];
- ssize_t bitmap_size = _get_bitmap_size(region->size, pgsize);
+ ssize_t bitmap_size = get_bitmap_size(region->size, pgsize);
if (bitmap_size < 0) {
return bitmap_size;
}
@@ -512,7 +513,7 @@ dma_controller_dirty_page_get(dma_controller_t *dma, dma_addr_t addr, int len,
return -EINVAL;
}
- bitmap_size = _get_bitmap_size(len, pgsize);
+ bitmap_size = get_bitmap_size(len, pgsize);
if (bitmap_size < 0) {
return bitmap_size;
}