lkml.org 
[lkml]   [2021]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v6] mm: cma: support sysfs
From
Date
On 3/23/21 11:57 PM, Minchan Kim wrote:
...
>> , how about approximately this:
>>
>> struct cma_kobject_wrapper {
>> struct cma *parent;
>> struct kobject kobj;
>> };
>>
>> struct cma {
>> ...
>> struct cma_kobject_wrapper *cma_kobj_wrapper;
>> };
>>
>>
>> ...thus allowing readers of cma_sysfs.c to read that file more easily.
>
> I agree cma->kobj->kobj is awkward but personally, I don't like the
> naming: cma_kobject_wrapper parent pointer. cma_kobject is alredy
> wrapper so it sounds me redundant and it's not a parent in same
> hierarchy.
>
> Since the kobj->kobj is just one line in the code(I don't imagine
> it could grow up in cma_sysfs in future), I don't think it would
> be a problem. If we really want to make it more clear, maybe?
>
> cma->cma_kobj->kobj
>
> It would be consistent with other variables in cma_sysfs_init.
>

OK, that's at least better than it was.

thanks,
--
John Hubbard
NVIDIA

\
 
 \ /
  Last update: 2021-03-24 08:12    [W:0.046 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site