From 0e64ee4c2b175b1ffc335440a90100bf53ad4596 Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 1 Dec 2021 16:53:28 +0000 Subject: [PATCH] Reduce use of sys/param.h, or annotate the reason why it is needed (pretty much MAXCOMLEN for struct process or struct core), and remove sys/vnode.h where not needed --- lib/libkvm/kvm_alpha.c | 7 ++++--- lib/libkvm/kvm_amd64.c | 5 ++--- lib/libkvm/kvm_arm.c | 6 +++--- lib/libkvm/kvm_arm64.c | 6 +++--- lib/libkvm/kvm_hppa.c | 5 +++-- lib/libkvm/kvm_i386.c | 6 ++++-- lib/libkvm/kvm_m88k.c | 6 ++++-- lib/libkvm/kvm_mips64.c | 5 +++-- lib/libkvm/kvm_powerpc.c | 7 ++++--- lib/libkvm/kvm_powerpc64.c | 6 +++--- lib/libkvm/kvm_riscv64.c | 6 +++--- lib/libkvm/kvm_sh.c | 6 +++--- lib/libkvm/kvm_sparc64.c | 5 +++-- 13 files changed, 42 insertions(+), 34 deletions(-) diff --git a/lib/libkvm/kvm_alpha.c b/lib/libkvm/kvm_alpha.c index 7f3169e52ef..22803b3648b 100644 --- a/lib/libkvm/kvm_alpha.c +++ b/lib/libkvm/kvm_alpha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_alpha.c,v 1.16 2015/12/19 18:40:30 mmcc Exp $ */ +/* $OpenBSD: kvm_alpha.c,v 1.17 2021/12/01 16:53:28 deraadt Exp $ */ /* $NetBSD: kvm_alpha.c,v 1.5 1996/10/01 21:12:05 cgd Exp $ */ /* @@ -30,7 +30,8 @@ #define __KVM_ALPHA_PRIVATE /* see */ -#include +#include +#include #include #include #include @@ -194,7 +195,7 @@ _kvm_pa2off(kvm_t *kd, paddr_t pa) int i; cpu_kh = kd->cpu_data; - ramsegs = (phys_ram_seg_t *)((char *)cpu_kh + ALIGN(sizeof *cpu_kh)); + ramsegs = (phys_ram_seg_t *)((char *)cpu_kh + _ALIGN(sizeof *cpu_kh)); off = 0; for (i = 0; i < cpu_kh->nmemsegs; i++) { diff --git a/lib/libkvm/kvm_amd64.c b/lib/libkvm/kvm_amd64.c index 9a33bf11f80..bdffdbc4240 100644 --- a/lib/libkvm/kvm_amd64.c +++ b/lib/libkvm/kvm_amd64.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_amd64.c,v 1.14 2021/09/10 00:02:43 deraadt Exp $ */ +/* $OpenBSD: kvm_amd64.c,v 1.15 2021/12/01 16:53:28 deraadt Exp $ */ /* $NetBSD: kvm_x86_64.c,v 1.3 2002/06/05 22:01:55 fvdl Exp $ */ /*- @@ -38,7 +38,6 @@ * x86-64 machine dependent routines for kvm. */ -#include /* MAXCOMLEN ALIGN */ #include #include #include @@ -194,7 +193,7 @@ _kvm_pa2off(kvm_t *kd, paddr_t pa) int i; cpu_kh = kd->cpu_data; - ramsegs = (void *)((char *)(void *)cpu_kh + ALIGN(sizeof *cpu_kh)); + ramsegs = (void *)((char *)(void *)cpu_kh + _ALIGN(sizeof *cpu_kh)); off = 0; for (i = 0; i < cpu_kh->nmemsegs; i++) { diff --git a/lib/libkvm/kvm_arm.c b/lib/libkvm/kvm_arm.c index d49aaff38ef..faa860a856b 100644 --- a/lib/libkvm/kvm_arm.c +++ b/lib/libkvm/kvm_arm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_arm.c,v 1.10 2018/05/15 10:04:44 otto Exp $ */ +/* $OpenBSD: kvm_arm.c,v 1.11 2021/12/01 16:53:28 deraadt Exp $ */ /* * Copyright (c) 2006 Miodrag Vallat. * @@ -50,10 +50,10 @@ * ARM machine dependent routines for kvm. */ -#include +#include /* MAXCOMLEN */ +#include #include #include -#include #include #include diff --git a/lib/libkvm/kvm_arm64.c b/lib/libkvm/kvm_arm64.c index d10c1604f91..dab933bb82f 100644 --- a/lib/libkvm/kvm_arm64.c +++ b/lib/libkvm/kvm_arm64.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_arm64.c,v 1.1 2017/01/11 14:32:36 patrick Exp $ */ +/* $OpenBSD: kvm_arm64.c,v 1.2 2021/12/01 16:53:28 deraadt Exp $ */ /* * Copyright (c) 2006 Miodrag Vallat. * @@ -50,10 +50,10 @@ * ARM64 machine dependent routines for kvm. */ -#include +#include /* MAXCOMLEN for sys/core.h */ +#include #include #include -#include #include #include diff --git a/lib/libkvm/kvm_hppa.c b/lib/libkvm/kvm_hppa.c index a82379edbef..3dd1d2286f6 100644 --- a/lib/libkvm/kvm_hppa.c +++ b/lib/libkvm/kvm_hppa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_hppa.c,v 1.10 2015/12/19 18:40:30 mmcc Exp $ */ +/* $OpenBSD: kvm_hppa.c,v 1.11 2021/12/01 16:53:28 deraadt Exp $ */ /* * Copyright (c) 2002, Miodrag Vallat. @@ -25,7 +25,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include +#include #include #include diff --git a/lib/libkvm/kvm_i386.c b/lib/libkvm/kvm_i386.c index 5c68c43c1f6..6114af4efab 100644 --- a/lib/libkvm/kvm_i386.c +++ b/lib/libkvm/kvm_i386.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_i386.c,v 1.27 2015/12/19 18:40:30 mmcc Exp $ */ +/* $OpenBSD: kvm_i386.c,v 1.28 2021/12/01 16:53:28 deraadt Exp $ */ /* $NetBSD: kvm_i386.c,v 1.9 1996/03/18 22:33:38 thorpej Exp $ */ /*- @@ -39,7 +39,8 @@ * vm code will one day obsolete this module. */ -#include +#include +#include #include #include #include @@ -48,6 +49,7 @@ #include #include +#include #include #include diff --git a/lib/libkvm/kvm_m88k.c b/lib/libkvm/kvm_m88k.c index 0d5df390e41..ea471152213 100644 --- a/lib/libkvm/kvm_m88k.c +++ b/lib/libkvm/kvm_m88k.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_m88k.c,v 1.6 2015/12/19 18:40:30 mmcc Exp $ */ +/* $OpenBSD: kvm_m88k.c,v 1.7 2021/12/01 16:53:28 deraadt Exp $ */ /* $NetBSD: kvm_alpha.c,v 1.2 1995/09/29 03:57:48 cgd Exp $ */ /* @@ -28,7 +28,9 @@ * rights to redistribute these changes. */ -#include +#include /* MAXCOMLEN */ +#include +#include #include #include #include diff --git a/lib/libkvm/kvm_mips64.c b/lib/libkvm/kvm_mips64.c index 6ab067725de..ea619bb218d 100644 --- a/lib/libkvm/kvm_mips64.c +++ b/lib/libkvm/kvm_mips64.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_mips64.c,v 1.16 2018/05/03 16:42:07 zhuk Exp $ */ +/* $OpenBSD: kvm_mips64.c,v 1.17 2021/12/01 16:53:28 deraadt Exp $ */ /* $NetBSD: kvm_mips.c,v 1.3 1996/03/18 22:33:44 thorpej Exp $ */ /*- @@ -39,7 +39,8 @@ * vm code will one day obsolete this module. */ -#include +#include +#include #include #include #include diff --git a/lib/libkvm/kvm_powerpc.c b/lib/libkvm/kvm_powerpc.c index 7bfc421651c..8693c565ba4 100644 --- a/lib/libkvm/kvm_powerpc.c +++ b/lib/libkvm/kvm_powerpc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_powerpc.c,v 1.10 2015/12/19 18:40:30 mmcc Exp $ */ +/* $OpenBSD: kvm_powerpc.c,v 1.11 2021/12/01 16:53:28 deraadt Exp $ */ /*- * Copyright (C) 1996 Wolfgang Solfrank. @@ -35,8 +35,9 @@ * PowerPC machine dependent routines for kvm. */ -#include -#include +#include /* MAXCOMLEN */ +#include +#include #include #include #include diff --git a/lib/libkvm/kvm_powerpc64.c b/lib/libkvm/kvm_powerpc64.c index 1be4f922dcd..80239b8f0b1 100644 --- a/lib/libkvm/kvm_powerpc64.c +++ b/lib/libkvm/kvm_powerpc64.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_powerpc64.c,v 1.1 2020/06/28 09:46:58 kettenis Exp $ */ +/* $OpenBSD: kvm_powerpc64.c,v 1.2 2021/12/01 16:53:28 deraadt Exp $ */ /* * Copyright (c) 2007 Miodrag Vallat. @@ -17,10 +17,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include /* MAXCOMLEN */ +#include #include #include -#include #include #include diff --git a/lib/libkvm/kvm_riscv64.c b/lib/libkvm/kvm_riscv64.c index 10d3d6b570c..68a5d64422a 100644 --- a/lib/libkvm/kvm_riscv64.c +++ b/lib/libkvm/kvm_riscv64.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_riscv64.c,v 1.1 2021/04/29 20:00:18 drahn Exp $ */ +/* $OpenBSD: kvm_riscv64.c,v 1.2 2021/12/01 16:53:28 deraadt Exp $ */ /* * Copyright (c) 2006 Miodrag Vallat. * @@ -50,10 +50,10 @@ * RISCV machine dependent routines for kvm. */ -#include +#include /* MAXCOMLEN */ +#include #include #include -#include #include #include diff --git a/lib/libkvm/kvm_sh.c b/lib/libkvm/kvm_sh.c index e4a72c7b7bc..4017e85b394 100644 --- a/lib/libkvm/kvm_sh.c +++ b/lib/libkvm/kvm_sh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_sh.c,v 1.7 2020/06/28 09:45:12 kettenis Exp $ */ +/* $OpenBSD: kvm_sh.c,v 1.8 2021/12/01 16:53:28 deraadt Exp $ */ /* * Copyright (c) 2007 Miodrag Vallat. @@ -17,10 +17,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include /* MAXCOMLEN */ +#include #include #include -#include #include #include diff --git a/lib/libkvm/kvm_sparc64.c b/lib/libkvm/kvm_sparc64.c index 3cf5c7e2145..d73b80f7b4a 100644 --- a/lib/libkvm/kvm_sparc64.c +++ b/lib/libkvm/kvm_sparc64.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_sparc64.c,v 1.11 2021/10/06 00:42:47 deraadt Exp $ */ +/* $OpenBSD: kvm_sparc64.c,v 1.12 2021/12/01 16:53:28 deraadt Exp $ */ /* $NetBSD: kvm_sparc64.c,v 1.7 2001/08/05 03:33:15 matt Exp $ */ /*- @@ -39,7 +39,7 @@ * vm code will one day obsolete this module. */ -#include /* MAXCOMLEN PAGE_SIZE */ +#include /* MAXCOMLEN */ #include #include #include @@ -53,6 +53,7 @@ #include +#include #include #include #include -- 2.20.1