zdump: don't modify passed program header in pt_load_add()

There should be no problem with this change since the changed value was never
used. Therefore, let's remove the assignment and declare the parameter as const
to prevent such a behavior in the future.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2022-04-07 11:29:17 +02:00
committed by Jan Höppner
parent 776e5d41d7
commit 229cd6d194

View File

@@ -40,7 +40,7 @@ static void dfi_elf_mem_chunk_read_fn(struct dfi_mem_chunk *mem_chunk, u64 off,
/*
* Add load (memory chunk) to DFI dump
*/
static int pt_load_add(Elf64_Phdr *phdr)
static int pt_load_add(const Elf64_Phdr *phdr)
{
u64 *off_ptr;
@@ -50,7 +50,6 @@ static int pt_load_add(Elf64_Phdr *phdr)
phdr->p_filesz, phdr->p_memsz);
if (phdr->p_paddr != phdr->p_vaddr) {
phdr->p_paddr = phdr->p_vaddr;
STDERR("Dump file \"%s\" is a user space core dump\n",
g.opts.device);
return -EINVAL;