]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mlxsw: core_thermal: Remove unnecessary checks
authorIdo Schimmel <idosch@nvidia.com>
Tue, 30 Jul 2024 13:58:19 +0000 (15:58 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 1 Aug 2024 01:38:28 +0000 (18:38 -0700)
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 <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/8db5fe0a3a28ba09a15d4102cc03f7e8ca7675be.1722345311.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/core_thermal.c

index e9bf11a38ae9b40edd0c113ef2910c65482126bc..cfbfabec816ee5d3d099d41c47a841356d4b1332 100644 (file)
@@ -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