From nobody Thu Nov 18 13:57:02 2021 X-Original-To: dev-commits-src-main@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 359D6189D33D; Thu, 18 Nov 2021 13:57:03 +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 4Hw1Z65yKLz4Wmw; Thu, 18 Nov 2021 13:57:02 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 A4BE015F77; Thu, 18 Nov 2021 13:57:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AIDv2G5059807; Thu, 18 Nov 2021 13:57:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AIDv2AL059806; Thu, 18 Nov 2021 13:57:02 GMT (envelope-from git) Date: Thu, 18 Nov 2021 13:57:02 GMT Message-Id: <202111181357.1AIDv2AL059806@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: a7e4eb142298 - main - Kernel linkers: some style List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a7e4eb14229845c0857caf91bc3364f9e7075b00 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a7e4eb14229845c0857caf91bc3364f9e7075b00 commit a7e4eb14229845c0857caf91bc3364f9e7075b00 Author: Konstantin Belousov AuthorDate: 2021-11-07 09:03:45 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-18 13:56:23 +0000 Kernel linkers: some style Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D32878 --- sys/kern/link_elf.c | 10 +++++----- sys/kern/link_elf_obj.c | 36 ++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index 2faaa003380a..4114bd46f0c0 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -1596,12 +1596,12 @@ static int link_elf_search_symbol(linker_file_t lf, caddr_t value, c_linker_sym_t *sym, long *diffp) { - elf_file_t ef = (elf_file_t) lf; - u_long off = (uintptr_t) (void *) value; + elf_file_t ef = (elf_file_t)lf; + u_long off = (uintptr_t) (void *)value; u_long diff = off; u_long st_value; - const Elf_Sym* es; - const Elf_Sym* best = NULL; + const Elf_Sym *es; + const Elf_Sym *best = NULL; int i; for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) { @@ -1711,7 +1711,7 @@ link_elf_each_function_nameval(linker_file_t file, { linker_symval_t symval; elf_file_t ef = (elf_file_t)file; - const Elf_Sym* symp; + const Elf_Sym *symp; int i, error; /* Exhaustive search */ diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index 91852939e5e8..5c6db11e1937 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -1421,7 +1421,7 @@ link_elf_lookup_symbol(linker_file_t lf, const char *name, c_linker_sym_t *sym) return 0; } } - return ENOENT; + return (ENOENT); } static int @@ -1442,17 +1442,17 @@ link_elf_symbol_values(linker_file_t lf, c_linker_sym_t sym, val = ((caddr_t (*)(void))val)(); symval->value = val; symval->size = es->st_size; - return 0; + return (0); } - return ENOENT; + return (ENOENT); } static int link_elf_search_symbol(linker_file_t lf, caddr_t value, c_linker_sym_t *sym, long *diffp) { - elf_file_t ef = (elf_file_t) lf; - u_long off = (uintptr_t) (void *) value; + elf_file_t ef = (elf_file_t)lf; + u_long off = (uintptr_t)(void *)value; u_long diff = off; u_long st_value; const Elf_Sym *es; @@ -1480,7 +1480,7 @@ link_elf_search_symbol(linker_file_t lf, caddr_t value, *diffp = diff; *sym = (c_linker_sym_t) best; - return 0; + return (0); } /* @@ -1779,25 +1779,21 @@ link_elf_reloc_local(linker_file_t lf, bool ifuncs) static long link_elf_symtab_get(linker_file_t lf, const Elf_Sym **symtab) { - elf_file_t ef = (elf_file_t)lf; - - *symtab = ef->ddbsymtab; - - if (*symtab == NULL) - return (0); + elf_file_t ef = (elf_file_t)lf; - return (ef->ddbsymcnt); + *symtab = ef->ddbsymtab; + if (*symtab == NULL) + return (0); + return (ef->ddbsymcnt); } static long link_elf_strtab_get(linker_file_t lf, caddr_t *strtab) { - elf_file_t ef = (elf_file_t)lf; - - *strtab = ef->ddbstrtab; - - if (*strtab == NULL) - return (0); + elf_file_t ef = (elf_file_t)lf; - return (ef->ddbstrcnt); + *strtab = ef->ddbstrtab; + if (*strtab == NULL) + return (0); + return (ef->ddbstrcnt); }