mlxsw: core_thermal: Remove unnecessary check
authorIdo Schimmel <idosch@nvidia.com>
Tue, 30 Jul 2024 13:58:13 +0000 (15:58 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 1 Aug 2024 01:38:28 +0000 (18:38 -0700)
mlxsw_thermal_modules_init() allocates an array of modules and then
calls mlxsw_thermal_module_init() to initialize each entry in the array.
It is therefore impossible for mlxsw_thermal_module_init() to encounter
an entry that is already initialized and has its 'parent' pointer set.

Remove the unnecessary check.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/core_thermal.c

index 0b38bab4eaa89750fb4972c7c6c5666fd91a7ba1..394e4fd633ef2a76d1006a696059ed1afb3b8803 100644 (file)
@@ -453,9 +453,6 @@ mlxsw_thermal_module_init(struct device *dev, struct mlxsw_core *core,
        struct mlxsw_thermal_module *module_tz;
 
        module_tz = &area->tz_module_arr[module];
-       /* Skip if parent is already set (case of port split). */
-       if (module_tz->parent)
-               return;
        module_tz->module = module;
        module_tz->slot_index = area->slot_index;
        module_tz->parent = thermal;