From nobody Wed Mar 27 04:03:36 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 4V4ChS40B6z5GNPx; Wed, 27 Mar 2024 04:03:36 +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 4V4ChS3GRNz4nWk; Wed, 27 Mar 2024 04:03:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711512216; 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=TzemscFkfAJc5QN3m8urYp7FebHfhcOkvK4JmuzxlD8=; b=shxPloIcOCBcDh+UWFlK/9fLLhBWwJtiL1plHNW7RGizLZ1J5OLKde6SnC3dPAKknhtcBN 6eVwjy6mfWzACMDtmsqY8WEVJBw0iTshVVcW0kutCNdCCHbPLPJjvBlfa8Ln5bx/0tugxS +9yrTEb5AwowhBmwgJR6WHa1DV3TTW+HTyGJMK2LpNzdtbDZl7AX5s/cKp6zZCSIMuA3QI YnfCN4/Mm+RfOBe//h7108IPpEOI8/KfefCntsot2DgbIye9es4DwXmdLhDewldVPOYxiT mEVhruNU61jBVOQ3TiIbcSVWSO6FMKdLlWYwbC+nfFIXuQ+i6b0YtysNLVtrJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711512216; a=rsa-sha256; cv=none; b=t1iZwc/koM/7IZSqsowZwaiwlHiLpUE7ZEFDwftgDq3a+MGoQUBVuASz4p5wgr4kd8EJWI r6GTyfj74UlX77W+M2+Yms0TF9bQtbzw3jLsqGt/KljPMBG3GExFwPLTbOtaNUnNTRj4uM z+vSgAuH7+7WD0tina/L2JT2oCC/yUZxTtycVWWgZ/5fZIAY5cFWozYkwvbTL4v/teOM/6 qa1Wdr0MhY37+mFVO+1rJ7tRvE18gyDcWlh+f6uAcCUNbEBfM77jmDV9frLtb1dB/s1Ycj 5tOclKHTRJJXjp5K0VVpaQ6VFBrz2mBpcRjyco9MpHl40SP1OBBvsFsqQ0QZ4w== 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=1711512216; 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=TzemscFkfAJc5QN3m8urYp7FebHfhcOkvK4JmuzxlD8=; b=w+ul4c7LHTCWIS6P9evzulaHEdgnmUVfZJr/nBDHlQfV6r8V/s+ub+BQ68wqt8PTXVXsL+ XmZ98dGLcHTLM/xzTNeHEC1zDzapVyF8kV2BP5Z5DVBXr1unlqgXME2eBGtNMdl4xKag8+ +2gml0JedrVPVl4rW+d0ZLArZoNAeLZieZzW3UHAKPU/KFuP+3scb6bbNEEVHKuY5LNLjH UYnn4zrVNXC+Cqanm/yNs92wTQ6x0J43F4iSSHI6mZvZ/hUUkrz6cjOZXor5nuHErDnXMj 773epZzr0KDRT5d3E4JTujcXFT5oHB3UCYzssrqfK+PTjAyJWofmH1E7v7ljog== 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 4V4ChS2qlSzSj5; Wed, 27 Mar 2024 04:03:36 +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 42R43ajD055499; Wed, 27 Mar 2024 04:03:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42R43aeB055496; Wed, 27 Mar 2024 04:03:36 GMT (envelope-from git) Date: Wed, 27 Mar 2024 04:03:36 GMT Message-Id: <202403270403.42R43aeB055496@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 1c7307cf6763 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 1c7307cf6763a295ea9896be9f197d40511c77ed Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1c7307cf6763a295ea9896be9f197d40511c77ed commit 1c7307cf6763a295ea9896be9f197d40511c77ed Author: Zhenlei Huang AuthorDate: 2024-03-27 04:02:32 +0000 Commit: Zhenlei Huang 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);