[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190424170925.549766879@linuxfoundation.org>
Date: Wed, 24 Apr 2019 19:10:30 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Mathieu Malaterre <malat@...ian.org>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 4.19 85/96] modpost: file2alias: check prototype of handler
[ Upstream commit f880eea68fe593342fa6e09be9bb661f3c297aec ]
Use specific prototype instead of an opaque pointer so that the
compiler can catch function prototype mismatch.
Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
Reviewed-by: Mathieu Malaterre <malat@...ian.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
scripts/mod/file2alias.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 9f3ebde7a0cd..7f40b6aab689 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -47,7 +47,7 @@ typedef struct {
struct devtable {
const char *device_id; /* name of table, __mod_<name>__*_device_table. */
unsigned long id_size;
- void *function;
+ int (*do_entry)(const char *filename, void *symval, char *alias);
};
/* Define a variable f that holds the value of field f of struct devid
@@ -1288,12 +1288,11 @@ static bool sym_is(const char *name, unsigned namelen, const char *symbol)
static void do_table(void *symval, unsigned long size,
unsigned long id_size,
const char *device_id,
- void *function,
+ int (*do_entry)(const char *filename, void *symval, char *alias),
struct module *mod)
{
unsigned int i;
char alias[500];
- int (*do_entry)(const char *, void *entry, char *alias) = function;
device_id_check(mod->name, device_id, size, id_size, symval);
/* Leave last one: it's the terminator. */
@@ -1410,7 +1409,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
if (sym_is(name, namelen, p->device_id)) {
do_table(symval, sym->st_size, p->id_size,
- p->device_id, p->function, mod);
+ p->device_id, p->do_entry, mod);
break;
}
}
--
2.19.1
Powered by blists - more mailing lists