Re: [PATCH 1/1] staging: ozwpan: Remove allocation from delaration line

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

 



On Tue, Feb 10, 2015 at 09:55:03AM +0100, Quentin Lambert wrote:
>  static struct oz_endpoint *oz_ep_alloc(int buffer_size, gfp_t mem_flags)
>  {
> -	struct oz_endpoint *ep =
> -		kzalloc(sizeof(struct oz_endpoint)+buffer_size, mem_flags);
> +	struct oz_endpoint *ep;
> +
> +	ep = kzalloc(sizeof(struct oz_endpoint)+buffer_size, mem_flags);
> +
>  	if (ep) {

Don't put a blank line between the function and the test.  They are part
of the same thing.

Also in a later patch, could you reverse the "if (ep) " to

	if (!ep)
		return NULL;

The original code is "success handling" not "error handling".

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux