aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod/modpost.c
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-06-01 14:57:21 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2020-06-06 23:38:13 +0900
commit75893572d45399cefbb88443d0878adae9cb0b41 (patch)
treeb44605122fe167266896b276d7855e876e1569dc /scripts/mod/modpost.c
parentmodpost: use read_text_file() and get_line() for reading text files (diff)
downloadlinux-dev-75893572d45399cefbb88443d0878adae9cb0b41.tar.xz
linux-dev-75893572d45399cefbb88443d0878adae9cb0b41.zip
modpost: remove get_next_text() and make {grab,release_}file static
get_next_line() is no longer used. Remove. grab_file() and release_file() are only used in modpost.c. Make them static. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/mod/modpost.c')
-rw-r--r--scripts/mod/modpost.c38
1 files changed, 2 insertions, 36 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 4fdf992e9729..93019349f022 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -463,7 +463,7 @@ static void sym_set_crc(const char *name, unsigned int crc)
s->crc_valid = 1;
}
-void *grab_file(const char *filename, unsigned long *size)
+static void *grab_file(const char *filename, unsigned long *size)
{
struct stat st;
void *map = MAP_FAILED;
@@ -485,41 +485,7 @@ failed:
return map;
}
-/**
- * Return a copy of the next line in a mmap'ed file.
- * spaces in the beginning of the line is trimmed away.
- * Return a pointer to a static buffer.
- **/
-char *get_next_line(unsigned long *pos, void *file, unsigned long size)
-{
- static char line[4096];
- int skip = 1;
- size_t len = 0;
- signed char *p = (signed char *)file + *pos;
- char *s = line;
-
- for (; *pos < size ; (*pos)++) {
- if (skip && isspace(*p)) {
- p++;
- continue;
- }
- skip = 0;
- if (*p != '\n' && (*pos < size)) {
- len++;
- *s++ = *p++;
- if (len > 4095)
- break; /* Too long, stop */
- } else {
- /* End of string */
- *s = '\0';
- return line;
- }
- }
- /* End of buffer */
- return NULL;
-}
-
-void release_file(void *file, unsigned long size)
+static void release_file(void *file, unsigned long size)
{
munmap(file, size);
}