From patchwork Fri May 12 20:00:29 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: 9724853 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 9CC03600CB for ; Fri, 12 May 2017 20:01:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90C3228883 for ; Fri, 12 May 2017 20:01:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 853E12888D; Fri, 12 May 2017 20:01:11 +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 07CF428887 for ; Fri, 12 May 2017 20:01:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932963AbdELUAt (ORCPT ); Fri, 12 May 2017 16:00:49 -0400 Received: from mout.web.de ([212.227.15.3]:55300 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932439AbdELUAs (ORCPT ); Fri, 12 May 2017 16:00:48 -0400 Received: from [192.168.1.3] ([78.49.9.109]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LetUF-1dnr163UI3-00qmKP; Fri, 12 May 2017 22:00:31 +0200 To: linux-rdma@vger.kernel.org, Christian Benvenuti , Dave Goodell , Doug Ledford , Hal Rosenstock , Sean Hefty Cc: LKML , kernel-janitors@vger.kernel.org, Wolfram Sang From: SF Markus Elfring Subject: [PATCH] IB/usnic: Delete an error message for a failed memory allocation in usnic_transport_init() Message-ID: Date: Fri, 12 May 2017 22:00:29 +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:sNQ2ba2+C5xGT2Hxr3BXMxgLJJvSbLEIdUVBarGhg5p7d9wQ2MR hpQkYi209p1G9uRJ5xlsaXIA8s+TWj+a1Q9ne+jN65S/BtYt2mVDDiVEJmrM3CXZkE09B3/ jfsF7jwEJDl9UpxB/EbkrvQBx6DQ3yM+uxvyIVhUs87tCYYnjrxTmyGsIJK9qsZa0Xb0B96 vifdFhzKexWBWlyvn0kOg== X-UI-Out-Filterresults: notjunk:1; V01:K0:/RnAXcSGhwQ=:n242857v77+hNNGjh/6QI3 KAoc67Ws5l7H2wR8Ix5SLb2moZOO0QTpzvxSUAQCf2d5D8VsHk8zKICRSoPrWKc1DkWZbkce5 z81wwUBakZM4y0pXwr5u+F5pBmBfKVrl5WP1m2s8qeoWiuAKGbhmdHK0SWUkJQJntJBIypd7a w98cZMQJ2KtYYPdD7RhJPNL9Ykx4dYD5MtJS9iHUOPkzWHFpU5OQlZ2ENFKF70j6LL1Xy/Ufm SG6kHhkFqOc6DHkktBOAi0VahuSeQxLKz4Jy+PeotWxac9ERUOy5aQQyQzvJW9J7fCJbhqnXG fYDy/ul/v3oyzVa4vbZjjr67SxlFp82LZ2JGxvdrxnQMHc63XwmN/Jy9PHb7Hhd9LDWMxuWHm 2YEPKXbKU+ktc4r4NRvNZY1uJ/rDWkbhtmclztMGVaUZUOHjwMkpuMa/Br0jplq018xv8TyKT Oz7G0XoURfzeW5jbn3epwwSI1hHYtC76/KqcgoayAUIOD7Sq7wnhw3kIIzB2ooyG4FTFb5VFd 1hNz1NAR4NlZHpn28GI4JmkyfQHAtcbB6wvOb3gRZ8+CUV59CyfetlUzq4Uhn8WKkmprCFtyl g6H8pB4DRz9WQjACXnWJDoqgojHRTmC5ECGmOLz8tZRKsTp1P63onQQfCcJ1FlXb0UcbxPQSp DhC4BgMpNkuLyLLuBm9GtqJjoZKVYvLsY2kcVP19N+7+VVc25wVnBpqWJFNC82UFGy7ackf6B xMUUS+oyQyyV7cq1RypiZtkRMHMssIvxe/r+6yMCQbp8KEkMYNzJt/WZVM92BJH2sEDTNIJtW QQfjNGD 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 21:53:51 +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/hw/usnic/usnic_transport.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/usnic/usnic_transport.c b/drivers/infiniband/hw/usnic/usnic_transport.c index de318389a301..2e9bba52a686 100644 --- a/drivers/infiniband/hw/usnic/usnic_transport.c +++ b/drivers/infiniband/hw/usnic/usnic_transport.c @@ -201,10 +201,8 @@ int usnic_transport_sock_get_addr(struct socket *sock, int *proto, int usnic_transport_init(void) { roce_bitmap = kzalloc(ROCE_BITMAP_SZ, GFP_KERNEL); - if (!roce_bitmap) { - usnic_err("Failed to allocate bit map"); + if (!roce_bitmap) return -ENOMEM; - } /* Do not ever allocate bit 0, hence set it here */ bitmap_set(roce_bitmap, 0, 1);