From patchwork Wed Mar 8 13:13:11 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: 9611119 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 372DC6046A for ; Wed, 8 Mar 2017 13:30:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F35DE281F9 for ; Wed, 8 Mar 2017 13:30:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E808928574; Wed, 8 Mar 2017 13:30:30 +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 A094B281F9 for ; Wed, 8 Mar 2017 13:30:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753291AbdCHN30 (ORCPT ); Wed, 8 Mar 2017 08:29:26 -0500 Received: from mout.web.de ([212.227.17.12]:57640 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753395AbdCHN3P (ORCPT ); Wed, 8 Mar 2017 08:29:15 -0500 Received: from [192.168.1.2] ([92.228.144.238]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MUnYm-1ckdRV0xIq-00YCFH; Wed, 08 Mar 2017 14:13:13 +0100 Subject: [PATCH 15/26] IB/ocrdma: Delete an error message for a failed memory allocation in ocrdma_add() To: linux-rdma@vger.kernel.org, Devesh Sharma , Doug Ledford , Hal Rosenstock , Sean Hefty , Selvin Xavier References: Cc: LKML , kernel-janitors@vger.kernel.org, Wolfram Sang From: SF Markus Elfring Message-ID: <20d97719-3d3a-62f6-a249-f39cf528c5e9@users.sourceforge.net> Date: Wed, 8 Mar 2017 14:13:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:oHd731JgU78y4RmfmVlSL/BG4V+tGa48okTzMOs+QIuCAy2I5zW mhGjeWsyKn5hHaG7GkkzSP4ry6Se/WtXfJgzSyAGHOdWVU7TtyU2Yupjyi2rA19/UH/u2XO 8IM6JxfL6U/W0plOIWf9RMc5iLrrQ2G27LohnVbQe05vYRlION9JKM9f+kL7u6HBbcdsSkN UsVQ48S2RgYDZNH/TTA6g== X-UI-Out-Filterresults: notjunk:1; V01:K0:HzAEctbsn0I=:bGy3JluMpdGq9medelf0Bf 5H1xNIxF0cWIEZzYCxyeNMMpqg4ErJmT8iwcsBSyvOu9u5+ZXhvke+3Ay//J06oBqZmkK/dl/ 6SX8AeQdJj3mKY4+ihvZ73abjhKr53sub2hGrxD3nIeB2FFQKlSbatjuL+anmVc6Yw3HvqGoH ctLmGaRReh93+MgnYWwMrLKzMxZ+dOjDGE2Jse+sPtJd31gxnMdzapTwjKBqeEZAo4dBUZnr3 qphVPKzEWg9iEfpDYkNIQ6absmmVpRb1XK7nP4u8J6+dyE37PX+Uw0uEKUE+MKR2c8Sa783vd W+pai51pgnQZv/jhsB+zHFsvqt+qloisc4FGJsuDDZNPu9juOSVkkU8QMugWSee9J6CAvbZlE PbKOT6zu3whFyvzOprTc6ENmpNL7InT7A9n/pul6XdCT9uBBPrhrozXkFG+/7op0At7yCgnpV qyCG/RRuYT9nWsVn8xH4V5uXnlYEaEIQnW99inmFmtyiRYLgiN4NiBLJu/pxx5wZ89TiuiEkD fCH38E0XPxApvIFme0X5lAxzxJlRI7n5MbNmJwoJ/zirkyKwJGYTYpIyjMbMUgUqOufZ3gyZ/ W6hVsXNEHU+aBIGzecg0kq/EEw8x5CkMntPIj1U2TQOtziJ0LW2ClRqv/LMap+d34QnmqMZUE jNVeQ4+pmj8mj7/41enTU2orZhS4KKmOCSy2VFt9uVD5TXLgdQBF+mem7GHxjy1Vs6o2pc5k0 npCXUTnlcpmj8NrCSIcqJsWKc96ybTJWc3b1yAkZROHug1yPpa9cr/B6nJdbqVzDt9tWKpd8u HO5Q1Qc 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: 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 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 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;