]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
depmod: Do not duplicate builtin index
authorLucas De Marchi <lucas.demarchi@intel.com>
Thu, 10 Feb 2022 02:46:34 +0000 (18:46 -0800)
committerLucas De Marchi <lucas.demarchi@intel.com>
Sat, 12 Feb 2022 06:06:34 +0000 (22:06 -0800)
Now that libkmod uses modules.builtin.bin again, we don't need to add
the module names in modules.builtin.alias.bin and just add the aliases.

After this change, here are the new sizes for the indexes:

Before After index
21k 6.4K modules.builtin.alias.bin
11k  11K modules.builtin.bin

tools/depmod.c

index eb810b811e359e49cf3a77c722b5c5b0e4771d38..ac6ead823aa682b5afd73f6481658286e40a5273 100644 (file)
@@ -2405,7 +2405,7 @@ static int output_devname(struct depmod *depmod, FILE *out)
 
 static int output_builtin_alias_bin(struct depmod *depmod, FILE *out)
 {
-       int ret = 0, count = 0;
+       int ret = 0;
        struct index_node *idx;
        struct kmod_list *l, *builtin = NULL;
 
@@ -2450,9 +2450,6 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out)
                }
 
                kmod_module_info_free_list(info_list);
-
-               index_insert(idx, modname, modname, 0);
-               count++;
        }
 
 out: