From fb9da1ef430d15b7d23596e52a7b4b7646a98359 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Tue, 15 Oct 2002 21:35:01 +0000 Subject: [PATCH] Include "opt_kbd.h" since certain structures size depend on the value of KBDIO_DEBUG which may be defined in the kernel config (as it is in NOTES). This kind of bug is a _really_ horribly thing as we end up with one bit of code thinking a particular structure is 136 bytes and another that it is only 112 bytes. Ideally all places would remember to #include the right "opt_foo.h" file, but I think in practice file containing the variable sized struct should #include it explicitly as a precaution. Detected by: FlexeLint --- sys/dev/atkbdc/atkbdcreg.h | 2 ++ sys/dev/kbd/atkbdcreg.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/dev/atkbdc/atkbdcreg.h b/sys/dev/atkbdc/atkbdcreg.h index 92fcfc12f74..f2ec8442f53 100644 --- a/sys/dev/atkbdc/atkbdcreg.h +++ b/sys/dev/atkbdc/atkbdcreg.h @@ -34,6 +34,8 @@ #ifndef _DEV_KBD_ATKBDCREG_H_ #define _DEV_KBD_ATKBDCREG_H_ +#include "opt_kbd.h" /* Structures depend on the value if KBDIO_DEBUG */ + /* constants */ /* I/O ports */ diff --git a/sys/dev/kbd/atkbdcreg.h b/sys/dev/kbd/atkbdcreg.h index 92fcfc12f74..f2ec8442f53 100644 --- a/sys/dev/kbd/atkbdcreg.h +++ b/sys/dev/kbd/atkbdcreg.h @@ -34,6 +34,8 @@ #ifndef _DEV_KBD_ATKBDCREG_H_ #define _DEV_KBD_ATKBDCREG_H_ +#include "opt_kbd.h" /* Structures depend on the value if KBDIO_DEBUG */ + /* constants */ /* I/O ports */