Page MenuHomeFreeBSD

sys/queue.h: Add {LIST,TAILQ}_REPLACE().
ClosedPublic

Authored by des on Apr 8 2024, 3:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 12, 11:29 AM
Unknown Object (File)
Fri, May 10, 5:12 PM
Unknown Object (File)
Tue, May 7, 1:59 AM
Unknown Object (File)
Sun, Apr 28, 8:30 PM
Unknown Object (File)
Fri, Apr 26, 4:53 AM
Unknown Object (File)
Apr 17 2024, 12:56 AM
Unknown Object (File)
Apr 9 2024, 8:38 PM
Unknown Object (File)
Apr 8 2024, 7:52 PM

Details

Summary

MFC after: 1 week
Obtained from: NetBSD
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Apr 8 2024, 3:53 PM

Seems OK to me: doesn't make things worse, provides a good function not. yet available, and is compatible with at least one other system.

This revision is now accepted and ready to land.Apr 8 2024, 4:03 PM
cperciva added a subscriber: cperciva.
cperciva added inline comments.
share/man/man3/queue.3
975

If I were writing this myself, I would add "The element .Fa new must not already be on a list." for clarity, but it's probably not worth diverging from NetBSD.

sys/sys/queue.h
883

I would have written this as

(elm2)->field.tqe_next = (elm)->field.tqe_next;
if ((elm2)->field.tqe_next != TAILQ_END(head))
    ....

since I think that's a bit clearer with all the added parentheses associated with macros, but this is also fine.

jrtc27 added inline comments.
sys/sys/queue.h
614

QMD_LIST_CHECK_*?

614–616

Use LIST_NEXT instead of direct le_next accesses

619

TRASHIT?

882

Same comments as LIST

des marked 6 inline comments as done.

incorporate review feedback

This revision now requires review to proceed.Apr 8 2024, 4:28 PM

I don't mind diverging from NetBSD if it's an improvement, we've already diverged quite a bit.

This revision is now accepted and ready to land.Apr 8 2024, 6:01 PM
sys/sys/queue.h
620

This could be s/elm/elm2/ but since they're equal at this point it doesn't matter.

des marked an inline comment as done.Apr 8 2024, 6:15 PM
This revision was automatically updated to reflect the committed changes.