summaryrefslogtreecommitdiffstats
path: root/drivers/usb/usbip
diff options
context:
space:
mode:
authorKrzysztof Opasiak <k.opasiak@samsung.com>2016-04-27 20:00:26 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-04-28 12:28:08 -0700
commit2bdf6ea51ce8dcd98f4f394d7203dbace01f5cbc (patch)
tree57ed98b5a30012dd4171427e5feed488f0820531 /drivers/usb/usbip
parentf945c546656e4330665a69aa35ae6491025128fc (diff)
downloadop-kernel-dev-2bdf6ea51ce8dcd98f4f394d7203dbace01f5cbc.zip
op-kernel-dev-2bdf6ea51ce8dcd98f4f394d7203dbace01f5cbc.tar.gz
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>
Diffstat (limited to 'drivers/usb/usbip')
-rw-r--r--drivers/usb/usbip/vudc_dev.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/usbip/vudc_dev.c b/drivers/usb/usbip/vudc_dev.c
index 43047f4..0523f29 100644
--- a/drivers/usb/usbip/vudc_dev.c
+++ b/drivers/usb/usbip/vudc_dev.c
@@ -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);
}
OpenPOWER on IntegriCloud