Re: [PATCH 17/19] USB: usblp.c: move assignment out of if () block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 30 Apr 2015 11:33:06 +0200
Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:

> We should not be doing assignments within an if () block
> so fix up the code to not do this.

> @@ -980,7 +984,8 @@ static int usblp_submit_read(struct usblp *usblp)
>  	int rc;
>  
>  	rc = -ENOMEM;
> -	if ((urb = usb_alloc_urb(0, GFP_KERNEL)) == NULL)
> +	urb = usb_alloc_urb(0, GFP_KERNEL);
> +	if (urb == NULL)
>  		goto raise_urb;

IMHO it's meaningless for the old code like this, but I ack this.
Looks like not adding a typo.

-- Pete

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux