Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753737AbcKYMSv (ORCPT ); Fri, 25 Nov 2016 07:18:51 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:26238 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753397AbcKYMSp (ORCPT ); Fri, 25 Nov 2016 07:18:45 -0500 Date: Fri, 25 Nov 2016 15:17:37 +0300 From: Dan Carpenter To: James Simmons Cc: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Oleg Drokin , Linux Kernel Mailing List , Lustre Development List Subject: Re: [PATCH 08/10] staging: lustre: libcfs: remove NULL comparisons in headers Message-ID: <20161125120841.GC6266@mwanda> References: <1479487724-20386-1-git-send-email-jsimmons@infradead.org> <1479487724-20386-9-git-send-email-jsimmons@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1479487724-20386-9-git-send-email-jsimmons@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1063 Lines: 34 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