2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-18 02:04:05 +08:00

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: Krzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Krzysztof Opasiak 2016-04-27 20:00:26 +02:00 committed by Greg Kroah-Hartman
parent f945c54665
commit 2bdf6ea51c

View File

@ -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);
}