Re: [PATCH 46/50] preempt.h: Kill dependency on list.h

From: Randy Dunlap
Date: Sat Dec 16 2023 - 19:27:01 EST




On 12/16/23 16:18, Kent Overstreet wrote:
> On Sat, Dec 16, 2023 at 04:04:43PM -0800, Randy Dunlap wrote:
>>
>>
>> On 12/16/23 14:35, Kent Overstreet wrote:
>>> On Sat, Dec 16, 2023 at 06:13:41AM +0000, Matthew Wilcox wrote:
>>>> On Fri, Dec 15, 2023 at 10:35:47PM -0500, Kent Overstreet wrote:
>>>>> - INIT_HLIST_NODE(&notifier->link);
>>>>> + /* INIT_HLIST_NODE() open coded, to avoid dependency on list.h */
>>>>> + notifier->link.next = NULL;
>>>>> + notifier->link.pprev = NULL;
>>>>
>>>> Arguably INIT_HLIST_NODE() belongs in types.h -- we already have
>>>> RCUREF_INIT() and ATOMIC_INIT() in there.
>>>
>>> I think I'd prefer to keep types.h as minimal as possible - as soon as
>>> we start putting non type stuff in there people won't know what the
>>> distinction is and it'll grow.
>>>
>>> preempt.h is a bit unusual too, normally we'd just split out a _types.h
>>> header there but it's not so easy to split up usefully.
>>>
>>
>> I don't feel like I have NAK power, but if I did, I would NAK
>> open coding of INIT_HLIST_HEAD() or anything like it.
>> I would expect some $maintainer to do likewise, but I could be
>> surprised.
>
> It's INIT_HLIST_HEAD(), there's approximately zero chance of the
> implementation changing, and there's a comment.

s/_HEAD/_NODE/ for both of us. :)

--
#Randy
https://people.kernel.org/tglx/notes-about-netiquette
https://subspace.kernel.org/etiquette.html