Skip to content

Commit 2a1c9dc

Browse files
idoschkuba-moo
authored andcommitted
mlxsw: core_thermal: Remove another unnecessary check
mlxsw_thermal_modules_init() allocates an array of modules and then initializes each entry by calling mlxsw_thermal_module_init() which among other things initializes the 'parent' pointer of the entry. mlxsw_thermal_modules_init() then traverses over the array again, but skips over entries that do not have their 'parent' pointer set which is impossible given the above. Therefore, 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]> Link: https://patch.msgid.link/fb3e8ded422a441436431d5785b900f11ffc9621.1722345311.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 4be011d commit 2a1c9dc

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,6 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core,
505505

506506
for (i = 0; i < area->tz_module_num; i++) {
507507
module_tz = &area->tz_module_arr[i];
508-
if (!module_tz->parent)
509-
continue;
510508
err = mlxsw_thermal_module_tz_init(module_tz);
511509
if (err)
512510
goto err_thermal_module_tz_init;

0 commit comments

Comments
 (0)