From patchwork Sat Apr 22 14:48:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9694421 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D2CBD601E9 for ; Sat, 22 Apr 2017 14:50:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5DCE28174 for ; Sat, 22 Apr 2017 14:50:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C88E228450; Sat, 22 Apr 2017 14:50:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58FE228174 for ; Sat, 22 Apr 2017 14:50:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424646AbdDVOtn (ORCPT ); Sat, 22 Apr 2017 10:49:43 -0400 Received: from mout.web.de ([212.227.15.4]:51246 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424688AbdDVOtH (ORCPT ); Sat, 22 Apr 2017 10:49:07 -0400 Received: from [192.168.1.2] ([77.181.100.232]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M7VZv-1c76MI1mL9-00xMHi; Sat, 22 Apr 2017 16:48:49 +0200 Subject: [PATCH v2 08/12] IB/ocrdma: Delete an error message for a failed memory allocation in ocrdma_add() From: SF Markus Elfring To: Devesh Sharma , Doug Ledford , Hal Rosenstock , Sean Hefty , Selvin Xavier , Yuval Shaia , linux-rdma@vger.kernel.org Cc: LKML , kernel-janitors@vger.kernel.org, Wolfram Sang References: <1492720999.3041.18.camel@redhat.com> <86425035-7da8-d2b1-8544-d4f7540d50c6@users.sourceforge.net> Message-ID: <9d2f449c-bbb9-6ec5-b4db-279f125abf7d@users.sourceforge.net> Date: Sat, 22 Apr 2017 16:48:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: <86425035-7da8-d2b1-8544-d4f7540d50c6@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:m6FkGF2cWsz1GRW54exJc7dJbjX6OAiwh+No9y4mUZ+1MaMjbfB rf//c28SnBIOirFBYx8MxZRhrDSLKAb5Z5Rmole9F0HlFoKoID8VHogRW1vG9AiArd1OeHy dzXO2ktSGK1+fKu6S42nUpzXo81nrBlQHDpJ7//FIo8lssCOnes8frmMdymfWL4cje6EWxs amMUMqhphJwwODdbI/tcA== X-UI-Out-Filterresults: notjunk:1; V01:K0:i2/lmSanbA8=:kpB1b6MnVfOxR0NMhf6cZY w9LBt8HZyabaNqvqDuAfiKdbsP48k30PrVlPr/oEyA2LJIFgPvk+EdgXXMBnNjz8J7iuOGRMj ziyMb4ggu3g3sazVv8So/Vb9cax4bDkuO/SVYMjDWyJ84jodbkDPznuB/VOQ8TdAfdNsHwB0k T2wu/vXqclZMaTNRJsdRZ/FzR5PGkvPEsK0ndYNan7pUhFatkI0IkDZZhX/5sKBBzHHTP79O0 uD859PkkQM2GRF3cuFU+kDkq0Sn9IdOX+2kLCO3NxwmYW7EYGQtn4wLLKt/wHg0YdhxkImlAe HAhX+VRs2xiudIYKKCIG/hTEk6ER/wBY87m8LvpOWtvrGonmOrG9gecU5kWZgA9eRO0oisE/J V54GD0g5eqE6Mfah6tDFoHD0ahF4WT3RQk1lklguhykAEh52gx+mzKcGhcYl4BOi6nCaZfWkB vCW5zD10cbbyOhhVR+rSMLztB/SYnUagzJDeCtbLp+obPIZtWm8hYfV9tZCw6TX2nafXcE0J1 +vlNCsMfeYNvM+y94W91n/mcyq3DYRdOmQGtn4WYOVmZZ1yPA8vU80QmD370dsKBt+pUTPkf3 w+pp1cR5TeWgGPoeIPbZHatvWXufKcSCVjNucfoL4iVH7F7AxxmpVIzIqcOueqg0+LCG2d0Hl E387ScZXr4hpUdqET2OKYDu8F47IL3tU/ASiiSI7fLB84GK1beQtZ+yah4ocj2ND6HJzWM5G1 baJrhpX9dzrtKg17pDIvJzy49l4KTdePA1Lg6+/UOHMui8EE7SZRUHHMaxxkH6v+F/csaw5c2 bjk6Nbi Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 22 Apr 2017 14:36:30 +0200 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 Acked-by: Devesh Sharma Reviewed-by: Yuval Shaia --- 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 b82f6c6942e0..d3942558b083 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;