From 13a1227a028a34c8adda4ecaa673c78e16f3eebd Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Thu, 14 Oct 2021 19:17:31 +0200 Subject: [PATCH] zdump: notes_init: rename some parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename the parameter `ptr` of `notes_init` to something meaningful. Since it points to the start of the notes segment rename it to `segment_start`. In addition, improve the documentation for the function. Reviewed-by: Alexander Egorenkov Signed-off-by: Marc Hartmayer Signed-off-by: Jan Höppner --- zdump/dfo_elf.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/zdump/dfo_elf.c b/zdump/dfo_elf.c index 9b369340..040410ca 100644 --- a/zdump/dfo_elf.c +++ b/zdump/dfo_elf.c @@ -240,11 +240,12 @@ static void *nt_vmcoreinfo(void *ptr) } /* - * Initialize notes + * Initialize the program header entries for the notes and the related segment + * data. */ -static void *notes_init(Elf64_Phdr *phdr, void *ptr, u64 notes_offset) +static void *notes_init(Elf64_Phdr *phdr, void *segment_start, u64 elf_offset) { - void *ptr_start = ptr; + void *ptr = segment_start; struct dfi_cpu *cpu; ptr = nt_prpsinfo(ptr); @@ -269,8 +270,8 @@ out: ptr = nt_vmcoreinfo(ptr); memset(phdr, 0, sizeof(*phdr)); phdr->p_type = PT_NOTE; - phdr->p_offset = notes_offset; - phdr->p_filesz = PTR_DIFF(ptr, ptr_start); + phdr->p_offset = elf_offset; + phdr->p_filesz = PTR_DIFF(ptr, segment_start); return ptr; }