From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8550DC3F2D8 for ; Wed, 4 Mar 2020 16:27:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5FF8622522 for ; Wed, 4 Mar 2020 16:27:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5FF8622522 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DA4EC6B0003; Wed, 4 Mar 2020 11:27:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D2E6C6B0005; Wed, 4 Mar 2020 11:27:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD0676B0006; Wed, 4 Mar 2020 11:27:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0229.hostedemail.com [216.40.44.229]) by kanga.kvack.org (Postfix) with ESMTP id A1DE06B0003 for ; Wed, 4 Mar 2020 11:27:56 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 31A304DAB for ; Wed, 4 Mar 2020 16:27:56 +0000 (UTC) X-FDA: 76558211352.06.judge85_2823259c8c338 X-HE-Tag: judge85_2823259c8c338 X-Filterd-Recvd-Size: 1990 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Wed, 4 Mar 2020 16:27:55 +0000 (UTC) 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) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.