From cd29688e8ec55a45cda1a5620dfc9b3ba297c0c1 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 27 Feb 2023 07:27:45 -0700 Subject: kbdreg.h: include opt_kbd.h This is a kernel-only file, so it's safe to include opt_kbd.h. However, add #ifdef _KERNEL guards to emphasize that. And also move the include of opt_kbd.h in atkbdcreg.h to inside the kernel guards. Nothing outside the kernel in tree uses the rest of that file, but I'm less comfortable moving the #ifdef _KERNEL to the top of that file. Sponsored by: Netflix --- sys/dev/atkbdc/atkbdcreg.h | 4 ++-- sys/dev/kbd/kbdreg.h | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/atkbdc/atkbdcreg.h b/sys/dev/atkbdc/atkbdcreg.h index 956861b657d6..c0bfbf27a880 100644 --- a/sys/dev/atkbdc/atkbdcreg.h +++ b/sys/dev/atkbdc/atkbdcreg.h @@ -36,8 +36,6 @@ #ifndef _DEV_ATKBDC_ATKBDCREG_H_ #define _DEV_ATKBDC_ATKBDCREG_H_ -#include "opt_kbd.h" /* Structures depend on the value if KBDIO_DEBUG */ - /* constants */ /* I/O ports */ @@ -145,6 +143,8 @@ #ifdef _KERNEL +#include "opt_kbd.h" /* Structures depend on the value if KBDIO_DEBUG */ + #define ATKBDC_DRIVER_NAME "atkbdc" /* diff --git a/sys/dev/kbd/kbdreg.h b/sys/dev/kbd/kbdreg.h index 2839e259420d..822af48c932b 100644 --- a/sys/dev/kbd/kbdreg.h +++ b/sys/dev/kbd/kbdreg.h @@ -31,6 +31,10 @@ #ifndef _DEV_KBD_KBDREG_H_ #define _DEV_KBD_KBDREG_H_ +#ifdef _KERNEL + +#include "opt_kbd.h" /* KBD_DELAY* */ + /* forward declarations */ typedef struct keyboard keyboard_t; struct keymap; @@ -411,4 +415,5 @@ int genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg); int genkbd_keyaction(keyboard_t *kbd, int keycode, int up, int *shiftstate, int *accents); +#endif #endif /* !_DEV_KBD_KBDREG_H_ */ -- cgit v1.2.3