Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0455ecee authored by Chungkai Mei's avatar Chungkai Mei Committed by Chung-Kai (Michael) Mei
Browse files

Parallel module loading: Fix typo and simplify logic



Remove redundant `find()` call as `insert()` performs an internal search and use `load_modules_parallel` directly for all mode selection.

Bug: 402263126
Change-Id: Ib87d45843fe34df41eee33fdc72179c964061c73
Signed-off-by: default avatarChungkai Mei <chungkai@google.com>
parent a47b636e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -442,7 +442,7 @@ int FirstStageMain(int argc, char** argv) {
    if (bootconfig.find("androidboot.load_modules_parallel = \"true\"")
        != std::string::npos)
        want_parallel_mode = Modprobe::LoadParallelMode::NORMAL;
    else if (bootconfig.find("androidboot.load_modules_parallel_mode = \"performance\"")
    else if (bootconfig.find("androidboot.load_modules_parallel = \"performance\"")
        != std::string::npos)
        want_parallel_mode = Modprobe::LoadParallelMode::PERFORMANCE;
    else if (bootconfig.find("androidboot.load_modules_parallel = \"conservative\"")
+1 −3
Original line number Diff line number Diff line
@@ -595,9 +595,7 @@ bool Modprobe::LoadModulesParallel(int num_threads, int mode) {
                break;
            }

            if (mods_loading.find(cnd_last) == mods_loading.end()) {
                mods_loading.insert(cnd_last);

            if (mods_loading.insert(cnd_last).second) {
                if (IsLoadSequential(cnd_last))
                    sequential_modules.emplace_back(cnd_last);
                else