intel / thermal_daemon

Thermal daemon for IA
GNU General Public License v2.0
539 stars 117 forks source link

src/thd_engine_default.cpp, logic is always true on new_passive < critical check #407

Closed ColinIanKing closed 1 year ago

ColinIanKing commented 1 year ago

In cthd_engine_default::add_int340x_processor_dev(void) the value of new_passive is less than critical by 15000, so the check for new_passive < critical is always true (unless there is an underflow). Is this check intentional or should the check be removed?

                                if (critical && passive + 5 * 1000 >= critical) {
                                        new_passive = critical - 15 * 1000;
                                        if (new_passive < critical)
                                                trip->thd_trip_update_set_point(new_passive);
                                }
spandruvada commented 1 year ago

Fixed. Thanks for reporting.