Skip to content

Commit 4be011d

Browse files
idoschkuba-moo
authored andcommitted
mlxsw: core_thermal: Remove unnecessary check
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 <[email protected]> Reviewed-by: Vadim Pasternak <[email protected]> Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Wojciech Drewek <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent a1bb54b commit 4be011d

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/net/ethernet/mellanox/mlxsw/core_thermal.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,6 @@ mlxsw_thermal_module_init(struct device *dev, struct mlxsw_core *core,
453453
struct mlxsw_thermal_module *module_tz;
454454

455455
module_tz = &area->tz_module_arr[module];
456-
/* Skip if parent is already set (case of port split). */
457-
if (module_tz->parent)
458-
return;
459456
module_tz->module = module;
460457
module_tz->slot_index = area->slot_index;
461458
module_tz->parent = thermal;

0 commit comments

Comments
 (0)