Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: mon_main.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.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Felipe Balbi <balbi@ti.com>

+8 -4
+8 -4
drivers/usb/mon/mon_main.c
··· 96 96 { 97 97 struct mon_bus *mbus; 98 98 99 - if ((mbus = ubus->mon_bus) != NULL) 99 + mbus = ubus->mon_bus; 100 + if (mbus != NULL) 100 101 mon_bus_submit(mbus, urb); 101 102 mon_bus_submit(&mon_bus0, urb); 102 103 } ··· 123 122 { 124 123 struct mon_bus *mbus; 125 124 126 - if ((mbus = ubus->mon_bus) != NULL) 125 + mbus = ubus->mon_bus; 126 + if (mbus != NULL) 127 127 mon_bus_submit_error(mbus, urb, error); 128 128 mon_bus_submit_error(&mon_bus0, urb, error); 129 129 } ··· 150 148 { 151 149 struct mon_bus *mbus; 152 150 153 - if ((mbus = ubus->mon_bus) != NULL) 151 + mbus = ubus->mon_bus; 152 + if (mbus != NULL) 154 153 mon_bus_complete(mbus, urb, status); 155 154 mon_bus_complete(&mon_bus0, urb, status); 156 155 } ··· 283 280 { 284 281 struct mon_bus *mbus; 285 282 286 - if ((mbus = kzalloc(sizeof(struct mon_bus), GFP_KERNEL)) == NULL) 283 + mbus = kzalloc(sizeof(struct mon_bus), GFP_KERNEL); 284 + if (mbus == NULL) 287 285 goto err_alloc; 288 286 kref_init(&mbus->ref); 289 287 spin_lock_init(&mbus->lock);