From: Heiko Stuebner heiko@sntech.de
[ Upstream commit 5e1c88679174e4bfe5d152060b06d370bd85de80 ]
Relying on other components to include those basic types is unreliable and may cause compile errors like:
../include/linux/mfd/qnap-mcu.h:13:9: error: unknown type name ‘u32’ 13 | u32 baud_rate; | ^~~ ../include/linux/mfd/qnap-mcu.h:17:9: error: unknown type name ‘bool’ 17 | bool usb_led; | ^~~~
So make sure, the types used in the header are available.
Signed-off-by: Heiko Stuebner heiko@sntech.de Link: https://lore.kernel.org/r/20250804130726.3180806-2-heiko@sntech.de Signed-off-by: Lee Jones lee@kernel.org Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES
- What changed: The header now includes `linux/types.h` at include/linux/mfd/qnap-mcu.h:10. This ensures the basic kernel types used by this header are always available.
- Why it matters: The header defines and declares interfaces using kernel types: - `u32` in `struct qnap_mcu_variant` at include/linux/mfd/qnap- mcu.h:15 - `bool` in `struct qnap_mcu_variant` at include/linux/mfd/qnap- mcu.h:19 - `u8` and `size_t` in function prototypes at include/linux/mfd/qnap- mcu.h:22 and include/linux/mfd/qnap-mcu.h:25 Without explicitly including `linux/types.h`, inclusion-order- dependent builds can fail with “unknown type name ‘u32’/‘bool’”, exactly as reported in the commit message.
- Scope and risk: The fix is a 2-line, isolated include addition in a private MFD header. It does not change runtime behavior, only makes the header self-sufficient. Risk of regression is negligible.
- User impact: This resolves real build failures when clients include `qnap-mcu.h` without having previously pulled in `linux/types.h` transitively. Multiple clients include this header (e.g., drivers/hwmon/qnap-mcu-hwmon.c:10, drivers/input/misc/qnap-mcu- input.c:10, drivers/leds/leds-qnap-mcu.c:9), so inconsistent include orders across subsystems can hit the error.
- History/context: The base driver landed in v6.14 (commit 998f70d1806bb), and the fix (commit 5e1c88679174e) is from Aug 2025. Stable branches containing the base QNAP MCU support but not this follow-up are susceptible. Backporting to all stable series which contain the QNAP MCU driver (v6.14+) is appropriate.
- Stable rules: This is a clear bug fix (build failure), minimal and contained, with no architectural changes or side effects, and confined to the MFD/QNAP MCU area. It fits stable backport criteria well.
include/linux/mfd/qnap-mcu.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/linux/mfd/qnap-mcu.h b/include/linux/mfd/qnap-mcu.h index 8d48c212fd444..42bf523f9a5b0 100644 --- a/include/linux/mfd/qnap-mcu.h +++ b/include/linux/mfd/qnap-mcu.h @@ -7,6 +7,8 @@ #ifndef _LINUX_QNAP_MCU_H_ #define _LINUX_QNAP_MCU_H_
+#include <linux/types.h> + struct qnap_mcu;
struct qnap_mcu_variant {