git: e2979f4cbbf6 - main - rtld: some cosmetics in donelist_init()

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Sun, 25 Oct 2026 17:34:32 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=e2979f4cbbf6546daa7ad9fd1cd544d22c286315

commit e2979f4cbbf6546daa7ad9fd1cd544d22c286315
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-10-25 15:30:20 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-10-25 17:33:46 +0000

    rtld: some cosmetics in donelist_init()
    
    Add a missing word in the comment.
    Make each assignment a separate statement.
    Fix formatting.
    
    Fixes:  1e370f038778 ("rtld: stop using unbound alloca()")
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
---
 libexec/rtld-elf/rtld.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 0ff7d1bb5227..877449296643 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -1034,20 +1034,20 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
 
 /*
  * Fill in a DoneList with an allocation large enough to hold all of
- * the currently-loaded   Keep this as a macro since it calls
- * alloca and we want that to occur within the scope of the caller.
+ * the currently-loaded objects.  Keep this as a macro since it calls
+ * alloca() and we want that to occur within the scope of the caller.
  */
 #define	DLP_ALLOCA_LIMIT	100	/* 800 bytes on LP64 */
-#define donelist_init(_DLP, _REQ)	do {				\
+#define	donelist_init(_DLP, _REQ)	do {				\
 	DoneList *_dlp = _DLP;						\
 	SymLook *_r = _REQ;						\
-	_dlp->num_alloc = obj_count,					\
+	_dlp->num_alloc = obj_count;					\
 	_dlp->req = NULL;						\
 	if (_dlp->num_alloc > DLP_ALLOCA_LIMIT) {			\
 		_dlp->objs = xcalloc(_dlp->num_alloc, sizeof(_dlp->objs[0])); \
 		if (_r != NULL && _r->donelist_mem == NULL) {		\
 			_r->donelist_mem = _dlp->objs;			\
-			_dlp->req = _r;				\
+			_dlp->req = _r;					\
 		}							\
 	} else {							\
 		_dlp->objs = alloca(_dlp->num_alloc * sizeof(_dlp->objs[0])); \