From nobody Wed Apr 26 13:59:02 2023 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 4Q60pZ2w7Nz46YDf; Wed, 26 Apr 2023 13:59:02 +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 4Q60pZ1LgJz4Jb0; Wed, 26 Apr 2023 13:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682517542; 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=xXH6uPCayq1qVKD7P22Pq2LkdmOg58RhmW/hKuRKsSQ=; b=oliJcKThe8QO7HswCsq7IclOyHVUdOy3I4TKW5eqHahf0DBjUgDVrLlh8P/A0gEeKFzFze mmx+q82+/Uk9hniwp9maT79THEkq73gDmPgodWhtbGBN4F1pWTlDiL/E5IF/iRpxIbqJ1+ pZoWuo+d2Ix/XGa0E4+Ue+2sSkHaVHt3u1JRAq8E/HVTsUkPBrP8Zo7KhzZL61Pdt05TWd UQqskFR7buyT/BGJf9JnkrdnnweiKpe++81vdwqKaicQPY9iGrX66ckzjifjj5cy5pdR0u j8SWpo/P6Rv5e56hx/JKcoFeuZ/I9D3YOoCqiAtYLwgGsc5nIaPpzzncNtpBng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682517542; 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=xXH6uPCayq1qVKD7P22Pq2LkdmOg58RhmW/hKuRKsSQ=; b=e872xNMI5RRU4LUJWcB0eHJigQqD8cTGlh/zQZywTUOqdLwl1h43/LMCcH+2v0uUDxBYs8 EzQDKhRBKIRxDIYaNV1Ta9XIa+SvXnl5xPdD1t21xJNkJi9OK3ZqsagkeVMS/jNb5TdAas VmDfvoQpKx6TSBgzYcqk52pv4XER7oo5WgdmDrVt92JrMvvnjZNfNZ292h3NVc5HOx7m79 7jHU+kmK5x7q8DrIOHeEQYIWF6h8YMLSFyX8E0B8cHN8mNxAipVZvOoH99MdqBjZWZg7v2 DArM3JRiHpU6FA7eoZdvVfeJBLrU4oAzIyzm+gORMkZclMA7/0lYlNrB/eMjoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682517542; a=rsa-sha256; cv=none; b=OsT+drN55nYNn3q1T0XGbMWgeHiUXZg0ekPc9Uz5uVcd9hZPGT4bmPIKZ6Sbp/iXaJdxDa PiVvABO5Bs7Yj4mladNfCu8FTcQKsk+LQQNG7E4HVsOi5foxDJdbUFdaWDkPmbuPpws/rb Lo/zlzaYBJB8AcZqcsFB/ayUhSyRqvA8QkdWzF025PtRL/QKGUDOLlzz/TrYEE50ZYfdy4 8YDNQH96dFZPrW9C2LKMGYOLWAf+bNunyQoLA2rl4nlaf8Y9O8t+fGKsjt6SR0JKzsfMnF l9vfs0a/KlcJfAB3EUp1m2bCo1fA6Vq596GOebs1ner8Xyig5WxAhAQ3R/gHHA== 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 4Q60pZ0SrBzcXq; Wed, 26 Apr 2023 13:59: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 33QDx2Qd053723; Wed, 26 Apr 2023 13:59:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33QDx2dQ053722; Wed, 26 Apr 2023 13:59:02 GMT (envelope-from git) Date: Wed, 26 Apr 2023 13:59:02 GMT Message-Id: <202304261359.33QDx2dQ053722@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: e185d83fc48b - main - linux(4): Use inlined LINUX_KERNVER for tests to improve readability 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e185d83fc48ba0f28896a986104c02203005b533 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e185d83fc48ba0f28896a986104c02203005b533 commit e185d83fc48ba0f28896a986104c02203005b533 Author: Dmitry Chagin AuthorDate: 2023-04-26 13:57:30 +0000 Commit: Dmitry Chagin CommitDate: 2023-04-26 13:57:30 +0000 linux(4): Use inlined LINUX_KERNVER for tests to improve readability MFC after: 1 month --- sys/compat/linux/linux_elf.c | 2 +- sys/compat/linux/linux_mib.h | 6 ------ sys/compat/linux/linux_misc.c | 4 ++-- sys/compat/linux/linux_signal.c | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/compat/linux/linux_elf.c b/sys/compat/linux/linux_elf.c index 1af861122f81..06a384325d14 100644 --- a/sys/compat/linux/linux_elf.c +++ b/sys/compat/linux/linux_elf.c @@ -513,7 +513,7 @@ __linuxN(copyout_auxargs)(struct image_params *imgp, uintptr_t base) * is not present. * Also see linux_times() implementation. */ - if (linux_kernver(curthread) >= LINUX_KERNVER_2004000) + if (linux_kernver(td) >= LINUX_KERNVER(2,4,0)) AUXARGS_ENTRY(pos, LINUX_AT_CLKTCK, stclohz); AUXARGS_ENTRY(pos, AT_PAGESZ, args->pagesz); AUXARGS_ENTRY(pos, AT_PHDR, args->phdr); diff --git a/sys/compat/linux/linux_mib.h b/sys/compat/linux/linux_mib.h index 7022d811959b..5902f523dfee 100644 --- a/sys/compat/linux/linux_mib.h +++ b/sys/compat/linux/linux_mib.h @@ -57,12 +57,6 @@ int linux_kernver(struct thread *td); #define LINUX_XKERNVERSTR(x) LINUX_KERNVERSTR(x) #define LINUX_VERSION_STR LINUX_XKERNVERSTR(LINUX_KVERSION.LINUX_KPATCHLEVEL.LINUX_KSUBLEVEL) -#define LINUX_KERNVER_2004000 LINUX_KERNVER(2,4,0) -#define LINUX_KERNVER_2006039 LINUX_KERNVER(2,6,39) -#define LINUX_KERNVER_5004000 LINUX_KERNVER(5,4,0) - -#define linux_use54(t) (linux_kernver(t) >= LINUX_KERNVER_5004000) - extern int linux_debug; extern int linux_default_openfiles; extern int linux_default_stacksize; diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index bc62c6b24d2c..ba0ac190a946 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -384,7 +384,7 @@ struct l_times_argv { #define CONVOTCK(r) (r.tv_sec * CLK_TCK + r.tv_usec / (1000000 / CLK_TCK)) #define CONVNTCK(r) (r.tv_sec * stclohz + r.tv_usec / (1000000 / stclohz)) -#define CONVTCK(r) (linux_kernver(td) >= LINUX_KERNVER_2004000 ? \ +#define CONVTCK(r) (linux_kernver(td) >= LINUX_KERNVER(2,4,0) ? \ CONVNTCK(r) : CONVOTCK(r)) int @@ -850,7 +850,7 @@ linux_waitid(struct thread *td, struct linux_waitid_args *args) idtype = P_PID; break; case LINUX_P_PGID: - if (linux_use54(td) && args->id == 0) { + if (linux_kernver(td) >= LINUX_KERNVER(5,4,0) && args->id == 0) { p = td->td_proc; PROC_LOCK(p); id = p->p_pgid; diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index 5a3cb97c385f..89f0f38d7b6c 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -776,7 +776,7 @@ lsiginfo_to_siginfo(struct thread *td, const l_siginfo_t *lsi, switch (lsi->lsi_code) { case LINUX_SI_TKILL: - if (linux_kernver(td) >= LINUX_KERNVER_2006039) { + if (linux_kernver(td) >= LINUX_KERNVER(2,6,39)) { linux_msg(td, "SI_TKILL forbidden since 2.6.39"); return (EPERM); }