lkml.org 
[lkml]   [2020]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] nouveau/hmm: map pages after migration
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.

\
 
 \ /
  Last update: 2020-03-04 17:28    [W:0.732 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site