linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: James Simmons <jsimmons@infradead.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org,
	Andreas Dilger <andreas.dilger@intel.com>,
	Oleg Drokin <oleg.drokin@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lustre Development List <lustre-devel@lists.lustre.org>
Subject: Re: [PATCH 08/10] staging: lustre: libcfs: remove NULL comparisons in headers
Date: Fri, 25 Nov 2016 15:17:37 +0300	[thread overview]
Message-ID: <20161125120841.GC6266@mwanda> (raw)
In-Reply-To: <1479487724-20386-9-git-send-email-jsimmons@infradead.org>

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

  reply	other threads:[~2016-11-25 12:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18 16:48 [PATCH 00/10] checkpatch fixes and style cleanups for libcfs headers James Simmons
2016-11-18 16:48 ` [PATCH 01/10] staging: lustre: libcfs: fixup all header block comments James Simmons
2016-11-18 16:48 ` [PATCH 02/10] staging: lustre: libcfs: remove header's bare unsigned use James Simmons
2016-11-18 16:48 ` [PATCH 03/10] staging: lustre: libcfs: name parameters for function prototypes James Simmons
2016-11-18 16:48 ` [PATCH 04/10] staging: lustre: libcfs: remove blank line in header James Simmons
2016-11-18 16:48 ` [PATCH 05/10] staging: lustre: libcfs: correct spelling in libcfs_cpu.h James Simmons
2016-11-18 16:48 ` [PATCH 06/10] staging: lustre: libcfs: use bit macro in libcfs headers James Simmons
2016-11-18 16:48 ` [PATCH 07/10] staging: lustre: libcfs: remove whitespace in libcfs_fail.h James Simmons
2016-11-18 16:48 ` [PATCH 08/10] staging: lustre: libcfs: remove NULL comparisons in headers James Simmons
2016-11-25 12:17   ` Dan Carpenter [this message]
2016-11-18 16:48 ` [PATCH 09/10] staging: lustre: libcfs: remove zero " James Simmons
2016-11-25 23:49   ` [lustre-devel] " Dilger, Andreas
2016-11-18 16:48 ` [PATCH 10/10] staging: lustre: libcfs: use uXX instead of __uXX types " James Simmons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161125120841.GC6266@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jsimmons@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=oleg.drokin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).