summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2019-10-04 13:01:09 +0200
committerSimon Horman <horms@verge.net.au>2019-10-07 09:10:13 +0200
commitbd077966e2b9041c24df5b689e67670f02be7b0d (patch)
tree8936792ef78a32a2e4d34606b16d242682d701ff
parent775f258fbd1895ba669be22f108faf817247a47a (diff)
downloadkexec-tools-bd077966e2b9041c24df5b689e67670f02be7b0d.tar.gz
kexec-tools: Fix conversion overflow when compiling on 32-bit platforms
When compiling kexec-tools on a 32-bit platform, assigning an (unsigned long long) value to an (unsigned long) variable creates this warning: elf_info.c: In function 'read_phys_offset_elf_kcore': elf_info.c:805:14: warning: conversion from 'long long unsigned int' to 'long unsigned int' changes value from '18446744073709551615' to '4294967295' 805 | *phys_off = UINT64_MAX; Fix it by using ULONG_MAX instead of UINT64_MAX. Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--util_lib/elf_info.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util_lib/elf_info.c b/util_lib/elf_info.c
index 2bce5cb1..7803a948 100644
--- a/util_lib/elf_info.c
+++ b/util_lib/elf_info.c
@@ -802,7 +802,7 @@ int read_phys_offset_elf_kcore(int fd, unsigned long *phys_off)
{
int ret;
- *phys_off = UINT64_MAX;
+ *phys_off = ULONG_MAX;
ret = read_elf(fd);
if (!ret) {