diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2024-11-20 08:56:48 +0900 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2024-11-28 08:46:02 +0900 |
commit | c58854c8e0b50c2f30c729b82b92b3fd8cc8f2c1 (patch) | |
tree | 2d43eca8a683391b4d522b712137a4a1bfac7b6f /scripts | |
parent | 600dbaf1e2f0c0b70b2d3e7513a161b884e7718f (diff) | |
download | lwn-c58854c8e0b50c2f30c729b82b92b3fd8cc8f2c1.tar.gz lwn-c58854c8e0b50c2f30c729b82b92b3fd8cc8f2c1.zip |
modpost: convert do_of_table() to a generic handler
do_of_table() no longer needs to iterate over the of_device_id array.
Convert it to a generic ->do_entry() handler.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mod/file2alias.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index cacfa0de634b..7f079a3857b2 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -398,7 +398,7 @@ static void do_usb_table(void *symval, unsigned long size, do_usb_entry_multi(symval + i, mod); } -static void do_of_entry_multi(void *symval, struct module *mod) +static void do_of_entry(struct module *mod, void *symval) { char alias[500]; int len; @@ -424,21 +424,6 @@ static void do_of_entry_multi(void *symval, struct module *mod) module_alias_printf(mod, false, "%sC*", alias); } -static void do_of_table(void *symval, unsigned long size, - struct module *mod) -{ - unsigned int i; - const unsigned long id_size = SIZE_of_device_id; - - device_id_check(mod->name, "of", size, id_size, symval); - - /* Leave last one: it's the terminator. */ - size -= id_size; - - for (i = 0; i < size; i += id_size) - do_of_entry_multi(symval + i, mod); -} - /* Looks like: hid:bNvNpN */ static void do_hid_entry(struct module *mod, void *symval) { @@ -1520,6 +1505,7 @@ static const struct devtable devtable[] = { {"cdx", SIZE_cdx_device_id, do_cdx_entry}, {"vchiq", SIZE_vchiq_device_id, do_vchiq_entry}, {"coreboot", SIZE_coreboot_device_id, do_coreboot_entry}, + {"of", SIZE_of_device_id, do_of_entry}, {"pnp", SIZE_pnp_device_id, do_pnp_device_entry}, {"pnp_card", SIZE_pnp_card_device_id, do_pnp_card_entry}, }; @@ -1568,8 +1554,6 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, /* First handle the "special" cases */ if (sym_is(name, namelen, "usb")) do_usb_table(symval, sym->st_size, mod); - else if (sym_is(name, namelen, "of")) - do_of_table(symval, sym->st_size, mod); else { int i; |