From: Ido Schimmel Date: Tue, 30 Jul 2024 13:58:19 +0000 (+0200) Subject: mlxsw: core_thermal: Remove unnecessary checks X-Git-Tag: v6.12-rc1~232^2~349^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e7e3a450e5527f3321dc6d0146bf2b86cf44b508;p=thirdparty%2Fkernel%2Flinux.git mlxsw: core_thermal: Remove unnecessary checks mlxsw_thermal_module_fini() cannot be invoked with a thermal module which is NULL or which is not associated with a thermal zone, so remove these checks. Signed-off-by: Ido Schimmel Reviewed-by: Vadim Pasternak Signed-off-by: Petr Machata Reviewed-by: Wojciech Drewek Link: https://patch.msgid.link/8db5fe0a3a28ba09a15d4102cc03f7e8ca7675be.1722345311.git.petrm@nvidia.com 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 e9bf11a38ae9b..cfbfabec816ee 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -467,11 +467,9 @@ mlxsw_thermal_module_init(struct mlxsw_thermal *thermal, static void mlxsw_thermal_module_fini(struct mlxsw_thermal_module *module_tz) { - if (module_tz && module_tz->tzdev) { - mlxsw_thermal_module_tz_fini(module_tz->tzdev); - module_tz->tzdev = NULL; - module_tz->parent = NULL; - } + mlxsw_thermal_module_tz_fini(module_tz->tzdev); + module_tz->tzdev = NULL; + module_tz->parent = NULL; } static int