mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 20:14:06 +02:00
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: 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> Link: https://patch.msgid.link/81756744ed532aaa9249a83fc08757accfe8b07c.1722345311.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
2a1c9dcb52
commit
d81d714340
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user