diff options
author | Lianbo Jiang <lijiang@redhat.com> | 2019-08-23 20:05:36 +0800 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2019-09-08 13:23:54 +0100 |
commit | 545c811050a375f79e0fa0e107cb35b9ae3a1599 (patch) | |
tree | b92dc7d40bc06879dfc88b32a2e83a7d4af9df1b /util_lib | |
parent | 23b67f048ddef88e59ffe40f6392aeef92af9066 (diff) |
Cleanup: remove the read_elf_kcore()
Here, no need to wrap the read_elf() again, lets invoke it directly.
So remove the read_elf_kcore() and clean up redundant code.
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'util_lib')
-rw-r--r-- | util_lib/elf_info.c | 15 | ||||
-rw-r--r-- | util_lib/include/elf_info.h | 2 |
2 files changed, 3 insertions, 14 deletions
diff --git a/util_lib/elf_info.c b/util_lib/elf_info.c index 90a3b21..d9397ec 100644 --- a/util_lib/elf_info.c +++ b/util_lib/elf_info.c @@ -764,7 +764,7 @@ static void dump_dmesg(int fd) dump_dmesg_legacy(fd); } -static int read_elf(int fd) +int read_elf(int fd) { int ret; @@ -824,24 +824,13 @@ int read_elf_vmcore(int fd) return 0; } -int read_elf_kcore(int fd) -{ - int ret; - - ret = read_elf(fd); - if (ret != 0) - return ret; - - return 0; -} - int read_phys_offset_elf_kcore(int fd, unsigned long *phys_off) { int ret; *phys_off = UINT64_MAX; - ret = read_elf_kcore(fd); + ret = read_elf(fd); if (!ret) { /* If we have a valid 'PHYS_OFFSET' by now, * return it to the caller now. diff --git a/util_lib/include/elf_info.h b/util_lib/include/elf_info.h index 1a4debd..c328a1b 100644 --- a/util_lib/include/elf_info.h +++ b/util_lib/include/elf_info.h @@ -29,7 +29,7 @@ int get_pt_load(int idx, unsigned long long *virt_start, unsigned long long *virt_end); int read_phys_offset_elf_kcore(int fd, unsigned long *phys_off); -int read_elf_kcore(int fd); +int read_elf(int fd); int read_elf_vmcore(int fd); #endif /* ELF_INFO_H */ |