From patchwork Fri Jul 27 20:17:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland Dreier X-Patchwork-Id: 1250621 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E84DD40D58 for ; Fri, 27 Jul 2012 20:17:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752828Ab2G0URc (ORCPT ); Fri, 27 Jul 2012 16:17:32 -0400 Received: from na3sys010aog102.obsmtp.com ([74.125.245.72]:57010 "HELO na3sys010aog102.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752386Ab2G0URb (ORCPT ); Fri, 27 Jul 2012 16:17:31 -0400 Received: from mail-pb0-f47.google.com ([209.85.160.47]) (using TLSv1) by na3sys010aob102.postini.com ([74.125.244.12]) with SMTP ID DSNKUBL3WsLGVzAjT6Io8paDc0DLCRPBkDzi@postini.com; Fri, 27 Jul 2012 13:17:30 PDT Received: by pbbrq2 with SMTP id rq2so4935641pbb.6 for ; Fri, 27 Jul 2012 13:17:29 -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:x-mailer; bh=j3r18d2idNktG6eEETOSgNJBiQMLfwpbwC1CeFRIO/k=; b=GZFzKJ7ooBLqpwy1K8+d2LHblIoSiRZnUhiZr4k9/R5F4yjRYZ8Yq2Gaum+DgGT8IH 3H0P5SsLdZAywwF72kiq360S/YwSQvDlQuJ1axFSdNU+BCH7qQRfh3zdMB1oc4QevYKn k6XZ24H5jNxhVMp7mcjLSjwnurkjPltRdt0Qs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=j3r18d2idNktG6eEETOSgNJBiQMLfwpbwC1CeFRIO/k=; b=IL3xg60LX3h1Zgrwk+tHupGnWMbs9JYttCRFyDHZVI8z3tiitmCOrtA6Gubh8CtS2e A4nD1KAmqaZpHX+yX36OpB3mLKJFHWEQ642dMLBqxndzFuM3JMHXyKwLsMdBpPwDZ5kU 1Is3FwZImAa+vYTRQm1B1IZW+yXPGmHQGhSqubUQ+OfWuPLziRsOk7XXU2pchD6jaVNx wPsQmdQOkE5I8LVI02pU0OSFNjs7pulzDoVT6LjQM418CBiWQgCo1/0g/R0K/WvHK6R1 g9bU2SI7Oc9yP2XQqV062k4+u4K7QH+dMv/Tg7MoyM+tV6AhlI/WmUqtcGsmahwxHGkB Qbyw== Received: by 10.68.130.73 with SMTP id oc9mr12751096pbb.34.1343420249555; Fri, 27 Jul 2012 13:17:29 -0700 (PDT) Received: from roland-t410s.purestorage.com ([216.200.155.2]) by mx.google.com with ESMTPS id ru10sm2501643pbc.50.2012.07.27.13.17.28 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Jul 2012 13:17:28 -0700 (PDT) From: Roland Dreier To: Parav Pandit , Mahesh Vardhamanaiah Cc: linux-rdma@vger.kernel.org Subject: [PATCH] RDMA/ocrdma: Fix check of GSI CQs Date: Fri, 27 Jul 2012 13:17:26 -0700 Message-Id: <1343420246-12012-1-git-send-email-roland@kernel.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQmUmSYn7CNdMT4IVZQlHj+eMTIO4r9rW/rjERzgrfjJ4IK/yocIBTg9tZ39JZYETSeDnNkM Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Roland Dreier It looks like one check was accidentally duplicated, and the other 3 checks were left out. This was detected by scripts/coccinelle/tests/doubletest.cocci: drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:895:6-54: duplicated argument to && or || Reported-by: Fengguang Wu Signed-off-by: Roland Dreier --- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index b2f9784..cb5b7f7 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -893,7 +893,9 @@ static int ocrdma_check_qp_params(struct ib_pd *ibpd, struct ocrdma_dev *dev, /* verify consumer QPs are not trying to use GSI QP's CQ */ if ((attrs->qp_type != IB_QPT_GSI) && (dev->gsi_qp_created)) { if ((dev->gsi_sqcq == get_ocrdma_cq(attrs->send_cq)) || - (dev->gsi_sqcq == get_ocrdma_cq(attrs->send_cq))) { + (dev->gsi_sqcq == get_ocrdma_cq(attrs->recv_cq)) || + (dev->gsi_rqcq == get_ocrdma_cq(attrs->send_cq)) || + (dev->gsi_rqcq == get_ocrdma_cq(attrs->recv_cq))) { ocrdma_err("%s(%d) Consumer QP cannot use GSI CQs.\n", __func__, dev->id); return -EINVAL;