[PATCH 2/2] thermal_functions: simplify the search for objects