lkml.org 
[lkml]   [2018]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] net: usb: sr9700: Replace mdelay() with msleep() in sr9700_bind()
<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }body { font-size: 10.5pt; font-family: ????; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span>Dear Jia-Ju Bai :</div><div><br></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">&nbsp; &nbsp;&nbsp;</span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">&nbsp; &nbsp;&nbsp;</span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">&nbsp; &nbsp; OK.</span></div><div><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;"><br></span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">&nbsp; &nbsp;&nbsp;</span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">&nbsp; &nbsp;&nbsp;</span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">&nbsp; &nbsp; the patch is ok.</span></div>
<div><br></div><hr style="WIDTH: 210px; HEIGHT: 1px" color="#b5c4df" size="1" align="left">
<div><span><div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt"><div>liujunliang_ljl@163.com</div></div></span></div>
<blockquote style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em;"><div>&nbsp;</div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><div><b>From:</b>&nbsp;<a href="mailto:baijiaju1990@gmail.com">Jia-Ju Bai</a></div><div><b>Date:</b>&nbsp;2018-07-27&nbsp;16:41</div><div><b>To:</b>&nbsp;<a href="mailto:liujunliang_ljl@163.com">liujunliang_ljl</a></div><div><b>CC:</b>&nbsp;<a href="mailto:linux-usb@vger.kernel.org">linux-usb</a>; <a href="mailto:netdev@vger.kernel.org">netdev</a>; <a href="mailto:linux-kernel@vger.kernel.org">linux-kernel</a>; <a href="mailto:baijiaju1990@gmail.com">Jia-Ju Bai</a></div><div><b>Subject:</b>&nbsp;[PATCH] net: usb: sr9700: Replace mdelay() with msleep() in sr9700_bind()</div></div></div><div><div>sr9700_bind() is never called in atomic context.</div>
<div>It calls mdelay() to busily wait, which is not necessary.</div>
<div>mdelay() can be replaced with msleep().</div>
<div>&nbsp;</div>
<div>This is found by a static analysis tool named DCNS written by myself.</div>
<div>&nbsp;</div>
<div>Signed-off-by: Jia-Ju Bai &lt;baijiaju1990@gmail.com&gt;</div>
<div>---</div>
<div> drivers/net/usb/sr9700.c | 2 +-</div>
<div> 1 file changed, 1 insertion(+), 1 deletion(-)</div>
<div>&nbsp;</div>
<div>diff --git a/drivers/net/usb/sr9700.c b/drivers/net/usb/sr9700.c</div>
<div>index 2d316c1b851b..6ac232e52bf7 100644</div>
<div>--- a/drivers/net/usb/sr9700.c</div>
<div>+++ b/drivers/net/usb/sr9700.c</div>
<div>@@ -358,7 +358,7 @@ static int sr9700_bind(struct usbnet *dev, struct usb_interface *intf)</div>
<div> /* power up and reset phy */</div>
<div> sr_write_reg(dev, SR_PRR, PRR_PHY_RST);</div>
<div> /* at least 10ms, here 20ms for safe */</div>
<div>- mdelay(20);</div>
<div>+ msleep(20);</div>
<div> sr_write_reg(dev, SR_PRR, 0);</div>
<div> /* at least 1ms, here 2ms for reading right register */</div>
<div> udelay(2 * 1000);</div>
<div>-- </div>
<div>2.17.0</div>
</div></blockquote>
</body></html>
\
 
 \ /
  Last update: 2018-07-27 11:06    [W:0.050 / U:1.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site