summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/config.c
diff options
context:
space:
mode:
authorJia-Ju Bai <baijiaju1990@gmail.com>2018-04-10 09:29:08 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-22 15:49:42 +0200
commit2a3dae10d51d262514498fe710c963da946ce6e2 (patch)
tree79f409af2cc7ea62b1d7ab1357c96ff39c9d9c85 /drivers/usb/gadget/config.c
parenta47060cf40c6c8e6e125692f5d73ceea173b12b7 (diff)
downloadlinux-2a3dae10d51d262514498fe710c963da946ce6e2.tar.gz
usb: storage: Replace mdelay with msleep in init_freecom
init_freecom() is never called in atomic context. init_freecom() is set as ".initFunction" through UNUSUAL_DEV(). And ->initFunction() is only called by usb_stor_acquire_resources(), which is only called by usb_stor_probe2(). usb_stor_probe2() is called by *_probe() functions (like alauda_probe()) for each USB driver. *_probe() functions are set ".probe" in struct usb_driver. These functions are not called in atomic context. Despite never getting called from atomic context, init_freecom() 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> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/config.c')
0 files changed, 0 insertions, 0 deletions