]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
gpiolib: Disable compat ->read() code in UML case
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 5 Oct 2020 13:10:44 +0000 (16:10 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Oct 2020 09:55:48 +0000 (11:55 +0200)
commit 47e538d86d5776ac8152146c3ed3d22326243190 upstream.

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")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20201005131044.87276-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpio/gpiolib.c

index 6e813b13d6988bc7cf04886d977711e3a9fbd1ba..02154d8b1c0d5ddb89a545af5764116849cbea76 100644 (file)
@@ -838,7 +838,7 @@ static __poll_t lineevent_poll(struct file *filep,
 
 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 {