Shortcut to the size.
Keep this wrapper inline even after the previous de-inlining change:
it is a tiny typed helper around elf_get_uint() that avoids repeating
the uint32_t size at call sites, while the larger helpers can still be
left to the compiler.
Signed-off-by: Lucas De Marchi <demarchi@kernel.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/432
return ret;
}
+static inline uint32_t elf_get_u32(const struct kmod_elf *elf, uint64_t offset)
+{
+ return elf_get_uint(elf, offset, sizeof(uint32_t));
+}
+
static int elf_set_uint(const struct kmod_elf *elf, uint64_t offset, uint64_t size,
uint64_t value, uint8_t *changed)
{
return (uint64_t)-1;
}
- crc = elf_get_uint(elf, off + crc, sizeof(uint32_t));
+ crc = elf_get_u32(elf, off + crc);
+
return crc;
}