]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
USB: usbatm.c: move assignment out of if () block
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Apr 2015 09:33:05 +0000 (11:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 May 2015 14:01:12 +0000 (16:01 +0200)
We should not be doing assignments within an if () block
so fix up the code to not do this.

change was created using Coccinelle.

CC: Duncan Sands <duncan.sands@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Felipe Balbi <balbi@ti.com>
drivers/usb/atm/usbatm.c

index dada0146cd7f23f0865d86db487af620cf82e99c..db322d9ccb6e59c28c0ee54a8c11171dcbf8f284 100644 (file)
@@ -382,7 +382,8 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
                     "%s: got packet (length: %u, pdu_length: %u, vcc: 0x%p)",
                     __func__, length, pdu_length, vcc);
 
-               if (!(skb = dev_alloc_skb(length))) {
+               skb = dev_alloc_skb(length);
+               if (!skb) {
                        if (printk_ratelimit())
                                atm_err(instance, "%s: no memory for skb (length: %u)!\n",
                                        __func__, length);
@@ -816,7 +817,8 @@ static int usbatm_atm_open(struct atm_vcc *vcc)
                goto fail;
        }
 
-       if (!(new = kzalloc(sizeof(struct usbatm_vcc_data), GFP_KERNEL))) {
+       new = kzalloc(sizeof(struct usbatm_vcc_data), GFP_KERNEL);
+       if (!new) {
                atm_err(instance, "%s: no memory for vcc_data!\n", __func__);
                ret = -ENOMEM;
                goto fail;