From patchwork Fri May 12 20:34:20 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: 9724865 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 1BA3860348 for ; Fri, 12 May 2017 20:35:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 136BE2865D for ; Fri, 12 May 2017 20:35:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0664B28895; Fri, 12 May 2017 20:35:02 +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 860502865D for ; Fri, 12 May 2017 20:35:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758161AbdELUer (ORCPT ); Fri, 12 May 2017 16:34:47 -0400 Received: from mout.web.de ([212.227.15.14]:51056 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757989AbdELUeq (ORCPT ); Fri, 12 May 2017 16:34:46 -0400 Received: from [192.168.1.3] ([78.49.9.109]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MT8cQ-1dY7uy12l4-00S5tK; Fri, 12 May 2017 22:34:22 +0200 To: linux-rdma@vger.kernel.org, Dasaratharaman Chandramouli , Don Hiatt , Doug Ledford , Erez Shitrit , Feras Daoud , Hal Rosenstock , Ira Weiny , Leon Romanovsky , Mark Bloch , Paolo Abeni , Sean Hefty , Shamir Rabinovitch , Zhu Yanjun From: SF Markus Elfring Subject: [PATCH] IB/IPoIB: Delete an error message for a failed memory allocation in ipoib_dev_init_default() Cc: LKML , kernel-janitors@vger.kernel.org Message-ID: Date: Fri, 12 May 2017 22:34:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 Content-Language: en-US X-Provags-ID: V03:K0:/P0CfLeAlpnRwf16l2W7Vb+PWQLuJiFt2EmYyD/1HIZS7Lu4Cd+ lGWpFQAf41d9lYflMbeafiq4v8HEXCt66yEgdtC0b9kPow0wruic9HimM0uhqfGpJvp7cS5 0LdA+zzNkbCn/8KMZHv/fasiof91FE+qhrZQa68Sb3+RnuFcIL6IAJx46KOjzySVLUUdchE 7YbHB2LBmyyg3DFn7bYOA== X-UI-Out-Filterresults: notjunk:1; V01:K0:mvUO5fPJZdw=:bNpAmYGOHbp/R4vC4qGzN6 NF7toy2EBy6dYfsRKp8/2qGHqe2gRQpeNbZShe9cVrT00wqZVuqO/0ftJHkNo6bwi0eNTrThY ElTj06jDNARtF1YwbJkqsJlFehTrviXM87sJPj6usj8jtyB7vFiFxHLRulJWTRNinhxC8L65X aXYcZRwXi0r6wSqrrMRE1XeOibDKflf8LL81U8ehzO1aQv89Mzcy34KyUwlBaJ3HFQZ5wS69t 5v4mArrN2kEjADj6oNyyFXfI+j+MEfzFSihtKQlsmECk/oBwJvFAkFvyHUcQFOAYgJPG+tpAK +swOFqQllSdV4ygKb3er3D8eVRZaUeYW9kalKWuohuZpe7EdC5TIKHJrzyPrjC06xcCVKj1DZ cvb3OyFiU1Ft1VukqDcrMe8zuPp1M811urY5+XGqxOl0ZePbbcnfz2Pm4MdrqfZ3XyVgtVSpt JCJR3vtQJaaaVT/cC6dxl4kCd5FH5f1ky0nmIR3MdQ1A0jkPZPh2nUvfd1UW66erl4+A9P7RK bWDiGFS35FAFPc6CMmFkag9Nv5kKg6MY+oUTnkEVYSKTJmr7yjIAEfrl6RYFR1n+eJCpWR2IG ILISA1Jd64h1UD1WtnxgN7fxoaaTIpWNyfBhb+6vUOt78BxWehYyaMrR0f5XnT0t7IT1D1U8b gGhfhg7OebT9mO4L/3GjPhW5EYh3cVZBS66bKAhJzU2NjZdX4ja7RCJC7Fc2+AiV9koD0pLIS D90DUCrptcozgTGMCG3O6nTFMYn3Uxn5ajnNgJr9yFRIKe3HZwE7gf+HZaxjL/Ia3xJNP9UIO 0lk4v70 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: Fri, 12 May 2017 22:22:43 +0200 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring --- drivers/infiniband/ulp/ipoib/ipoib_main.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 2869d1adb1de..e31237af2d57 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -1618,11 +1618,8 @@ static int ipoib_dev_init_default(struct net_device *dev) goto out; priv->tx_ring = vzalloc(ipoib_sendq_size * sizeof *priv->tx_ring); - if (!priv->tx_ring) { - printk(KERN_WARNING "%s: failed to allocate TX ring (%d entries)\n", - priv->ca->name, ipoib_sendq_size); + if (!priv->tx_ring) goto out_rx_ring_cleanup; - } /* priv->tx_head, tx_tail & tx_outstanding are already 0 */