mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau/therm: remove redundant duty == target check
@ 2023-12-19 15:03 Colin Ian King
  0 siblings, 0 replies; only message in thread
From: Colin Ian King @ 2023-12-19 15:03 UTC (permalink / raw)
  To: Karol Herbst, Lyude Paul, Danilo Krummrich, David Airlie,
	Daniel Vetter, Ben Skeggs, dri-devel, nouveau
  Cc: kernel-janitors, linux-kernel

The check for duty == target is always false because it is in an if block
where duty != target. A previous change added the duty != target check
and so the check duty == target check is now redundant and can be removed.
Cleans up a cppcheck warning:

drivers/gpu/drm/nouveau/nvkm/subdev/therm/fan.c:93:17: warning: Opposite
inner 'if' condition leads to a dead code block. [oppositeInnerCondition]

Fixes: e4311ee51d1e ("drm/nouveau/therm: remove ineffective workarounds for alarm bugs")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/gpu/drm/nouveau/nvkm/subdev/therm/fan.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fan.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fan.c
index f8fa43c8a7d2..c4aaf7473065 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fan.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fan.c
@@ -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;
 
-- 
2.39.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-19 15:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-19 15:03 [PATCH] drm/nouveau/therm: remove redundant duty == target check Colin Ian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®