From patchwork Thu Dec 14 22:35:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10113391 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 7C7E8603FA for ; Thu, 14 Dec 2017 22:37:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EAB229D23 for ; Thu, 14 Dec 2017 22:37:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 638E129D29; Thu, 14 Dec 2017 22:37: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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 0A99B29D24 for ; Thu, 14 Dec 2017 22:37:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754168AbdLNWhJ (ORCPT ); Thu, 14 Dec 2017 17:37:09 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36337 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753990AbdLNWhI (ORCPT ); Thu, 14 Dec 2017 17:37:08 -0500 Received: by mail-wr0-f194.google.com with SMTP id u19so85782wrc.3 for ; Thu, 14 Dec 2017 14:37:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RvmhCuqk75VSzNsWyPF9+8DQXu6vFNqHmKD6HCVybjQ=; b=AkGMR35hnXkVE9EkzJZTO+l4IRqev4VwGMPdPPzHL8uv0U//OhLFFqGGvU9XJTstkF z3pHGAEJUHf6ve9s4QNf4YM8R494UctrL4Tlfht8Uw1hsn20NWOZ6NyAd6aZnAUcUtn0 GdqLtFCT5E41wt3Jm8lItqT3P3M70vaXzetvCtzNgK+bp7z35Czbh1MbdsUMC/5uLhXJ FRhaM8g8X3orcZPoR5zGzFO/EVeaHDsPzCtoQIrzYm+7ZJlYPqcPobWmSXx0oj4iqV/6 hVQsc5p/a+38qIqDHnqDqQb+l09ib0WczlnuJAMu5mUbKEhMZu/1pevmpdzQxwZmPy8D s1BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RvmhCuqk75VSzNsWyPF9+8DQXu6vFNqHmKD6HCVybjQ=; b=UcumiTUkEMvbV6CjFLr0JaedAEBN3HOh41bwxiv8CTxwXw6g0NEJIA6xhMpEXkwi43 Vfrif6OPaRJ/Arn0XnCRln2RRSA2gFzNBhZOpr3evfB9QWQ6fEJfGsaMrZsM/Zg5kk+6 LpxVJKFxYr2R1BzQ/dCaBcyjpmCh/A0fEWkwPNpfiL2ptk31Bgub8em9LT5rN9Tz/bTB wGMjKhJwdB9LuNRnqOU9Da6LyqGp6VjEjr8QuJj2rxBTM9auYY1oQrFJQqNFg6Onjr0g FpFzpnql7bQZYWVL38h+Rod1ikHpkEmF0vtwQzudPrCM6XzooDQMHDOwcDwtQkpzbYe0 bLtA== X-Gm-Message-State: AKGB3mIzhOBaMfSHyjuJM1Wwf/J4SYci8rchfFH/3vBt/yv3FoNeHrOy X724Rody0PqRRBp25HH/FkjEoPzgL+c= X-Google-Smtp-Source: ACJfBovbfyX6tCt5PE8SAU/HptRqlHf3DnaEpA3TkQrcOA2Td33g5WDmjstP5wXC2xUZgvK8mcI8sg== X-Received: by 10.223.143.50 with SMTP id p47mr7242765wrb.104.1513291027223; Thu, 14 Dec 2017 14:37:07 -0800 (PST) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [70.74.179.152]) by smtp.gmail.com with ESMTPSA id 127sm8651266wmk.14.2017.12.14.14.37.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Dec 2017 14:37:06 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1ePc7k-0007uY-9J; Thu, 14 Dec 2017 15:37:04 -0700 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 3/5] mlx4: Don't nest container_of Date: Thu, 14 Dec 2017 15:35:41 -0700 Message-Id: <20171214223544.30117-4-jgg@ziepe.ca> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171214223544.30117-1-jgg@ziepe.ca> References: <20171214223544.30117-1-jgg@ziepe.ca> 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: Jason Gunthorpe Makes no sense, just use the full path to the substructure member. Signed-off-by: Jason Gunthorpe --- providers/mlx4/mlx4.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/providers/mlx4/mlx4.h b/providers/mlx4/mlx4.h index ef0c7cb9c9a733..a71e42f5c6e25f 100644 --- a/providers/mlx4/mlx4.h +++ b/providers/mlx4/mlx4.h @@ -275,14 +275,12 @@ static inline struct mlx4_cq *to_mcq(struct ibv_cq *ibcq) static inline struct mlx4_srq *to_msrq(struct ibv_srq *ibsrq) { - return container_of(container_of(ibsrq, struct verbs_srq, srq), - struct mlx4_srq, verbs_srq); + return container_of(ibsrq, struct mlx4_srq, verbs_srq.srq); } static inline struct mlx4_qp *to_mqp(struct ibv_qp *ibqp) { - return container_of(container_of(ibqp, struct verbs_qp, qp), - struct mlx4_qp, verbs_qp); + return container_of(ibqp, struct mlx4_qp, verbs_qp.qp); } static inline struct mlx4_qp *wq_to_mqp(struct ibv_wq *ibwq)