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)
Tue, Nov 5, 12:11 PM
Unknown Object (File)
Wed, Oct 16, 10:45 PM
Unknown Object (File)
Wed, Oct 16, 10:45 PM
Unknown Object (File)
Wed, Oct 16, 10:45 PM
Unknown Object (File)
Wed, Oct 16, 10:44 PM
Unknown Object (File)
Wed, Oct 16, 10:44 PM
Unknown Object (File)
Wed, Oct 16, 10:24 PM
Unknown Object (File)
Tue, Oct 8, 8:47 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.