Skip to contentSkip to conversation

gpiolib: Disable compat ->read() code in UML case

PATCH In review Andy Shevchenko 2 participants 2 messages Oct 5, 2020 – Oct 7, 2020

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

PATCH 1/1 gpiolib: Disable compat ->read() code in UML case

It appears that UML (arch/um) has no compat.h header defined and hence can't compile a recently provided piece of code in GPIO library.

Disable compat ->read() code in UML case to avoid compilation errors.

While at it, use pattern which is already being used in the kernel elsewhere.

Fixes 5ad284ab3a01 ("gpiolib: Fix line event handling in syscall compatible mode")
---
 drivers/gpio/gpiolib-cdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpiolib-cdev.c +1 -1
index 76c36b05aef6..fed5a3b2172f 100644
@@ -425,7 +425,7 @@ static __poll_t lineevent_poll(struct file *file,
 
 static ssize_t lineevent_get_size(void)
 {
-#ifdef __x86_64__
+#if defined(CONFIG_X86_64) && !defined(CONFIG_UML)
 	/* i386 has no padding after 'id' */
 	if (in_ia32_syscall()) {
 		struct compat_gpioeevent_data {
Signature · 1 line
2.28.0
#1 lore raw
Quoted 10 lines · Andy Shevchenko

It appears that UML (arch/um) has no compat.h header defined and hence can't compile a recently provided piece of code in GPIO library.

Disable compat ->read() code in UML case to avoid compilation errors.

While at it, use pattern which is already being used in the kernel elsewhere.

Fixes 5ad284ab3a01 ("gpiolib: Fix line event handling in syscall compatible mode")

Patch applied for fixes.

Yours,
Linus Walleij