Commit d81d7143 authored by Ido Schimmel's avatar Ido Schimmel Committed by Jakub Kicinski

mlxsw: core_thermal: Fold two loops into one

There is no need to traverse the same array twice. Do it once by folding
both loops into one.
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Reviewed-by: default avatarVadim Pasternak <vadimp@nvidia.com>
Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
Reviewed-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
Link: https://patch.msgid.link/81756744ed532aaa9249a83fc08757accfe8b07c.1722345311.git.petrm@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 2a1c9dcb
......@@ -500,10 +500,8 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core,
if (!area->tz_module_arr)
return -ENOMEM;
for (i = 0; i < area->tz_module_num; i++)
mlxsw_thermal_module_init(dev, core, thermal, area, i);
for (i = 0; i < area->tz_module_num; i++) {
mlxsw_thermal_module_init(dev, core, thermal, area, i);
module_tz = &area->tz_module_arr[i];
err = mlxsw_thermal_module_tz_init(module_tz);
if (err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment