Skip to contentSkip to conversation

counter: 104-quad-8: Add COMPILE_TEST depends

PATCH Superseded William Breathitt Gray 2 participants 4 messages Jan 5, 2022 – Jan 10, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 counter: 104-quad-8: Add COMPILE_TEST depends

104_QUAD_8 depends on X86, but compiles fine on ARCH=arm. This patch adds support for COMPILE_TEST which is useful for compile testing code changes to the driver and Counter subsystem.

---
 drivers/counter/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/counter/Kconfig +1 -1
index 3dcdb681c4e4..5edd155f1911 100644
@@ -14,7 +14,7 @@ if COUNTER
 
 config 104_QUAD_8
 	tristate "ACCES 104-QUAD-8 driver"
-	depends on PC104 && X86
+	depends on (PC104 && X86) || COMPILE_TEST
 	select ISA_BUS_API
 	help
 	  Say yes here to build support for the ACCES 104-QUAD-8 quadrature

base-commit: 088879292a0a3672a6acc9215174fbc355ed3daa

Signature · 1 line
2.33.1
#1 lore raw
Quoted 16 lines · William Breathitt Gray

104_QUAD_8 depends on X86, but compiles fine on ARCH=arm. This patch adds support for COMPILE_TEST which is useful for compile testing code changes to the driver and Counter subsystem.

---
 drivers/counter/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/counter/Kconfig +0 -0
index 3dcdb681c4e4..5edd155f1911 100644

drivers/counter/Kconfig if COUNTER · line 17

Quoted 5 lines
drivers/counter/Kconfig +1 -1
@@ -14,7 +14,7 @@ if COUNTER
 
 config 104_QUAD_8
 	tristate "ACCES 104-QUAD-8 driver"
-	depends on PC104 && X86
+	depends on (PC104 && X86) || COMPILE_TEST

The driver uses inb and friends. Without looking I wonder if there is something like HAVE_IO or similar this needs to depend on for that?

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
#2 lore raw
Quoted 26 lines · Uwe Kleine-König
Quoted 16 lines · William Breathitt Gray

104_QUAD_8 depends on X86, but compiles fine on ARCH=arm. This patch adds support for COMPILE_TEST which is useful for compile testing code changes to the driver and Counter subsystem.

---
 drivers/counter/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/counter/Kconfig +0 -0
index 3dcdb681c4e4..5edd155f1911 100644

drivers/counter/Kconfig if COUNTER · line 17

Quoted 5 lines
drivers/counter/Kconfig +1 -1
@@ -14,7 +14,7 @@ if COUNTER
 
 config 104_QUAD_8
 	tristate "ACCES 104-QUAD-8 driver"
-	depends on PC104 && X86
+	depends on (PC104 && X86) || COMPILE_TEST

The driver uses inb and friends. Without looking I wonder if there is something like HAVE_IO or similar this needs to depend on for that?

Quoted 6 lines

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

If I'm not mistaken, on unsupported architectures include/linux/io.h will pull in include/asm-generic/io.h which has default implementations for inb and friends if they are not otherwise defined. It doesn't look like these default implementations are guarded by a Kconfig setting so we should be fine in this case.

William Breathitt Gray

#3 lore raw
Quoted 34 lines · William Breathitt Gray
Quoted 26 lines · Uwe Kleine-König
Quoted 16 lines · William Breathitt Gray

104_QUAD_8 depends on X86, but compiles fine on ARCH=arm. This patch adds support for COMPILE_TEST which is useful for compile testing code changes to the driver and Counter subsystem.

---
 drivers/counter/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/counter/Kconfig +0 -0
index 3dcdb681c4e4..5edd155f1911 100644

drivers/counter/Kconfig if COUNTER · line 17

Quoted 5 lines
drivers/counter/Kconfig +1 -1
@@ -14,7 +14,7 @@ if COUNTER
 
 config 104_QUAD_8
 	tristate "ACCES 104-QUAD-8 driver"
-	depends on PC104 && X86
+	depends on (PC104 && X86) || COMPILE_TEST

The driver uses inb and friends. Without looking I wonder if there is something like HAVE_IO or similar this needs to depend on for that?

Quoted 6 lines

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
Quoted 5 lines

If I'm not mistaken, on unsupported architectures include/linux/io.h will pull in include/asm-generic/io.h which has default implementations for inb and friends if they are not otherwise defined. It doesn't look like these default implementations are guarded by a Kconfig setting so we should be fine in this case.

Looks right, thanks for checking

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |