Skip to contentSkip to conversation

drm/nouveau/therm: remove unreachable fan update branch

PATCH New Anas Khan 1 participant 1 message Jul 2

Subsystems (3)
lore
Share & tools
lore

Anas Khan

author
#0 lore raw

PATCH 1/1 drm/nouveau/therm: remove unreachable fan update branch

The fan re-scheduling logic sits inside an "if (target != duty)" block, so by the time the inner if/else-if chain runs, duty can never equal target. The "else if (duty == target)" branch is therefore dead code and has been since it was introduced. Drop it; the two reachable cases (duty > target and duty < target) are unchanged, so behaviour is identical.

---
 drivers/gpu/drm/nouveau/nvkm/subdev/therm/fan.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/nouveau/nvkm/subdev/therm/fan.c +0 -2
index f8fa43c8a7d2..c4aaf7473065 100644
@@ -90,8 +90,6 @@ nvkm_fan_update(struct nvkm_fan *fan, bool immediate, int target)
 
 		if (duty > target)
 			delay = slow_down_period;
-		else if (duty == target)
-			delay = min(bump_period, slow_down_period) ;
 		else
 			delay = bump_period;
 
Signature · 1 line
2.54.0