Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Mar 2024 04:03:36 GMT
From:      Zhenlei Huang <zlei@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 1c7307cf6763 - main - kern linker: Make linker_file_add_dependency() void
Message-ID:  <202403270403.42R43aeB055496@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by zlei:

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

commit 1c7307cf6763a295ea9896be9f197d40511c77ed
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2024-03-27 04:02:32 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2024-03-27 04:02:32 +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
---
 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 9d3cb9b7bd63..54b7466124db 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);
@@ -836,7 +836,7 @@ linker_ctf_lookup_sym_ddb(const char *symname, c_linker_sym_t *sym,
 	return (ENOENT);
 }
 
-static int
+static void
 linker_file_add_dependency(linker_file_t file, linker_file_t dep)
 {
 	linker_file_t *newdeps;
@@ -849,7 +849,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);
 }
 
 /*
@@ -1780,10 +1779,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);
@@ -1805,10 +1801,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);
 			}
 		}
 		/*
@@ -2286,11 +2279,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);
@@ -2319,9 +2309,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)
@@ -2362,9 +2350,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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202403270403.42R43aeB055496>