From: Ido Schimmel Date: Tue, 30 Jul 2024 13:58:13 +0000 (+0200) Subject: mlxsw: core_thermal: Remove unnecessary check X-Git-Tag: v6.12-rc1~232^2~349^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4be011d76408bb7ecfd2f3e00ab89c9a54ce94ce;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Vadim Pasternak Signed-off-by: Petr Machata Reviewed-by: Wojciech Drewek Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index 0b38bab4eaa89..394e4fd633ef2 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -453,9 +453,6 @@ mlxsw_thermal_module_init(struct device *dev, struct mlxsw_core *core, struct mlxsw_thermal_module *module_tz; module_tz = &area->tz_module_arr[module]; - /* Skip if parent is already set (case of port split). */ - if (module_tz->parent) - return; module_tz->module = module; module_tz->slot_index = area->slot_index; module_tz->parent = thermal;