Search Linux Wireless

Re: [PATCH 1/3] staging: wilc1000: code style: fix macro with multiple statements

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

 



On Sun, Aug 16, 2015 at 01:30:12AM -0400, Raphaël Beamonte wrote:
>  #define MALLOC_WILC_BUFFER(name, size)	\
> -	exported_ ## name = kmalloc(size, GFP_KERNEL);	  \
> -	if (!exported_ ## name) {   \
> -		printk("fail to alloc: %s memory\n", exported_ ## name);  \
> -		return -ENOBUFS;	\
> -	}
> +	do { \
> +		exported_ ## name = kmalloc(size, GFP_KERNEL);	  \
> +		if (!exported_ ## name) {   \
> +			printk("fail to alloc: %s memory\n", exported_ ## name);  \
> +			return -ENOBUFS;	\
> +		}
> +	} while (0)

Pull it in one indent level...  But actually this macro has a return in
the middle of it, so it just introduces bugs all over the place like
eating cookies in bed.  We should just delete it instead.

regards,
dan carpenter

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



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux