Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751822AbdCHPMs (ORCPT ); Wed, 8 Mar 2017 10:12:48 -0500 Received: from mail-wr0-f176.google.com ([209.85.128.176]:36481 "EHLO mail-wr0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750742AbdCHPMo (ORCPT ); Wed, 8 Mar 2017 10:12:44 -0500 MIME-Version: 1.0 In-Reply-To: <20d97719-3d3a-62f6-a249-f39cf528c5e9@users.sourceforge.net> References: <20d97719-3d3a-62f6-a249-f39cf528c5e9@users.sourceforge.net> From: Devesh Sharma Date: Wed, 8 Mar 2017 20:33:04 +0530 Message-ID: Subject: Re: [PATCH 15/26] IB/ocrdma: Delete an error message for a failed memory allocation in ocrdma_add() To: SF Markus Elfring Cc: linux-rdma , Devesh Sharma , Doug Ledford , Hal Rosenstock , Sean Hefty , Selvin Xavier , LKML , kernel-janitors@vger.kernel.org, Wolfram Sang Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1345 Lines: 35 Acked-By: Devesh sharma On Wed, Mar 8, 2017 at 6:43 PM, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 7 Mar 2017 22:23:17 +0100 > > Omit an extra message for a memory allocation failure in this function. > > Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf > Signed-off-by: Markus Elfring > --- > drivers/infiniband/hw/ocrdma/ocrdma_main.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c > index c49b4491d4e7..93113feeb2d5 100644 > --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c > +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c > @@ -304,10 +304,9 @@ static struct ocrdma_dev *ocrdma_add(struct be_dev_info *dev_info) > struct ocrdma_dev *dev; > > dev = (struct ocrdma_dev *)ib_alloc_device(sizeof(*dev)); > - if (!dev) { > - pr_err("Unable to allocate ib device\n"); > + if (!dev) > return NULL; > - } > + > dev->mbx_cmd = kzalloc(sizeof(struct ocrdma_mqe_emb_cmd), GFP_KERNEL); > if (!dev->mbx_cmd) > goto idr_err; > -- > 2.12.0 >