git: 41d9d301fbd0 - stable/14 - kern linker: Make linker_file_add_dependency() void
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 03 Apr 2024 06:25:26 UTC
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=41d9d301fbd091eee159d8e6d70b60ff7d67c349 commit 41d9d301fbd091eee159d8e6d70b60ff7d67c349 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2024-03-27 04:02:32 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-04-03 06:15:15 +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) --- 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 6ac2e694a4cf..2b220295f78e 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -144,7 +144,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); @@ -779,7 +779,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; @@ -792,7 +792,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); } /* @@ -1721,10 +1720,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); @@ -1746,10 +1742,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); } } /* @@ -2212,11 +2205,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); @@ -2245,9 +2235,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) @@ -2288,9 +2276,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);