From 02086f26d2bc548d6f15d3626320d94c9b025b3d Mon Sep 17 00:00:00 2001 From: Alexander Egorenkov Date: Mon, 11 Oct 2021 11:30:38 +0200 Subject: [PATCH] zdump/dfi_mem_chunk: Don't expose private function dfi_mem_chunk_virt_add() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The function dfi_mem_chunk_virt_add() is used only internally and should not be exported to prevent misuse. Signed-off-by: Alexander Egorenkov Signed-off-by: Jan Höppner --- zdump/dfi_mem_chunk.c | 28 ++++++++++++++-------------- zdump/dfi_mem_chunk.h | 3 --- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/zdump/dfi_mem_chunk.c b/zdump/dfi_mem_chunk.c index a3315606..53774cfd 100644 --- a/zdump/dfi_mem_chunk.c +++ b/zdump/dfi_mem_chunk.c @@ -256,23 +256,12 @@ static u64 mem_chunk_start_phys(struct dfi_mem_chunk *mem_chunk) return mem_chunk->start; } -/* - * Add virtual memory chunk with simple virtual mapping - */ -static void mem_chunk_map_add(u64 start, u64 size, u64 start_p) -{ - u64 *data = util_malloc(sizeof(*data)); - - *data = start_p; - dfi_mem_chunk_virt_add(start, size, data, mem_chunk_map_read_fn, free); -} - /* * Add virtual memory chunk */ -void dfi_mem_chunk_virt_add(u64 start, u64 size, void *data, - dfi_mem_chunk_read_fn read_fn, - dfi_mem_chunk_free_fn free_fn) +static void mem_chunk_virt_add(u64 start, u64 size, void *data, + dfi_mem_chunk_read_fn read_fn, + dfi_mem_chunk_free_fn free_fn) { util_log_print(UTIL_LOG_DEBUG, "DFI add %svirt mem chunk start 0x%016lx size 0x%016lx\n", @@ -284,6 +273,17 @@ void dfi_mem_chunk_virt_add(u64 start, u64 size, void *data, mem_chunk_create(&l.mem_virt, start, size, data, read_fn, free_fn); } +/* + * Add virtual memory chunk with simple virtual mapping + */ +static void mem_chunk_map_add(u64 start, u64 size, u64 start_p) +{ + u64 *data = util_malloc(sizeof(*data)); + + *data = start_p; + mem_chunk_virt_add(start, size, data, mem_chunk_map_read_fn, free); +} + /* * Add memory chunk with volume index */ diff --git a/zdump/dfi_mem_chunk.h b/zdump/dfi_mem_chunk.h index 6531ab23..3becc568 100644 --- a/zdump/dfi_mem_chunk.h +++ b/zdump/dfi_mem_chunk.h @@ -42,9 +42,6 @@ void dfi_mem_chunk_add_vol(u64 start, u64 size, void *data, void dfi_mem_chunk_add(u64 start, u64 size, void *data, dfi_mem_chunk_read_fn read_fn, dfi_mem_chunk_free_fn free_fn); -void dfi_mem_chunk_virt_add(u64 start, u64 size, void *data, - dfi_mem_chunk_read_fn read_fn, - dfi_mem_chunk_free_fn free_fn); u64 dfi_mem_range(void); int dfi_mem_range_valid(u64 addr, u64 len); unsigned int dfi_mem_chunk_cnt(void);