acpi_call icon indicating copy to clipboard operation
acpi_call copied to clipboard

Patch for kernel 4.12.4

Open wangxa opened this issue 8 years ago • 2 comments

The uaccess.h has moved from asm to linux in Kernel 4.12, so would you like add the following patch?

-#include <asm/uaccess.h>	         /* copy_*_user */
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)
+#include <asm/uaccess.h>             /* copy_*_user */
+#else
+#include <linux/uaccess.h>           /* copy_*_user */
+#endif

wangxa avatar Jul 29 '17 09:07 wangxa

Actually, linux/uaccess.h has always existed since at least 3.10 -- and includes asm/uaccess.h.

So I think the right thing to do is to just unconditionally include <asm/uaccess.h>

-#include <asm/uaccess.h> /* copy_user / +#include <linux/uaccess.h> / copy_user */

tytso avatar Aug 03 '17 06:08 tytso

So, is this the reason for this build failure:

error: implicit declaration of function 'copy_from_user' [-Werror=implicit-function-declaration]
     if (copy_from_user( input, buff, len )) {
         ^~~~~~~~~~~~~~

Edit: Yeah, including linux/uaccess.h instead of asm/uaccess.h results in a successful build

zhelezov avatar Oct 03 '17 08:10 zhelezov