Re: [PATCH 08/10] staging: lustre: libcfs: remove NULL comparisons in headers

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

 



On Fri, Nov 18, 2016 at 11:48:42AM -0500, James Simmons wrote:
> diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
> index 93bff1b..fc180b8 100644
> --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
> +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
> @@ -96,7 +96,7 @@
>  
>  #define LIBCFS_ALLOC_POST(ptr, size)					    \
>  do {									    \
> -	if (unlikely((ptr) == NULL)) {					    \
> +	if (!unlikely((ptr))) {						    \

Argh....  No.  You did this with a Perl script?

This should be:

	if (unlikely(!ptr)) { ...

>  		CERROR("LNET: out of memory at %s:%d (tried to alloc '"	    \
>  		       #ptr "' = %d)\n", __FILE__, __LINE__, (int)(size));  \
>  	} else {							    \
> @@ -147,7 +147,7 @@
>  
>  #define LIBCFS_FREE(ptr, size)					  \
>  do {								    \
> -	if (unlikely((ptr) == NULL)) {				  \
> +	if (!unlikely((ptr))) {						\

Same.

Otherwise the unlikely hint is reversed from what we want.

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