Re: [PATCH v17 01/47] llist: move llist_{head,node} definition to types.h

Mathieu Desnoyers
2025-10-02T13:53:33Z

On 2025-10-02 04:24, Greg KH wrote:
> On Thu, Oct 02, 2025 at 05:12:01PM +0900, Byungchul Park wrote:
>> llist_head and llist_node can be used by some other header files. For
>> example, dept for tracking dependencies uses llist in its header. To
>> avoid header dependency, move them to types.h.
>
> If you need llist in your code, then include llist.h. Don't force all
> types.h users to do so as there is not a dependency in types.h for
> llist.h.
>
> This patch shouldn't be needed as you are hiding "header dependency" for
> other files.

I agree that moving this into a catch-all types.h is not what we should
aim for.

However, it's a good practice to move the type declarations to a
separate header file, so code that only cares about type and not
implementation of static inline functions can include just that.

Perhaps we can move struct llist_head and struct llist_node to a new
include/linux/llist_types.h instead ?

Thanks,

Mathieu

--
Mathieu Desnoyers
EfficiOS Inc.