summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-06-01 14:57:31 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2020-06-06 23:39:20 +0900
commit3b09efc4f0c94669a928c0453d2dcb54c59543f2 (patch)
treee467f682f3a807efbd455393c92586383f28c727 /scripts
parent4de7b62936122570408357417f21072e78292926 (diff)
downloadlwn-3b09efc4f0c94669a928c0453d2dcb54c59543f2.tar.gz
lwn-3b09efc4f0c94669a928c0453d2dcb54c59543f2.zip
modpost: change elf_info->size to size_t
Align with the mmap / munmap APIs. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mod/modpost.c9
-rw-r--r--scripts/mod/modpost.h2
2 files changed, 5 insertions, 6 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index a3ffabf4eca5..e5cee2367d5e 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -443,7 +443,7 @@ static void sym_set_crc(const char *name, unsigned int crc)
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;
void *map = MAP_FAILED;
@@ -465,7 +465,7 @@ failed:
return map;
}
-static void release_file(void *file, unsigned long size)
+static void release_file(void *file, size_t 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 */
if (hdr->e_shoff > info->size) {
- fatal("section header offset=%lu in file '%s' is bigger than "
- "filesize=%lu\n", (unsigned long)hdr->e_shoff,
- filename, info->size);
+ fatal("section header offset=%lu in file '%s' is bigger than filesize=%zu\n",
+ (unsigned long)hdr->e_shoff, filename, info->size);
return 0;
}
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h
index 254c75378583..3aa052722233 100644
--- a/scripts/mod/modpost.h
+++ b/scripts/mod/modpost.h
@@ -133,7 +133,7 @@ struct module {
};
struct elf_info {
- unsigned long size;
+ size_t size;
Elf_Ehdr *hdr;
Elf_Shdr *sechdrs;
Elf_Sym *symtab_start;