About the name of 'struct list_head', how about giving an alias for differentiating the usage?
July 3, 2023
5:47 a.m.
Hello all, Often when I analyze linux source code, it takes me some time to figure out how a list_head member of a struct is being used. Sometimes it points to a linked list's start member, but sometimes it used to link the containing struct as a member of linked list.(you know we cat get the struct in the linked list using container_of operator). Wouldn't it be nice if we give list_head an alias like 'list_hook_head' (or just list_hook) so that the alias can be used for the second case? By gradually changing the type name to list_hook_head in some structs, we could make the source code more easier to read. I hope someone do this someday.. Thank you. Chan Kim
1139
Age (days ago)
1139
Last active (days ago)
0 comments
1 participants
participants (1)
-
Chan Kim