]> asedeno.scripts.mit.edu Git - linux.git/commit
video: fbdev: aty: aty128fb: Replace mdelay with msleep in aty128_set_suspend
authorJia-Ju Bai <baijiaju1990@gmail.com>
Tue, 24 Apr 2018 16:11:21 +0000 (18:11 +0200)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Tue, 24 Apr 2018 16:11:21 +0000 (18:11 +0200)
commit86c4e7c350a5bd116ff4b9cea2c75a4a4ae321ff
tree0f896c02bb49db86ef3e6ab2a65afddec5aeedee
parent12f3ac2fb16130e4afcfde986fb97f61cb54eead
video: fbdev: aty: aty128fb: Replace mdelay with msleep in aty128_set_suspend

aty128_set_suspend() is never called in atomic context.

The call chains ending up at aty128_set_suspend() are:
[1] aty128_set_suspend() <- aty128_pci_suspend()
[2] aty128_set_suspend() <- aty128_do_resume() <- aty128_pci_resume()
[3] aty128_set_suspend() <- aty128_do_resume() <- aty128_early_resume()

aty128_pci_suspend() is set as ".suspend" in struct pci_driver.
aty128_pci_resume() is set as ".resume" in struct pci_driver.
aty128_early_resume() is never called.
These functions are not called in atomic context.

Despite never getting called from atomic context, aty128_set_suspend()
calls mdelay() to busily wait.
This is not necessary and can be replaced with msleep() to
avoid busy waiting.

This is found by a static analysis tool named DCNS written by myself.
And I also manually check it.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/video/fbdev/aty/aty128fb.c