[PATCH 3/3] Cleanup: Remove offset_pt_load_memory

Petr Tesarik ptesarik at suse.com
Wed Oct 7 02:56:52 EDT 2020


After the previous commit, this variable has become write-only, so
it is clearly no longer needed.

Signed-off-by: Petr Tesarik <ptesarik at suse.com>
---
 elf_info.c | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/elf_info.c b/elf_info.c
index 5ed65fc..a6624b5 100644
--- a/elf_info.c
+++ b/elf_info.c
@@ -63,7 +63,6 @@ static int			flags_memory;
  */
 static unsigned int		num_pt_loads;
 static struct pt_load_segment	*pt_loads;
-static off_t			offset_pt_load_memory;
 
 /*
  * PT_NOTE information about /proc/vmcore:
@@ -843,15 +842,6 @@ int get_kcore_dump_loads(void)
 			return FALSE;
 		}
 
-		if (j == 0) {
-			offset_pt_load_memory = p->file_offset;
-			if (offset_pt_load_memory == 0) {
-				ERRMSG("Can't get the offset of page data.\n");
-				free(pls);
-				return FALSE;
-			}
-		}
-
 		pls[j] = *p;
 		j++;
 	}
@@ -929,13 +919,6 @@ get_elf_info(int fd, char *filename)
 		if (phdr.p_type != PT_LOAD)
 			continue;
 
-		if (j == 0) {
-			offset_pt_load_memory = phdr.p_offset;
-			if (offset_pt_load_memory == 0) {
-				ERRMSG("Can't get the offset of page data.\n");
-				return FALSE;
-			}
-		}
 		if (j >= num_pt_loads)
 			return FALSE;
 		if(!dump_Elf_load(&phdr, j))
-- 
2.26.2




More information about the kexec mailing list