Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752983AbbLaXWb (ORCPT ); Thu, 31 Dec 2015 18:22:31 -0500 Received: from mout.web.de ([212.227.15.4]:64743 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751104AbbLaXWa (ORCPT ); Thu, 31 Dec 2015 18:22:30 -0500 Subject: [PATCH] be2net: Delete an unnecessary check in two functions References: <566ABCD9.1060404@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall To: netdev@vger.kernel.org, Ajit Khaparde , Padmanabh Ratnakar , Sathya Perla , Sriharsha Basavapatna From: SF Markus Elfring Message-ID: <5685B8AD.7010900@users.sourceforge.net> Date: Fri, 1 Jan 2016 00:22:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <566ABCD9.1060404@users.sourceforge.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:yai/Zqa7rXYwQ6QCBlXIiIBNqgTWSEv88/vcoBfv5SZek0KOb0I R1w5RmkcDnq8ybRB6Fxfm4fMLr5qpxxdHJ6nRE/rNELAYBMQQT+q2c2lrWIUKq6SD155YpY fKe30nvNsEGCcdygNUpP9AyReQZNI2tiqs9+5LMisI/ZBGJwbewvahDgV27g5CDuOAa9nxd JShz0czN6ZE6mYvrLvSFA== X-UI-Out-Filterresults: notjunk:1;V01:K0:K7pS/puIhl8=:81vU+o8OCfoq319WfEXTMm jI76OhxqU3m+/93vSEjefhggm34oMz6xlgoU5MdKhiaD4oYllA1aZ8/l6uhemwOapouNAWqX5 nBjGF7rOnYjiU3NHBpo4O4oHanXiJ5xYjc8ruCobQeWl4X7jmEDes2hD4e/46e+Ag7LWEqgbQ O7hH98opVda56tK6D3b8FPiBQCvPU0WpZ2XMj+mpnce9YwfQXRT7ESUjYFiCZl3G9ZhAxmhAA SgcAlOJDKnh0FP53rnc5tAb0dmpdM1/UqfvGhpLohz7Yz/gHTx4VQg4IEyHqoIJ4sE8yAEti1 bNcMgJf0onIVJ8697yCBMkhYdNWTTRFTrZg3dZ+/EFx+tMb7fSME4NLvSHKHv+YvMmaS3YnRg VbiTD5+bRhvnlzMQrbAumqTzXf43lERXdzabNpXYun0pWXmybYE0lovHTh9VybaxC78kFCILZ K1AkOgc8vFNiKvkuOexCgOwTh0wtNYXIWl3bWDomGQjjWhXfl4s9rfAv/2oJ8fMdZfuRhkuNj Sjsa2aBTskMZZImAyadYVp2kjnXdH9LPgujGZdx27vSe6vwVi7XuPp6xObm50nx4HqgVBbcc1 x6pt6YjJ5BE58EyzumJSPa8HHSBRB3c3dd9z0xFT3qig7eNHblhBChvvqBvgEk1fardL6F01j NtbTIyGQ1O40kNs6KNIGOkEgf9TzizQKFJYFoLkLbCz3c72i8MOqm5gmANi2NusrqE9weKU/V Ty7s9HKwuBouNgLUQAOxj5+lkNbM/vnWv6Vt72mWJQ8teUkvEb3g5bbbkevhF41jMTWg+tzXs oa7IS6T Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1540 Lines: 46 From: Markus Elfring Date: Fri, 1 Jan 2016 00:11:57 +0100 Remove two checks for null pointers which would be handled by usual error detection before. Signed-off-by: Markus Elfring --- drivers/net/ethernet/emulex/benet/be_cmds.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index b63d8ad..ba98297 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c @@ -4366,9 +4366,7 @@ int be_cmd_get_profile_config(struct be_adapter *adapter, if (vf_res) res->vf_if_cap_flags = vf_res->cap_flags; err: - if (cmd.va) - dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, - cmd.dma); + dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, cmd.dma); return status; } @@ -4398,10 +4396,7 @@ static int be_cmd_set_profile_config(struct be_adapter *adapter, void *desc, memcpy(req->desc, desc, size); status = be_cmd_notify_wait(adapter, &wrb); - - if (cmd.va) - dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, - cmd.dma); + dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, cmd.dma); return status; } -- 2.6.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/