From patchwork Mon Jul 27 21:43:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland Dreier X-Patchwork-Id: 6876871 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6700DC05AC for ; Mon, 27 Jul 2015 21:43:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C9D620718 for ; Mon, 27 Jul 2015 21:43:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8E9D920710 for ; Mon, 27 Jul 2015 21:43:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752768AbbG0Vn3 (ORCPT ); Mon, 27 Jul 2015 17:43:29 -0400 Received: from mail-ig0-f180.google.com ([209.85.213.180]:37342 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750915AbbG0Vn3 (ORCPT ); Mon, 27 Jul 2015 17:43:29 -0400 Received: by igbpg9 with SMTP id pg9so96173514igb.0 for ; Mon, 27 Jul 2015 14:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google; h=sender:from:to:cc:subject:date:message-id; bh=hYNEndIi2NC9RzKw4n3VfJKoeYuKZ9S/hS5mjWE/rJY=; b=dRHr8/BWfdXPsKJpimqzI/beUUuN26o8MflJbiNSPZPsKAAe1G2FrleEe5deR7Tyvo x3ihpgaMoMfYMaPhYZsi2mjS3/ywfIqmyDRw9I75CNn4gBc9Ff4X/RIMPkHQFoSUkyCE 79Iy2gDLaQDMCq7Ac+QoxxVgiQh09By43FrMY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=hYNEndIi2NC9RzKw4n3VfJKoeYuKZ9S/hS5mjWE/rJY=; b=PhxQ5Cd0YqBIMtSyT2DlCETg5rB2xeUkmR0tewsqeye2O9u1rUxiq02ECxQMH7oSRO 9c2tXmsoSkrulS34AhAhpPOso8Aqo1wDkOh53oMnUagmcrMdvogZ5JFVRq89Xbkmd8FZ Uigvt9iVW7y4RLT7JQDcAYWBdViIkhAJr62M1R1FtjGhI73AiJe+35A2blrbc7B5/gbd IBHkOOUVWkzy9JQOvIxxRRJAG/AgidyYSLfBJY2COL+MgFikjEBlMNkFVLeDCi1Yf3JA 92l3oRER0nB87N7cCGQtmwADaFrGYAsGLHAtPuZECTkWyi2ixoiMIauJdmOYGFOQuweQ JS6A== X-Gm-Message-State: ALoCoQmA5Qj/tczvdeZMg8qFE05zIGFcN6CU86AapcJiPlc2kqXiPGFO/4qjOcBU4gdI8l7qTxKr X-Received: by 10.107.160.2 with SMTP id j2mr52673368ioe.127.1438033408555; Mon, 27 Jul 2015 14:43:28 -0700 (PDT) Received: from roland-t440p.purestorage.com (50-206-43-50-static.hfc.comcastbusiness.net. [50.206.43.50]) by smtp.gmail.com with ESMTPSA id k19sm12808243iok.20.2015.07.27.14.43.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Jul 2015 14:43:27 -0700 (PDT) From: Roland Dreier To: Doug Ledford , Eli Cohen Cc: linux-rdma@vger.kernel.org Subject: [PATCH] IB/mlx5: Remove dead code from alloc_cached_mr() Date: Mon, 27 Jul 2015 14:43:23 -0700 Message-Id: <1438033403-13129-1-git-send-email-roland@kernel.org> X-Mailer: git-send-email 2.1.4 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Roland Dreier The only place that assigns mr inside the loop already does a break. So "if (mr)" will never be true here since the function initializes mr to NULL at the top. We can just drop the extra if and break here. Signed-off-by: Roland Dreier Acked-by: Eli Cohen --- drivers/infiniband/hw/mlx5/mr.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index bc9a0de897cb..10d2b213a4d8 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@ -441,9 +441,6 @@ static struct mlx5_ib_mr *alloc_cached_mr(struct mlx5_ib_dev *dev, int order) spin_unlock_irq(&ent->lock); queue_work(cache->wq, &ent->work); - - if (mr) - break; } if (!mr)