Use min_t/max_t macros in lttng-ust-elf.c
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 10 May 2016 02:34:25 +0000 (22:34 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 10 May 2016 02:34:25 +0000 (22:34 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-ust-elf.c

index c9d2b6b3c406dcb33a8a39dfaab51af7dbe39917..5f27920e48fa041f1d971677b56c643993064de9 100644 (file)
@@ -376,9 +376,9 @@ int lttng_ust_elf_get_memsz(struct lttng_ust_elf *elf, uint64_t *memsz)
                        goto next_loop;
                }
 
-               low_addr = phdr->p_vaddr < low_addr ? phdr->p_vaddr : low_addr;
-               high_addr = phdr->p_vaddr + phdr->p_memsz > high_addr ?
-                               phdr->p_vaddr + phdr->p_memsz : high_addr;
+               low_addr = min_t(uint64_t, low_addr, phdr->p_vaddr);
+               high_addr = max_t(uint64_t, high_addr,
+                               phdr->p_vaddr + phdr->p_memsz);
        next_loop:
                free(phdr);
        }
This page took 0.025365 seconds and 4 git commands to generate.