On Mon, 13 Jul 2020 14:35:23 +0200, Greg KH said: > On Mon, Jul 13, 2020 at 01:17:25PM +0200, Garrit Franke wrote: > > Hi all, > > > > I was wondering, what the KOBJ_MAX action in the kobject.h file does. > > It is self explainatory what KOBJ_ADD, KOBJ_REMOVE etc. are used for, but KOBJ_MAX puzzles me. > > Can it maybe even be removed? > > Maybe it can, try it and see! I suspect that this line: for (action = 0; action < ARRAY_SIZE(kobject_actions); action++) { in lib/kobject_uenvent.c:kobject_action_type() combined with the fact that kobject_actions[] does *not* actually match the enum regardless of the comment above it, result in it being superfluous. Figuring out why is left as an exercise for the student. Oh, and if I had a dollar for every time I've been surprised by creative abuse of the cpp ## operator... :)
Attachment:
pgpLtIVULBQuM.pgp
Description: PGP signature
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies