]> git.baikalelectronics.ru Git - kernel.git/commit
video: fbdev: savage: Replace mdelay with usleep_range in savage_init_hw
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)
commit7e58461ba5522c3990e1d5a32d9071a6bf026b6d
treedb106f43cf3d6f26be808c93913e02e0108b615a
parent7acb3d502174d35a04195dc2f6ad95d6ff730f07
video: fbdev: savage: Replace mdelay with usleep_range in savage_init_hw

savage_init_hw() is never called in atomic context.

The call chains ending up at savage_init_hw() are:
[1] savage_init_hw() <- savagefb_probe()
[2] savage_init_hw() <- savagefb_resume()

savagefb_probe() is only set as ".probe" in struct pci_driver.
savagefb_resume) is only set as ".resume" in struct pci_driver.
These functions are not called in atomic context.

Despite never getting called from atomic context, savage_init_hw()
calls mdelay() to busily wait.
This is not necessary and can be replaced with usleep_range 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: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/video/fbdev/savage/savagefb_driver.c