diff options
author | Warner Losh <imp@FreeBSD.org> | 2023-02-27 14:27:45 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2023-02-27 14:37:32 +0000 |
commit | cd29688e8ec55a45cda1a5620dfc9b3ba297c0c1 (patch) | |
tree | d9aba6821bef27ce3ae43e94cb3d42252a854cd4 | |
parent | 28a5d88f7091d1fc72f4f1bd8562d3c8b15883f5 (diff) | |
download | src-cd29688e8ec55a45cda1a5620dfc9b3ba297c0c1.tar.gz src-cd29688e8ec55a45cda1a5620dfc9b3ba297c0c1.zip |
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
-rw-r--r-- | sys/dev/atkbdc/atkbdcreg.h | 4 | ||||
-rw-r--r-- | 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_ */ |