Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3969986rwe; Mon, 17 Apr 2023 06:19:38 -0700 (PDT) X-Google-Smtp-Source: AKy350ZYkDWCjKzq+4QBRnq/0bLYN28qAz0ahPJdLd4XzHEu7D2TBYpqxOfBt81RRYMHjtHv8l+h X-Received: by 2002:a17:902:d4c5:b0:1a6:74ce:9bed with SMTP id o5-20020a170902d4c500b001a674ce9bedmr15799864plg.46.1681737578573; Mon, 17 Apr 2023 06:19:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681737578; cv=none; d=google.com; s=arc-20160816; b=sJHkwNlX+zHQx90IFP8yJzaqrZuZSh4GiTTuuWIeGLm2nsKQwpti23Ji4QPnux7oom wogR2lSwYHYpIw4Gz19wLulMFViLyCGq6Z9QLhPmQxWcY5FQ/TIM8YOvL2xFuyADMJCw 2KLmUOWoGOHakdp2M7cyjb2b9iNkqeCQ/2PrjvmExMSld4/OVuyPp3K0I1qjPZ6nOJqO fRDQ32l34vt18P6RhZSloS3b1e3KQwJ9f7FKAaa4XUprW6oG0uA+2AhT1fCuKltjtA4h 37H/xkmd8Znb/lr2y+xkSd2B5ERFP2m2N/gh4W9Fl3JT5rSDYfntCfHJ3mU5wx0/RuKH wM8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dVWUzJnRy08VVgMndpn0WdUv18W2Qb6Bz4zHOVYFwYs=; b=MK0iA8U/ozKYDU18Y08NoYfsQ8TKgbozUcsyn1CQx8+5Wd7Z4+fzOZbvuNLf9ySUkV M4lLaqLjRkBFob/F5S70u6hHdyMNdcoAcQPI6E7W8wyOxjU2esCFeK6HSMxbFoF8+pOz tHs2aAcN1iwnYvqNfs0Ipc6NP2MBS37LcIzJrymhrKbpqwR6tlKTjhQF8J/DRLoR2GqE 4P8Q6PcpI5Zadj9hnZYTZfzd80BGFyXX4ejtLLQSkxt4Athee8jJy3dpkVHgefBfnHej df0lDKUo6kPfvuoV/WxGxYYyvAvyRv5+e39Uqg+9VYdeklFr3g2DjJVsb0bALaYZfhsI MGRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=LjHiIXIo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lt4-20020a17090b354400b002474fcf3bdasi7410074pjb.146.2023.04.17.06.19.28; Mon, 17 Apr 2023 06:19:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=LjHiIXIo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230051AbjDQNTQ (ORCPT + 99 others); Mon, 17 Apr 2023 09:19:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbjDQNTO (ORCPT ); Mon, 17 Apr 2023 09:19:14 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C82AAF14 for ; Mon, 17 Apr 2023 06:18:46 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id d8so374795plg.2 for ; Mon, 17 Apr 2023 06:18:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1681737526; x=1684329526; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=dVWUzJnRy08VVgMndpn0WdUv18W2Qb6Bz4zHOVYFwYs=; b=LjHiIXIoSC7KnPtzz18g3IvlyAxMo9XWmIpjRVqmn45bMUfDETMVByhWaXEMLdTTUM mwekRDx/bT4o0pAG3AuDLmUd7qUAlq9sXJ+IkPy+hrGdTjQPGoFX5eucRj9C/1bU/xnK 25IWGiZyoPZptHZlBZy6impX2Pns0ufaBwMQEXAfVeUzY8XZFOHXxNhBPDYbUAWPzt6g Uscz998bMGfH/Mhud8KqytGqj92Lfi+1rvWIBFOuieFpodAoMQuPd1fpdxzhMllmz/Ii NWgPMTtFTU/DnT1bt+8vAEeEVYLwxutJGBg3LuXcdWPaDwu/Xf7p6y6HuTNNOvG8ZDX2 7YUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681737526; x=1684329526; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dVWUzJnRy08VVgMndpn0WdUv18W2Qb6Bz4zHOVYFwYs=; b=c1WG0w0Kd9vH4oDd811oJTqbZ+PrNcTda0Rb1GYyhx438+00j9LHOPGAmzwA4G4uDb UT4Fy1cP4l3008CsKsoAxY1hcTZEvDEBjgz5J8HwKvBNibDcN67RAyLJOFZbzJR5dmCI XhIZfF4xRKlbW4UpbEWsq4J0w8ftk30mHfEnKv2C8qjTeD1ETvJ52TdBWivezXm1oe7T ES/s5bp/P1z4Q3GV7GTCkf/Og5szVEWNMaGBpm+ElZ32qo34/y2CU3ProI8gOaUKHrQQ cQnGNH0HMlRCkAHjS/Frr+jk1/qLeqcIdgNpib9AVzis15Jcxv7NPzWRqxCzg1QI4yay BPGw== X-Gm-Message-State: AAQBX9eLOirWk/dtJh5RlkMZM42yoB0tKQCOuyLtM/hmR6tUKAvct2g4 GSqfDguu5i1leD/9T1Stx63A4A== X-Received: by 2002:a05:6a20:291e:b0:ec:7cc:2da3 with SMTP id t30-20020a056a20291e00b000ec07cc2da3mr13372596pzf.15.1681737525782; Mon, 17 Apr 2023 06:18:45 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-68-25-194.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.25.194]) by smtp.gmail.com with ESMTPSA id d11-20020aa7868b000000b0063b7331a4easm4923224pfo.154.2023.04.17.06.18.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 06:18:43 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1poOkk-00BQEU-7J; Mon, 17 Apr 2023 10:18:42 -0300 Date: Mon, 17 Apr 2023 10:18:42 -0300 From: Jason Gunthorpe To: Alex Williamson Cc: Nipun Gupta , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, masahiroy@kernel.org, nathan@kernel.org, ndesaulniers@google.com, nicolas@fjasle.eu, git@amd.com, harpreet.anand@amd.com, pieter.jansen-van-vuuren@amd.com, nikhil.agarwal@amd.com, michal.simek@amd.com Subject: Re: [PATCH v2] vfio/cdx: add support for CDX bus Message-ID: References: <20230414123414.21645-1-nipun.gupta@amd.com> <20230414153614.3b72e659.alex.williamson@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230414153614.3b72e659.alex.williamson@redhat.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 14, 2023 at 03:36:14PM -0600, Alex Williamson wrote: > > +static int vfio_cdx_init_device(struct vfio_device *core_vdev) > > +{ > > + struct vfio_cdx_device *vdev = > > + container_of(core_vdev, struct vfio_cdx_device, vdev); > > + struct cdx_device *cdx_dev = to_cdx_device(core_vdev->dev); > > + > > + vdev->cdx_dev = cdx_dev; > > + vdev->dev = &cdx_dev->dev; > > Both of these seem trivial to factor out of this patch, cdx_device is > always available via to_cdx_device(core_vdev->dev) and the struct > device is always available via core_vdev->dev. vdev->dev isn't even > used anywhere yet. Both the init and release functions here could be > dropped afaict. Yes please, I have a series someplace that gets rid of all these redundent ->devs we keep around everwhere. to_cdx_device(core_vdev->dev) is a good solution, maybe with a static inline. Jason