Skip to contentSkip to conversation

gpu: drm: nouveau: nvkm: nv50: Replace mdelay() with msleep() in nv50_sensor_setup()

PATCH New Jia-Ju Bai 1 participant 1 message Aug 4, 2018

Subsystems (3)
lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

PATCH 1/1 gpu: drm: nouveau: nvkm: nv50: Replace mdelay() with msleep() in nv50_sensor_setup()

nv50_sensor_setup() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep().

This is found by a static analysis tool named DCNS written by myself.

---
 drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c +1 -1
index 9b57b433d4cf..ce8f98f3ee48 100644
@@ -122,7 +122,7 @@ nv50_sensor_setup(struct nvkm_therm *therm)
 {
 	struct nvkm_device *device = therm->subdev.device;
 	nvkm_mask(device, 0x20010, 0x40000000, 0x0);
-	mdelay(20); /* wait for the temperature to stabilize */
+	msleep(20); /* wait for the temperature to stabilize */
 }
 
 static int
Signature · 1 line
2.17.0