提交 2bdf6ea5 编写于 作者: K Krzysztof Opasiak 提交者: Greg Kroah-Hartman

usb: usbip: vudc: Fix WARN_ON() usage pattern

Fix WARN_ON() macro usage as suggested by Felipe.
Instead of using:
if (cond) {
   WARN_ON(1);
   do_stuff();
}

Use a better pattern with WARN_ON() placed in if condition:

if (WARN_ON(cond))
   do_stuff();
Signed-off-by: NKrzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 f945c546
......@@ -312,10 +312,9 @@ static void vep_free_request(struct usb_ep *_ep, struct usb_request *_req)
{
struct vrequest *req;
if (!_ep || !_req) {
WARN_ON(1);
if (WARN_ON(!_ep || !_req))
return;
}
req = to_vrequest(_req);
kfree(req);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册