Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4675364ybf; Wed, 4 Mar 2020 08:29:26 -0800 (PST) X-Google-Smtp-Source: ADFU+vt8zYkBXCgfbKLFrWBcU0opRK8gwslpnnY9f2YSXT7JJM8APiyUYXGvQY6kE4oRtjD+Pg4P X-Received: by 2002:aca:abd6:: with SMTP id u205mr2223213oie.12.1583339365935; Wed, 04 Mar 2020 08:29:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583339365; cv=none; d=google.com; s=arc-20160816; b=a/NJOGilMcoqednBAwjK5cll8uMu3BTSdXWNJquwmv0fy+Le2TvQ0czoCLM1cL9yu0 vEa3Vlo3V2XjKo5Idf+cMsFRI0tVKBaeYXSDMYVi42zxQpqFa6N0+Mcl7l2Uf3gVp3Yy 8fZOv2UuHr2pIoT7Dgl2Ec7SNspZjhcUJPADW65jG2n4Pap6N9D91ypzKFr29dlUi8xK Ghp31zv7kfBqO5Aw3nBflWKkCzGEsI80SbOs8B736pCpGu8+Ge9P9eyxHpZarmcL2k5D c2YwEQRzVoTq4XbNSRWQtZ3DzNcrUXl4NXfvwecgLgz7umLjgfSxglX+OjdpOXbpvNY7 y7wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=r62lNBkb08n/dAwd8TvAVZeJ7/Tz9m/sEJliuh/QSHM=; b=pIvzup2OjMHfIemJ45ARupduZnG4dQ2ZzG+Tmf7T/VWKM+ircCo8WxflRvluMmkbEP H8G6AT2IPCsxi2SqvkBiVWuL9t+9USYBloqNTv7/szACm8vLd+tFNx6PbfDeHXznofiB 6RqXkUH5A5UxQSC85Z2abIk/0FTFRTTzLlqqccY/I62Xz+vj6rr9zAhNIdk79T/8tv7/ 4vgnhk7eRbZ09oliHMGRUquUDVyEN6JZ01AU8clYVTNElln09xfUrHPJMCFC+3T6Bq+4 FWnsmygSIY0a9UHD2ZnNq9o1kbq8DWIHGrIETVYPJZnD6Y5oMSzdViLIlwTr1YnzDuru U8LA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e8si1614650otj.25.2020.03.04.08.29.13; Wed, 04 Mar 2020 08:29:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388386AbgCDQ1z (ORCPT + 99 others); Wed, 4 Mar 2020 11:27:55 -0500 Received: from verein.lst.de ([213.95.11.211]:55360 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387497AbgCDQ1z (ORCPT ); Wed, 4 Mar 2020 11:27:55 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 19CA268C4E; Wed, 4 Mar 2020 17:27:53 +0100 (CET) Date: Wed, 4 Mar 2020 17:27:52 +0100 From: Christoph Hellwig To: Ralph Campbell Cc: Jason Gunthorpe , dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org, Jerome Glisse , John Hubbard , Christoph Hellwig , Andrew Morton , Ben Skeggs Subject: Re: [PATCH v2] nouveau/hmm: map pages after migration Message-ID: <20200304162752.GB11616@lst.de> References: <20200303010023.2983-1-rcampbell@nvidia.com> <20200303124229.GH26318@mellanox.com> <1f27ac9e-7ddf-6e4f-25ea-063ef6c78761@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1f27ac9e-7ddf-6e4f-25ea-063ef6c78761@nvidia.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 03, 2020 at 01:15:21PM -0800, Ralph Campbell wrote: >>> +static inline struct nouveau_pfnmap_args * >>> +nouveau_pfns_to_args(void *pfns) >> >> don't use static inline inside C files > > OK. > >>> +{ >>> + struct nvif_vmm_pfnmap_v0 *p = >>> + container_of(pfns, struct nvif_vmm_pfnmap_v0, phys); >>> + >>> + return container_of(p, struct nouveau_pfnmap_args, p); >> >> And this should just be >> >> return container_of(pfns, struct nouveau_pfnmap_args, p.phys); > > Much simpler, thanks. Btw, for the case where we just have an container_of wrapper I strongly disagree with avoiding the inline - not inlining this would be stupid, but unfortunately compilers often behave stupidly. It also is a very clear marker.