From: Greg Kroah-Hartman Date: Thu, 30 Apr 2015 09:32:52 +0000 (+0200) Subject: USB: hcd.c: move assignment out of if () block X-Git-Tag: v4.2-rc1~86^2~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c688d6211f57e1f6f8aaae5522a9223247febbd6;p=platform%2Fkernel%2Flinux-exynos.git USB: hcd.c: move assignment out of if () block We should not be doing assignments within an if () block so fix up the code to not do this. change was created using Coccinelle. Acked-by: Alan Stern CC: Dan Williams CC: Antoine Tenart CC: Petr Mladek CC: Michal Sojka CC: "Rafael J. Wysocki" CC: Sergei Shtylyov Signed-off-by: Greg Kroah-Hartman Reviewed-by: Felipe Balbi --- diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 45a915c..be5b207 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -2691,7 +2691,8 @@ int usb_add_hcd(struct usb_hcd *hcd, if ((retval = usb_register_bus(&hcd->self)) < 0) goto err_register_bus; - if ((rhdev = usb_alloc_dev(NULL, &hcd->self, 0)) == NULL) { + rhdev = usb_alloc_dev(NULL, &hcd->self, 0); + if (rhdev == NULL) { dev_err(hcd->self.controller, "unable to allocate root hub\n"); retval = -ENOMEM; goto err_allocate_root_hub;