diff mbox series

[SRU,J,2/2] watchdog/hpwdt: Include nmi.h only if CONFIG_HPWDT_NMI_DECODING

Message ID 20230322223637.25584-3-michael.reed@canonical.com
State New
Headers show
Series Backport request for hpwdt from upstream 6.1 to Jammy | expand

Commit Message

Michael Reed March 22, 2023, 10:36 p.m. UTC
From: Jerry Hoemann <jerry.hoemann@hpe.com>

Fixes: d48b0e173715 ("x86, nmi, drivers: Fix nmi splitup build bug")

Arm64 does not support NMI and has no <asm/nmi.h>.

Include <asm/nmi.h> only if CONFIG_HPWDT_NMI_DECODING is defined to
avoid build failure on non-existent header file on Arm64.

BugLink: https://bugs.launchpad.net/bugs/2008751

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20220820202821.1263837-2-jerry.hoemann@hpe.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
(cherry picked from commit ed835d8171fc884c7750cdd54128df16d4571e3a)
Signed-off-by: Michael Reed <Michael.Reed@canonical.com>
---
 drivers/watchdog/hpwdt.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index a5006a58e0db..f79f932bca14 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -20,7 +20,9 @@ 
 #include <linux/pci_ids.h>
 #include <linux/types.h>
 #include <linux/watchdog.h>
+#ifdef CONFIG_HPWDT_NMI_DECODING
 #include <asm/nmi.h>
+#endif
 #include <linux/crash_dump.h>
 
 #define HPWDT_VERSION			"2.0.4"