From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuval Shaia Subject: Re: [PATCH 16/26] IB/ocrdma: Adjust a null pointer check in ocrdma_alloc_resources() Date: Thu, 9 Mar 2017 13:42:14 +0200 Message-ID: <20170309114213.GC3307@yuval-lap> References: <54750756-91cd-b508-109a-83b7b2375193@users.sourceforge.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <54750756-91cd-b508-109a-83b7b2375193-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: SF Markus Elfring Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Devesh Sharma , Doug Ledford , Hal Rosenstock , Sean Hefty , Selvin Xavier , LKML , kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-rdma@vger.kernel.org On Wed, Mar 08, 2017 at 02:15:34PM +0100, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 7 Mar 2017 22:34:33 +0100 > > The script "checkpatch.pl" pointed information out like the following. > > Comparison to NULL could be written "!dev->stag_arr". > > Thus fix the affected source code place. > > Signed-off-by: Markus Elfring > --- > drivers/infiniband/hw/ocrdma/ocrdma_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c > index 93113feeb2d5..fbf672c79d5f 100644 > --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c > +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c > @@ -238,7 +238,7 @@ static int ocrdma_alloc_resources(struct ocrdma_dev *dev) > > dev->stag_arr = kcalloc(OCRDMA_MAX_STAG, sizeof(*dev->stag_arr), > GFP_KERNEL); > - if (dev->stag_arr == NULL) > + if (!dev->stag_arr) > goto alloc_err; Reviewed-by: Yuval Shaia > > ocrdma_alloc_pd_pool(dev); > -- > 2.12.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932104AbdCILmh (ORCPT ); Thu, 9 Mar 2017 06:42:37 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:18049 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753450AbdCILmf (ORCPT ); Thu, 9 Mar 2017 06:42:35 -0500 Date: Thu, 9 Mar 2017 13:42:14 +0200 From: Yuval Shaia To: SF Markus Elfring Cc: linux-rdma@vger.kernel.org, Devesh Sharma , Doug Ledford , Hal Rosenstock , Sean Hefty , Selvin Xavier , LKML , kernel-janitors@vger.kernel.org Subject: Re: [PATCH 16/26] IB/ocrdma: Adjust a null pointer check in ocrdma_alloc_resources() Message-ID: <20170309114213.GC3307@yuval-lap> References: <54750756-91cd-b508-109a-83b7b2375193@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54750756-91cd-b508-109a-83b7b2375193@users.sourceforge.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 08, 2017 at 02:15:34PM +0100, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 7 Mar 2017 22:34:33 +0100 > > The script "checkpatch.pl" pointed information out like the following. > > Comparison to NULL could be written "!dev->stag_arr". > > Thus fix the affected source code place. > > Signed-off-by: Markus Elfring > --- > drivers/infiniband/hw/ocrdma/ocrdma_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c > index 93113feeb2d5..fbf672c79d5f 100644 > --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c > +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c > @@ -238,7 +238,7 @@ static int ocrdma_alloc_resources(struct ocrdma_dev *dev) > > dev->stag_arr = kcalloc(OCRDMA_MAX_STAG, sizeof(*dev->stag_arr), > GFP_KERNEL); > - if (dev->stag_arr == NULL) > + if (!dev->stag_arr) > goto alloc_err; Reviewed-by: Yuval Shaia > > ocrdma_alloc_pd_pool(dev); > -- > 2.12.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuval Shaia Date: Thu, 09 Mar 2017 11:42:14 +0000 Subject: Re: [PATCH 16/26] IB/ocrdma: Adjust a null pointer check in ocrdma_alloc_resources() Message-Id: <20170309114213.GC3307@yuval-lap> List-Id: References: <54750756-91cd-b508-109a-83b7b2375193@users.sourceforge.net> In-Reply-To: <54750756-91cd-b508-109a-83b7b2375193-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: SF Markus Elfring Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Devesh Sharma , Doug Ledford , Hal Rosenstock , Sean Hefty , Selvin Xavier , LKML , kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Wed, Mar 08, 2017 at 02:15:34PM +0100, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 7 Mar 2017 22:34:33 +0100 > > The script "checkpatch.pl" pointed information out like the following. > > Comparison to NULL could be written "!dev->stag_arr". > > Thus fix the affected source code place. > > Signed-off-by: Markus Elfring > --- > drivers/infiniband/hw/ocrdma/ocrdma_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c > index 93113feeb2d5..fbf672c79d5f 100644 > --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c > +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c > @@ -238,7 +238,7 @@ static int ocrdma_alloc_resources(struct ocrdma_dev *dev) > > dev->stag_arr = kcalloc(OCRDMA_MAX_STAG, sizeof(*dev->stag_arr), > GFP_KERNEL); > - if (dev->stag_arr = NULL) > + if (!dev->stag_arr) > goto alloc_err; Reviewed-by: Yuval Shaia > > ocrdma_alloc_pd_pool(dev); > -- > 2.12.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html