From patchwork Sun Mar 21 15:20:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doron Shoham X-Patchwork-Id: 87258 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2LFKTHH026096 for ; Sun, 21 Mar 2010 15:21:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753326Ab0CUPVM (ORCPT ); Sun, 21 Mar 2010 11:21:12 -0400 Received: from fwil.voltaire.com ([193.47.165.2]:26074 "EHLO exil.voltaire.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753261Ab0CUPVL (ORCPT ); Sun, 21 Mar 2010 11:21:11 -0400 Received: from dorons.Voltaire.COM ([172.25.1.161]) by exil.voltaire.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 21 Mar 2010 17:21:10 +0200 Message-ID: <4BA63949.90509@voltaire.com> Date: Sun, 21 Mar 2010 17:20:41 +0200 From: Doron Shoham User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Thunderbird/3.0.3 MIME-Version: 1.0 To: sashak@voltaire.com CC: linux-rdma@vger.kernel.org Subject: [PATCH 1/4] sim_ctl_get_portinfo: References: <4BA6391A.7020608@voltaire.com> In-Reply-To: <4BA6391A.7020608@voltaire.com> X-OriginalArrivalTime: 21 Mar 2010 15:21:10.0273 (UTC) FILETIME=[22B69F10:01CAC90A] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 21 Mar 2010 15:21:12 +0000 (UTC) diff --git a/ibsim/ibsim.c b/ibsim/ibsim.c index e720f0d..9326d37 100644 --- a/ibsim/ibsim.c +++ b/ibsim/ibsim.c @@ -318,10 +318,8 @@ static int sim_ctl_get_portinfo(Client * cl, struct sim_ctl * ctl) uint8_t port_num = ctl->data[0]; if (port_num == 0 || port_num > cl->port->node->numports) p = cl->port; - else if (cl->port->node->type == SWITCH_NODE) - p = node_get_port(cl->port->node, port_num); else - p = node_get_port(cl->port->node, port_num - 1); + p = node_get_port(cl->port->node, port_num); update_portinfo(p); memcpy(ctl->data, p->portinfo, sizeof(ctl->data)); return 0;