[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fb3e8ded422a441436431d5785b900f11ffc9621.1722345311.git.petrm@nvidia.com>
Date: Tue, 30 Jul 2024 15:58:14 +0200
From: Petr Machata <petrm@...dia.com>
To: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>, <netdev@...r.kernel.org>
CC: Vadim Pasternak <vadimp@...dia.com>, Ido Schimmel <idosch@...dia.com>,
Petr Machata <petrm@...dia.com>, <mlxsw@...dia.com>
Subject: [PATCH net-next 03/10] mlxsw: core_thermal: Remove another unnecessary check
From: Ido Schimmel <idosch@...dia.com>
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 <idosch@...dia.com>
Reviewed-by: Vadim Pasternak <vadimp@...dia.com>
Signed-off-by: Petr Machata <petrm@...dia.com>
---
drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
index 394e4fd633ef..afd8fe85a94d 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
@@ -505,8 +505,6 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core,
for (i = 0; i < area->tz_module_num; i++) {
module_tz = &area->tz_module_arr[i];
- if (!module_tz->parent)
- continue;
err = mlxsw_thermal_module_tz_init(module_tz);
if (err)
goto err_thermal_module_tz_init;
--
2.45.0
Powered by blists - more mailing lists