From nobody Wed Apr 03 06:39:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V8Zph0nxsz5G8HM; Wed, 3 Apr 2024 06:39:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V8Zph05J7z4jvh; Wed, 3 Apr 2024 06:39:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712126348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hL4EEI0iC7/vpk4bVnlN9CasVFKAMP/2ciC2JSKQA3g=; b=eZRD/jH5YLjaMKvgvBjR9dz/vprhIR6BD9TtMDeiYX3a1haCQQsushzyyPsm35ngb/w4N5 gHHu5PSXAlr3jSYlCz2uq9Wmzy2BwiBRmHasMimjd5Xp3Ow2bfK2Y7Py+7kV2RG+jsJG9O HScmadc557CVf0atRUUVdtd+rxySflXBy3djk7KgUQMzKlgiH+T4wDaLtAOlX/2zSrl76S +10mJ2lrVMF1IEIJqIKJt72GxDkju/pktH+V4tDvEwvTLwjO74Ox0qG0qiG/V1oMf+5hUW DSiHO5wHPuWRKelN2NvCiX93z9x1l+/7QPxeN8tkkEdVFEFxPyGE2K3oIflKTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712126348; a=rsa-sha256; cv=none; b=E0q8g/tMdofWZK0qToCAmSbIFt30lWNxQiU+/msDAuFrOhI9ONC+mtfAsZTTmyiMl5av+B hEclb4wHaAdVSToSQfajj6deCbjfWpkAGYFrhuUjuEULn0v+BuTF5tBY0s/7lNzjAAb7Oe UvWjX0q1bxYVudWSZ+M+dU6Jlkz2JyuBwAee8WecrgSZk1I8U+VvC2DjsFMy7YAk4WuuDP DERwKBvRtgRyfln7/94tOkZcDLemY5uCYYluv4AgYLr4/xUMGS63FrxGm1yhb6dDHnzbWN aZb0z4I2WgE5dl1xSoFRYgtrjYrA6B2zcwJOQlQd2WNrhKYr5WR+X2rASWaLEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712126348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hL4EEI0iC7/vpk4bVnlN9CasVFKAMP/2ciC2JSKQA3g=; b=FVPrUy15hORcn2fCPyWS+RQS/TCozIoG+wM5GZU7cHv/YzW4S6/Zogvr8tbls+fIfI/r7m cp4zNaV5dYgQL9kT8ZKP3/v5e7spGH/Erh+8NNfEZ+OpLyv+PBAHClUq1q017cHJtBb2gZ wLm7ilchb3UkpscVzLlpCJzb3f+C15JbDco1JIIWn14WV382ndSX7dJd3LjRfUFf+YTSLg /4u1j09GXmc/pk2pUr1tYbymQzl0FfN1PqVUEEI5FlGVTDIxZz5hDmZIGUSiS/9lxAgEV1 lm8FWhYQuhumaWHsPKLUBJ4LmMP4+Mr9KiHAzO4wnItAyo+e1DmZV9ngmFxkWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V8Zpg6hq1zMX5; Wed, 3 Apr 2024 06:39:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4336d7fm013779; Wed, 3 Apr 2024 06:39:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4336d7Xu013776; Wed, 3 Apr 2024 06:39:07 GMT (envelope-from git) Date: Wed, 3 Apr 2024 06:39:07 GMT Message-Id: <202404030639.4336d7Xu013776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 223077d0a847 - stable/13 - kern linker: Make linker_file_add_dependency() void List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 223077d0a847509a14102719e04f2ae0666461f8 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=223077d0a847509a14102719e04f2ae0666461f8 commit 223077d0a847509a14102719e04f2ae0666461f8 Author: Zhenlei Huang AuthorDate: 2024-03-27 04:02:32 +0000 Commit: Zhenlei Huang CommitDate: 2024-04-03 06:26:57 +0000 kern linker: Make linker_file_add_dependency() void The only possible return value has been zero since cee9542d51f0. No functional change intended. Reviewed by: dfr MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44507 (cherry picked from commit 1c7307cf6763a295ea9896be9f197d40511c77ed) (cherry picked from commit 41d9d301fbd091eee159d8e6d70b60ff7d67c349) --- sys/kern/kern_linker.c | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 87354e47d002..bc2f477997e0 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -143,7 +143,7 @@ struct modlist { typedef struct modlist *modlist_t; static modlisthead_t found_modules; -static int linker_file_add_dependency(linker_file_t file, +static void linker_file_add_dependency(linker_file_t file, linker_file_t dep); static caddr_t linker_file_lookup_symbol_internal(linker_file_t file, const char* name, int deps); @@ -764,7 +764,7 @@ linker_ctf_get(linker_file_t file, linker_ctf_t *lc) return (LINKER_CTF_GET(file, lc)); } -static int +static void linker_file_add_dependency(linker_file_t file, linker_file_t dep) { linker_file_t *newdeps; @@ -777,7 +777,6 @@ linker_file_add_dependency(linker_file_t file, linker_file_t dep) KLD_DPF(FILE, ("linker_file_add_dependency:" " adding %s as dependency for %s\n", dep->filename, file->filename)); - return (0); } /* @@ -1706,10 +1705,7 @@ restart: TAILQ_FOREACH_SAFE(lf, &depended_files, loaded, nlf) { if (linker_kernel_file) { linker_kernel_file->refs++; - error = linker_file_add_dependency(lf, - linker_kernel_file); - if (error) - panic("cannot add dependency"); + linker_file_add_dependency(lf, linker_kernel_file); } error = linker_file_lookup_set(lf, MDT_SETNAME, &start, &stop, NULL); @@ -1731,10 +1727,7 @@ restart: if (lf == mod->container) continue; mod->container->refs++; - error = linker_file_add_dependency(lf, - mod->container); - if (error) - panic("cannot add dependency"); + linker_file_add_dependency(lf, mod->container); } } /* @@ -2197,11 +2190,8 @@ linker_load_module(const char *kldname, const char *modname, error = ENOENT; break; } - if (parent) { - error = linker_file_add_dependency(parent, lfdep); - if (error) - break; - } + if (parent) + linker_file_add_dependency(parent, lfdep); if (lfpp) *lfpp = lfdep; } while (0); @@ -2230,9 +2220,7 @@ linker_load_dependencies(linker_file_t lf) sx_assert(&kld_sx, SA_XLOCKED); if (linker_kernel_file) { linker_kernel_file->refs++; - error = linker_file_add_dependency(lf, linker_kernel_file); - if (error) - return (error); + linker_file_add_dependency(lf, linker_kernel_file); } if (linker_file_lookup_set(lf, MDT_SETNAME, &start, &stop, NULL) != 0) @@ -2273,9 +2261,7 @@ linker_load_dependencies(linker_file_t lf) if (mod) { /* woohoo, it's loaded already */ lfdep = mod->container; lfdep->refs++; - error = linker_file_add_dependency(lf, lfdep); - if (error) - break; + linker_file_add_dependency(lf, lfdep); continue; } error = linker_load_module(NULL, modname, lf, verinfo, NULL);