Skip to content

Commit c6eee9d

Browse files
masahir0ymcgrof
authored andcommitted
module: do not pass opaque pointer for symbol search
There is no need to use an opaque pointer for check_exported_symbol() or find_exported_symbol_in_section. Pass (struct find_symbol_arg *) explicitly. Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Luis Chamberlain <[email protected]>
1 parent 8eac910 commit c6eee9d

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

kernel/module/main.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,9 @@ static __maybe_unused void *any_section_objs(const struct load_info *info,
244244
#endif
245245

246246
static bool check_exported_symbol(const struct symsearch *syms,
247-
struct module *owner,
248-
unsigned int symnum, void *data)
247+
struct module *owner, unsigned int symnum,
248+
struct find_symbol_arg *fsa)
249249
{
250-
struct find_symbol_arg *fsa = data;
251-
252250
if (!fsa->gplok && syms->license == GPL_ONLY)
253251
return false;
254252
fsa->owner = owner;
@@ -285,16 +283,15 @@ int cmp_name(const void *name, const void *sym)
285283

286284
static bool find_exported_symbol_in_section(const struct symsearch *syms,
287285
struct module *owner,
288-
void *data)
286+
struct find_symbol_arg *fsa)
289287
{
290-
struct find_symbol_arg *fsa = data;
291288
struct kernel_symbol *sym;
292289

293290
sym = bsearch(fsa->name, syms->start, syms->stop - syms->start,
294291
sizeof(struct kernel_symbol), cmp_name);
295292

296293
if (sym != NULL && check_exported_symbol(syms, owner,
297-
sym - syms->start, data))
294+
sym - syms->start, fsa))
298295
return true;
299296

300297
return false;

0 commit comments

Comments
 (0)