modpost: change elf_info->size to size_t

Align with the mmap / munmap APIs.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
Masahiro Yamada 2020-06-01 14:57:31 +09:00
parent 4de7b62936
commit 3b09efc4f0
2 changed files with 5 additions and 6 deletions

View File

@ -443,7 +443,7 @@ static void sym_set_crc(const char *name, unsigned int crc)
s->crc_valid = 1; s->crc_valid = 1;
} }
static void *grab_file(const char *filename, unsigned long *size) static void *grab_file(const char *filename, size_t *size)
{ {
struct stat st; struct stat st;
void *map = MAP_FAILED; void *map = MAP_FAILED;
@ -465,7 +465,7 @@ static void *grab_file(const char *filename, unsigned long *size)
return map; return map;
} }
static void release_file(void *file, unsigned long size) static void release_file(void *file, size_t size)
{ {
munmap(file, size); munmap(file, size);
} }
@ -521,9 +521,8 @@ static int parse_elf(struct elf_info *info, const char *filename)
/* Check if file offset is correct */ /* Check if file offset is correct */
if (hdr->e_shoff > info->size) { if (hdr->e_shoff > info->size) {
fatal("section header offset=%lu in file '%s' is bigger than " fatal("section header offset=%lu in file '%s' is bigger than filesize=%zu\n",
"filesize=%lu\n", (unsigned long)hdr->e_shoff, (unsigned long)hdr->e_shoff, filename, info->size);
filename, info->size);
return 0; return 0;
} }

View File

@ -133,7 +133,7 @@ struct module {
}; };
struct elf_info { struct elf_info {
unsigned long size; size_t size;
Elf_Ehdr *hdr; Elf_Ehdr *hdr;
Elf_Shdr *sechdrs; Elf_Shdr *sechdrs;
Elf_Sym *symtab_start; Elf_Sym *symtab_start;